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

A simple class to hold the fields to write to the output files and the order to write them. More...

#include <DICe_Schema.h>

Public Member Functions

 Output_Spec (Schema *schema, const bool omit_row_id=false, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null, const std::string &delimiter=" ")
 Output_Spec constructor with several optional input params. More...
 
void write_header (std::FILE *file, const std::string &row_id="")
 Writes the file header information. More...
 
void write_info (std::FILE *file, const bool include_time_of_day)
 Writes the run information (interpolants used, etc.) More...
 
void write_stats (std::FILE *file)
 appends statistics for each subset to the info file More...
 
void write_frame (std::FILE *file, const int_t row_index, const int_t field_value_index)
 Writes the fields for the current frame. More...
 
std::vector< Teuchos::RCP< MultiField > > * field_vec ()
 provide access to the field_vec
 
void gather_fields ()
 gather all the fields necessary to write the output
 

Private Attributes

std::vector< std::string > field_names_
 Vector of field names that will be output to file.
 
Schemaschema_
 Pointer to the parent schema (used to obtain field values)
 
std::string delimiter_
 Delimeter to use in the output file.
 
bool omit_row_id_
 True if the row_id should be omited (first column of output)
 
std::vector< Teuchos::RCP< MultiField > > field_vec_
 Vector of pointers to mesh fields to use for output.
 

Detailed Description

A simple class to hold the fields to write to the output files and the order to write them.

The user may want the output in a specific format (in terms of the order of the fields). A DICe::Output_Spec holds this order and also provides some output helper functions

Constructor & Destructor Documentation

◆ Output_Spec()

DICe::Output_Spec::Output_Spec ( Schema schema,
const bool  omit_row_id = false,
const Teuchos::RCP< Teuchos::ParameterList > &  params = Teuchos::null,
const std::string &  delimiter = " " 
)

Output_Spec constructor with several optional input params.

Parameters
schemaPointer to the parent DICe::Schema (used to access field values, etc.)
omit_row_idTrue if each row should not be labelled with a subset_id or frame_number (skips the first column of output)
paramsParameterList of the field names and their order
delimiterString value of the delimiter (space " " or comma ",", could also use a combo ", ")

Member Function Documentation

◆ write_frame()

void DICe::Output_Spec::write_frame ( std::FILE *  file,
const int_t  row_index,
const int_t  field_value_index 
)

Writes the fields for the current frame.

Parameters
filePointer to the output file (must already be open)
row_indexThe label for the current row (typically frame_number or subset_id)
field_value_indexIndex of the field values. If the output_separate_file_for_each_subset option is enabled, the row_index and field_value_index will not be the same. The row_index will be the frame_number and the field_value_index will be the subset_id. In the default output (one file per frame that lists all subsets, one per row) row_index and field_value_index will be the same.

◆ write_header()

void DICe::Output_Spec::write_header ( std::FILE *  file,
const std::string &  row_id = "" 
)

Writes the file header information.

Parameters
filePointer to the output file (must already be open)
row_idOptional name for the row_id column (typically "FRAME" or "SUBSET_ID")

◆ write_info()

void DICe::Output_Spec::write_info ( std::FILE *  file,
const bool  include_time_of_day 
)

Writes the run information (interpolants used, etc.)

Parameters
filePointer to the output file (must already be open)
include_time_of_daystamp the start of the run

◆ write_stats()

void DICe::Output_Spec::write_stats ( std::FILE *  file)

appends statistics for each subset to the info file

Parameters
filePointer to the output file (must already be open)