Digital Image Correlation Engine  Version 1.0
A modular, high-performance, image correlation tool used to compute full-field displacements and strains from digital images
Public Member Functions | Private Attributes | List of all members
DICe::MultiField Class Reference

A container class for the data structures used in DICe This class was created to enable switching back and forth between data structures based on the compute architecture. More...

#include <DICe_MultiFieldEpetra.h>

Public Member Functions

 MultiField (Teuchos::RCP< MultiField_Map > &map, const int_t &num_fields, const bool &zero_values=false)
 Default constructor. More...
 
virtual ~MultiField ()
 Destructor.
 
Teuchos::RCP< MultiField_Mapget_map () const
 Returns a pointer to this field's map.
 
int_t get_num_fields () const
 Returns the number of fields.
 
Teuchos::RCP< Epetra_MultiVector > get () const
 Returns a pointer to the underlying vector data type.
 
mv_scalar_type & global_value (const int_t global_id, const int_t field_index=0)
 value accessor More...
 
mv_scalar_type & local_value (const int_t local_id, const int_t field_index=0)
 value accessor More...
 
void update (const mv_scalar_type &alpha, const MultiField &multifield, const mv_scalar_type &beta)
 axpby for MultiField More...
 
void do_import (Teuchos::RCP< MultiField > multifield, MultiField_Importer &importer, const Combine_Mode mode=INSERT)
 import the data from one distributed object to this one More...
 
void do_import (Teuchos::RCP< MultiField > multifield, MultiField_Exporter &exporter, const Combine_Mode mode=INSERT)
 import the data from one distributed object to this one More...
 
void do_export (Teuchos::RCP< MultiField > multifield, MultiField_Exporter &exporter, const Combine_Mode mode=INSERT)
 export the data from one distributed object to this one More...
 
Teuchos::ArrayRCP< const scalar_tget_1d_view () const
 Return an array of values for the multifield (most only contain one vector so the first index is 0)
 
scalar_t norm (const int_t field_index=0)
 
scalar_t norm (Teuchos::RCP< MultiField > multifield)
 
void put_scalar (const mv_scalar_type &scalar)
 
void describe () const
 print the vector to the screen
 
 MultiField (Teuchos::RCP< MultiField_Map > map, const int_t &num_fields, const bool &zero_values=false)
 Default constructor. More...
 
virtual ~MultiField ()
 Destructor.
 
Teuchos::RCP< MultiField_Mapget_map () const
 Returns a pointer to the map for this field.
 
int_t get_num_fields () const
 Returns the number of fields.
 
Teuchos::RCP< vec_type > get () const
 Returns a pointer to the underlying vector data type.
 
void describe () const
 Print the matrix to the screen.
 
scalar_tglobal_value (const int_t global_id, const int_t field_index=0)
 value accessor More...
 
scalar_tlocal_value (const int_t local_id, const int_t field_index=0)
 value accessor More...
 
void put_scalar (const scalar_t &value)
 put that same value in all elements of this Multivector More...
 
void update (const scalar_t &alpha, const MultiField &multifield, const scalar_t &beta)
 axpby for MultiField More...
 
void do_import (Teuchos::RCP< MultiField > multifield, MultiField_Importer &importer, const Combine_Mode mode=INSERT)
 import the data from one distributed object to this one More...
 
void do_import (Teuchos::RCP< MultiField > multifield, MultiField_Exporter &exporter, const Combine_Mode mode=INSERT)
 import the data from one distributed object to this one More...
 
void do_export (Teuchos::RCP< MultiField > multifield, MultiField_Exporter &exporter, const Combine_Mode mode=INSERT)
 export the data from one distributed object to this one More...
 
scalar_t norm (const int_t field_index=0)
 
scalar_t norm (Teuchos::RCP< MultiField > multifield)
 
Teuchos::ArrayRCP< const scalar_tget_1d_view () const
 returns a view of the multivector's data
 

Private Attributes

Teuchos::RCP< Epetra_MultiVector > epetra_mv_
 Pointer to the underlying data type.
 
Teuchos::RCP< MultiField_Mapmap_
 Pointer to the underlying map.
 
Teuchos::RCP< vec_type > tpetra_mv_
 Pointer to the underlying data type.
 

Detailed Description

A container class for the data structures used in DICe This class was created to enable switching back and forth between data structures based on the compute architecture.

Constructor & Destructor Documentation

◆ MultiField() [1/2]

DICe::MultiField::MultiField ( Teuchos::RCP< MultiField_Map > &  map,
const int_t num_fields,
const bool &  zero_values = false 
)
inline

Default constructor.

Parameters
mapthe map that organizes the data across processors
num_fieldsthe number of fields stored as columns
zero_valuesset to true if the vectors should be initialized with zeros

◆ MultiField() [2/2]

DICe::MultiField::MultiField ( Teuchos::RCP< MultiField_Map map,
const int_t num_fields,
const bool &  zero_values = false 
)
inline

Default constructor.

Parameters
mapthe map that organizes the data across processors
num_fieldsthe number of fields stored as columns
zero_valuesset to true if the vectors should be initialized with zeros

Member Function Documentation

◆ do_export() [1/2]

void DICe::MultiField::do_export ( Teuchos::RCP< MultiField multifield,
MultiField_Exporter exporter,
const Combine_Mode  mode = INSERT 
)
inline

export the data from one distributed object to this one

Parameters
multifieldthe multifield to export
exporterthe exporter defines how the information will be transferred
modecombine mode

◆ do_export() [2/2]

void DICe::MultiField::do_export ( Teuchos::RCP< MultiField multifield,
MultiField_Exporter exporter,
const Combine_Mode  mode = INSERT 
)
inline

export the data from one distributed object to this one

Parameters
multifieldthe multifield to export
exporterthe exporter defines how the information will be transferred
modecombine mode

◆ do_import() [1/4]

void DICe::MultiField::do_import ( Teuchos::RCP< MultiField multifield,
MultiField_Exporter exporter,
const Combine_Mode  mode = INSERT 
)
inline

import the data from one distributed object to this one

Parameters
multifieldthe multifield to import
exporterthe importer defines how the information will be transferred
modecombine mode

For more information about importing and exporting see the Trilinos docs

◆ do_import() [2/4]

void DICe::MultiField::do_import ( Teuchos::RCP< MultiField multifield,
MultiField_Exporter exporter,
const Combine_Mode  mode = INSERT 
)
inline

import the data from one distributed object to this one

Parameters
multifieldthe multifield to import
exporterthe importer defines how the information will be transferred
modecombine mode

For more information about importing and exporting see the Trilinos docs

◆ do_import() [3/4]

void DICe::MultiField::do_import ( Teuchos::RCP< MultiField multifield,
MultiField_Importer importer,
const Combine_Mode  mode = INSERT 
)
inline

import the data from one distributed object to this one

Parameters
multifieldthe multifield to import
importerthe importer defines how the information will be transferred
modecombine mode

For more information about importing and exporting see the Trilinos docs

◆ do_import() [4/4]

void DICe::MultiField::do_import ( Teuchos::RCP< MultiField multifield,
MultiField_Importer importer,
const Combine_Mode  mode = INSERT 
)
inline

import the data from one distributed object to this one

Parameters
multifieldthe multifield to import
importerthe importer defines how the information will be transferred
modecombine mode

For more information about importing and exporting see the Trilinos docs

◆ global_value() [1/2]

mv_scalar_type& DICe::MultiField::global_value ( const int_t  global_id,
const int_t  field_index = 0 
)
inline

value accessor

Parameters
global_idthe global id of the intended element
field_indexthe index of the field to access Warning: Epetra does not have a scalar type, its hard coded as mv_scalar_type

◆ global_value() [2/2]

scalar_t& DICe::MultiField::global_value ( const int_t  global_id,
const int_t  field_index = 0 
)
inline

value accessor

Parameters
global_idthe global id of the intended element
field_indexthe index of the field to access

◆ local_value() [1/2]

mv_scalar_type& DICe::MultiField::local_value ( const int_t  local_id,
const int_t  field_index = 0 
)
inline

value accessor

Parameters
local_idthe local id of the intended element
field_indexthe index of the field to access Warning: Epetra does not have a scalar type, its hard coded as mv_scalar_type

◆ local_value() [2/2]

scalar_t& DICe::MultiField::local_value ( const int_t  local_id,
const int_t  field_index = 0 
)
inline

value accessor

Parameters
local_idthe global id of the intended element
field_indexthe index of the field to access

◆ norm() [1/4]

scalar_t DICe::MultiField::norm ( const int_t  field_index = 0)
inline

Compute the 2 norm of the vector

Parameters
field_indexThe field of which to take the norm

◆ norm() [2/4]

scalar_t DICe::MultiField::norm ( const int_t  field_index = 0)
inline

Compute the 2 norm of the vector

Parameters
field_indexThe field of which to take the norm

◆ norm() [3/4]

scalar_t DICe::MultiField::norm ( Teuchos::RCP< MultiField multifield)
inline

Compute the 2 norm of this vector minus another

Parameters
multifieldthe field to diff against

◆ norm() [4/4]

scalar_t DICe::MultiField::norm ( Teuchos::RCP< MultiField multifield)
inline

Compute the 2 norm of this vector minus another

Parameters
multifieldthe field to diff against

◆ put_scalar() [1/2]

void DICe::MultiField::put_scalar ( const mv_scalar_type &  scalar)
inline

set all the values in this field to the given scalar

Parameters
scalar

◆ put_scalar() [2/2]

void DICe::MultiField::put_scalar ( const scalar_t value)
inline

put that same value in all elements of this Multivector

Parameters
valueThe value to populate with

◆ update() [1/2]

void DICe::MultiField::update ( const mv_scalar_type &  alpha,
const MultiField multifield,
const mv_scalar_type &  beta 
)
inline

axpby for MultiField

Parameters
alphaMultiplier of the input MultiField
multifieldInput multifield
betaMultiplier of this Multifield Result is this = beta*this + alpha*multifield

◆ update() [2/2]

void DICe::MultiField::update ( const scalar_t alpha,
const MultiField multifield,
const scalar_t beta 
)
inline

axpby for MultiField

Parameters
alphaMultiplier of the input MultiField
multifieldInput multifield
betaMultiplier of this Multifield Result is this = beta*this + alpha*multifield