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 | Protected Attributes | List of all members
DICe::Local_Shape_Function Class Referenceabstract
Inheritance diagram for DICe::Local_Shape_Function:
DICe::Affine_Shape_Function DICe::Projection_Shape_Function DICe::Quadratic_Shape_Function DICe::Rigid_Body_Shape_Function

Public Member Functions

 Local_Shape_Function ()
 base class constructor
 
virtual ~Local_Shape_Function ()
 virtual destructor
 
int_t num_params () const
 the number of parameters in the shape function
 
std::vector< scalar_t > * parameters ()
 access to the parameter values
 
void print_parameters () const
 print the parameter values to DEBUG_MSG
 
virtual void save_fields (Schema *schema, const int_t subset_gid)
 
virtual void reset_fields (Schema *schema)
 
void clone (Teuchos::RCP< Local_Shape_Function > shape_function)
 
virtual void initialize_parameters_from_fields (Schema *schema, const int_t subset_gid)
 
virtual void map (const scalar_t &x, const scalar_t &y, const scalar_t &cx, const scalar_t &cy, scalar_t &out_x, scalar_t &out_y)=0
 
virtual void add_translation (const scalar_t &u, const scalar_t &v)=0
 
virtual void insert_motion (const scalar_t &u, const scalar_t &v, const scalar_t &theta)=0
 
virtual void insert_motion (const scalar_t &u, const scalar_t &v)=0
 
virtual void clear ()
 clear the parameters
 
virtual void map_to_u_v_theta (const scalar_t &cx, const scalar_t &cy, scalar_t &out_u, scalar_t &out_v, scalar_t &out_theta)=0
 
virtual void update_params_for_centroid_change (const scalar_t &delta_x, const scalar_t &delta_y)=0
 
scalar_toperator() (const DICe::field_enums::Field_Spec &spec)
 
scalar_toperator() (const size_t index)
 
scalar_t parameter (const DICe::field_enums::Field_Spec &spec) const
 
virtual void residuals (const scalar_t &x, const scalar_t &y, const scalar_t &cx, const scalar_t &cy, const scalar_t &gx, const scalar_t &gy, std::vector< scalar_t > &residuals, const bool use_ref_grads=false)=0
 
void update (const std::vector< scalar_t > &update)
 
virtual bool test_for_convergence (const std::vector< scalar_t > &old_parameters, const scalar_t &tol)
 
Teuchos::RCP< std::vector< scalar_t > > rcp ()
 
Teuchos::RCP< std::vector< scalar_t > > deltas ()
 returns a pointer to the vector of delta values for this shape function
 
std::map< DICe::field_enums::Field_Spec, size_t > * spec_map ()
 returns a pointer to the spec map
 

Protected Attributes

std::vector< scalar_tparameters_
 a vector that holds the parameters of the shape function
 
std::vector< scalar_tdeltas_
 a vector that holds the deltas to use for a simplex method
 
int_t num_params_
 the total number of degrees of freedom
 
std::map< DICe::field_enums::Field_Spec, size_t > spec_map_
 stores the associated field with each DOF and the corresponding parameter index
 

Member Function Documentation

◆ add_translation()

virtual void DICe::Local_Shape_Function::add_translation ( const scalar_t u,
const scalar_t v 
)
pure virtual

add the specified translation to the shape function parameter values

Parameters
udisplacement in x
vdisplacement in y

Implemented in DICe::Rigid_Body_Shape_Function, DICe::Projection_Shape_Function, DICe::Quadratic_Shape_Function, and DICe::Affine_Shape_Function.

◆ clone()

void DICe::Local_Shape_Function::clone ( Teuchos::RCP< Local_Shape_Function shape_function)

clone the parameters values of another shape function

Parameters
shape_functionthe shape function to clone

◆ initialize_parameters_from_fields()

virtual void DICe::Local_Shape_Function::initialize_parameters_from_fields ( Schema schema,
const int_t  subset_gid 
)
virtual

gather the field values for each parameter

Parameters
schemapointer to a schema that has the fields
subset_gidthe id of the subset to use

Reimplemented in DICe::Affine_Shape_Function.

◆ insert_motion() [1/2]

virtual void DICe::Local_Shape_Function::insert_motion ( const scalar_t u,
const scalar_t v 
)
pure virtual

replace the paramaters associated with u and v

Parameters
uinput displacement in x
vinput displacement in y

Implemented in DICe::Rigid_Body_Shape_Function, DICe::Projection_Shape_Function, DICe::Quadratic_Shape_Function, and DICe::Affine_Shape_Function.

◆ insert_motion() [2/2]

virtual void DICe::Local_Shape_Function::insert_motion ( const scalar_t u,
const scalar_t v,
const scalar_t theta 
)
pure virtual

replace the paramaters associated with u,v, and theta

Parameters
uinput displacement in x
vinput displacement in y
thetainput rotation

Implemented in DICe::Rigid_Body_Shape_Function, DICe::Projection_Shape_Function, DICe::Quadratic_Shape_Function, and DICe::Affine_Shape_Function.

◆ map()

virtual void DICe::Local_Shape_Function::map ( const scalar_t x,
const scalar_t y,
const scalar_t cx,
const scalar_t cy,
scalar_t out_x,
scalar_t out_y 
)
pure virtual

map the input coordinates to the output coordinates

Parameters
xinput x coordinate
yinput y coordinate
cxinput centroid coordinate (dummy variable for some shape functions)
cyinput centroid coordinate (dummy variable for some shape functions)
out_xmapped x coordinate
out_ymapped y coordinate

Implemented in DICe::Rigid_Body_Shape_Function, DICe::Projection_Shape_Function, DICe::Quadratic_Shape_Function, and DICe::Affine_Shape_Function.

◆ map_to_u_v_theta()

virtual void DICe::Local_Shape_Function::map_to_u_v_theta ( const scalar_t cx,
const scalar_t cy,
scalar_t out_u,
scalar_t out_v,
scalar_t out_theta 
)
pure virtual

converts the current map parameters to u, v, and theta

Parameters
cxinput centroid coordinate (dummy variable for some shape functions)
cyinput centroid coordinate (dummy variable for some shape functions)
out_ureturns the displacement x value
out_vreturns the displacement y value
out_thetareturns the rotation

Implemented in DICe::Rigid_Body_Shape_Function, DICe::Projection_Shape_Function, DICe::Quadratic_Shape_Function, and DICe::Affine_Shape_Function.

◆ operator()() [1/2]

scalar_t& DICe::Local_Shape_Function::operator() ( const DICe::field_enums::Field_Spec spec)
inline

returns a reference to the given field spec location in the parameter vector

Parameters
specthe field spec

◆ operator()() [2/2]

scalar_t& DICe::Local_Shape_Function::operator() ( const size_t  index)
inline

returns a reference to the given field spec location in the parameter vector

Parameters
indexindex of the vector entry

◆ parameter()

scalar_t DICe::Local_Shape_Function::parameter ( const DICe::field_enums::Field_Spec spec) const
inline

returns the value the given field spec location in the parameter vector if it exists or zero if it does not

Parameters
specthe field spec

◆ reset_fields()

virtual void DICe::Local_Shape_Function::reset_fields ( Schema schema)
virtual

clears all the fields associated with this shape function

Parameters
schemapointer to a schema that holds the mesh with the fields

Reimplemented in DICe::Rigid_Body_Shape_Function, DICe::Projection_Shape_Function, and DICe::Quadratic_Shape_Function.

◆ residuals()

virtual void DICe::Local_Shape_Function::residuals ( const scalar_t x,
const scalar_t y,
const scalar_t cx,
const scalar_t cy,
const scalar_t gx,
const scalar_t gy,
std::vector< scalar_t > &  residuals,
const bool  use_ref_grads = false 
)
pure virtual

method that computes the residuals for this shape function

Parameters
xx-coordinate of the point to compute for
yy-coordinate of the point to compute for
cxinput centroid coordinate (dummy variable for some shape functions)
cyinput centroid coordinate (dummy variable for some shape functions)
gxx image gradient
gyy image gradient
residuals[out] the vector to store the residuals in
use_ref_gradstrue if the gradients should be used from the reference image (so they need to be adjusted for the current def map)

Implemented in DICe::Rigid_Body_Shape_Function, DICe::Projection_Shape_Function, DICe::Quadratic_Shape_Function, and DICe::Affine_Shape_Function.

◆ save_fields()

virtual void DICe::Local_Shape_Function::save_fields ( Schema schema,
const int_t  subset_gid 
)
virtual

save off the parameters to the correct fields

Parameters
schemathe schema that has the mesh with associated fields
subset_gidthe global id of the subset to save the fields for

Reimplemented in DICe::Rigid_Body_Shape_Function, DICe::Projection_Shape_Function, and DICe::Quadratic_Shape_Function.

◆ test_for_convergence()

virtual bool DICe::Local_Shape_Function::test_for_convergence ( const std::vector< scalar_t > &  old_parameters,
const scalar_t tol 
)
virtual

returns true if the solution is converged

Parameters
old_parametersvector of the previous guess for the parameters
tolthe solution tolerance

Reimplemented in DICe::Affine_Shape_Function.

◆ update()

void DICe::Local_Shape_Function::update ( const std::vector< scalar_t > &  update)

update the parameter values based on an input vector

Parameters
updatereference to the update vector

◆ update_params_for_centroid_change()

virtual void DICe::Local_Shape_Function::update_params_for_centroid_change ( const scalar_t delta_x,
const scalar_t delta_y 
)
pure virtual

converts the mapping from referencing one centroid to another

Parameters
delta_xchange in centroid x location
delta_ychange in centroid y location

Implemented in DICe::Rigid_Body_Shape_Function, DICe::Projection_Shape_Function, DICe::Quadratic_Shape_Function, and DICe::Affine_Shape_Function.