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::Path_Initializer Class Reference

A class that takes a text file as input and produces a unique set of points to test when initializing a subset. The text file gets filtered down to a certain resolution and then duplicate points are removed. This class is useful when the path of a particular subset is pre-defined, for example in a mechanism. This class also provides some basic methods for testing solution values and finding the nearest point on the path. More...

#include <DICe_Initializer.h>

Inheritance diagram for DICe::Path_Initializer:
DICe::Initializer

Public Member Functions

 Path_Initializer (Schema *schema, Teuchos::RCP< Subset > subset, const char *file_name, const size_t num_neighbors=6)
 
virtual ~Path_Initializer ()
 virtual destructor
 
const std::set< def_triad > * triads () const
 accessor for triad values
 
size_t num_triads () const
 returns the number of triads in the set
 
size_t num_neighbors () const
 return the number of neighbors for each triad
 
size_t neighbor (const size_t triad_id, const size_t neighbor_index) const
 
void closest_triad (const scalar_t &u, const scalar_t &v, const scalar_t &t, size_t &id, scalar_t &distance_sqr) const
 
virtual void pre_execution_tasks ()
 see base class description
 
virtual Status_Flag initial_guess (const int_t subset_gid, Teuchos::RCP< Local_Shape_Function > shape_function)
 see base class description
 
scalar_t initial_guess (Teuchos::RCP< Image > def_image, Teuchos::RCP< Local_Shape_Function > shape_function, const scalar_t &u, const scalar_t &v, const scalar_t &t)
 
scalar_t initial_guess (Teuchos::RCP< Image > def_image, Teuchos::RCP< Local_Shape_Function > shape_function)
 
void write_to_text_file (const std::string &file_name) const
 write the filtered set of points out to an output file
 
- Public Member Functions inherited from DICe::Initializer
 Initializer (Schema *schema)
 base class constructor
 
virtual ~Initializer ()
 virtual destructor
 

Private Attributes

Teuchos::RCP< Subsetsubset_
 pointer to the subset being initialized
 
std::set< def_triadtriads_
 unique triads of deformation params: u, v, and t
 
size_t num_triads_
 number of unique triads
 
size_t num_neighbors_
 k-closest neighbors for each point in the set of triads
 
std::vector< size_t > neighbors_
 a strided array of neighbor ids
 
Teuchos::RCP< kd_tree_3d_t > kd_tree_
 pointer to the kd-tree used for searching
 
Teuchos::RCP< Point_Cloud_3D< scalar_t > > point_cloud_
 pointer to the point cloud used for the neighbor searching
 

Additional Inherited Members

- Protected Attributes inherited from DICe::Initializer
Schemaschema_
 pointer to the schema that created this initializer, used for field access
 

Detailed Description

A class that takes a text file as input and produces a unique set of points to test when initializing a subset. The text file gets filtered down to a certain resolution and then duplicate points are removed. This class is useful when the path of a particular subset is pre-defined, for example in a mechanism. This class also provides some basic methods for testing solution values and finding the nearest point on the path.

Constructor & Destructor Documentation

◆ Path_Initializer()

DICe::Path_Initializer::Path_Initializer ( Schema schema,
Teuchos::RCP< Subset subset,
const char *  file_name,
const size_t  num_neighbors = 6 
)

constructor

Parameters
schemapointer to the parent schema (with all the field info)
subsetpointer to a specific subset
file_namethe name of the file to use for input. The input should be in the following format: ascii text file with values separated by spaces in three columns. The first column is the x displacement, the second column is y displacement and the third is rotation. If one of these columns is not needed, a column of zeros should still be provided. Also, there should not be any blank lines at the end of the file. TODO create a more robust file reader. No header should be included in the text file.
num_neighborsthe k value for the k-closest neighbors to store for each point

Member Function Documentation

◆ closest_triad()

void DICe::Path_Initializer::closest_triad ( const scalar_t u,
const scalar_t v,
const scalar_t t,
size_t &  id,
scalar_t distance_sqr 
) const

return the id of the path triad closest to the given point

Parameters
udisplacement in x
vdisplacement in y
trotation
id[out] the return id of the closest triad
distance_sqr[out] the euclidean distance to this point

◆ initial_guess() [1/2]

scalar_t DICe::Path_Initializer::initial_guess ( Teuchos::RCP< Image def_image,
Teuchos::RCP< Local_Shape_Function shape_function 
)

Initializer where the entire set of path triads will be searched for the best solution

Parameters
def_imagepointer to the deformed image
shape_function[out] the shape function to initialize

◆ initial_guess() [2/2]

scalar_t DICe::Path_Initializer::initial_guess ( Teuchos::RCP< Image def_image,
Teuchos::RCP< Local_Shape_Function shape_function,
const scalar_t u,
const scalar_t v,
const scalar_t t 
)

Initialize the subset in the vicinity of the previous guess

Parameters
def_imagethe deformed image
shape_function[out] the shape function to initialize
uprevious displacemcent x
vprevious displacement y
tprevious theta in this case only the closest k-neighbors will be searched for the best solution

◆ neighbor()

size_t DICe::Path_Initializer::neighbor ( const size_t  triad_id,
const size_t  neighbor_index 
) const
inline

return the id of the neighbor

Parameters
triad_idthe id of the triad to gather a neighbor for
neighbor_indexthe index of the neighbor