Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
Recorder Class Reference

Class that stores the node, element, and section responses for a given analysis. More...

#include <Recorder.hpp>

Collaboration diagram for Recorder:

Public Member Functions

 Recorder (std::string file, std::string name, unsigned int nparaview, unsigned int nsample=1, unsigned int precision=10)
 Creates a Recorder object to store Paraview solutions. More...
 
 Recorder (std::string file, std::string name, std::string type, std::vector< unsigned int > index, unsigned int nsample=1, unsigned int precision=10)
 Creates a Recorder object to store Node / Element solutions. More...
 
 Recorder (std::string file, std::string name, std::string type, std::vector< double > coordinates, std::vector< unsigned int > index, unsigned int nsample=1, unsigned int precision=10)
 Creates a Recorder object to store Section solutions. More...
 
 ~Recorder ()
 Destroys this Recorder object. More...
 
std::unique_ptr< RecorderCopyRecorder ()
 Clone the 'Recorder' object. More...
 
std::string GetName ()
 Return the recorder name. More...
 
void Initialize (std::shared_ptr< Mesh > &mesh, unsigned int nsteps)
 Initialize the recorder. More...
 
void WriteResponse (std::shared_ptr< Mesh > &mesh, unsigned int step)
 Write information in the recorder. More...
 
void Finalize ()
 Finalize the recorder. More...
 
void SetComboName (std::string name)
 Sets the combination's name. More...
 
void SetDRMParaviewInterface (std::map< unsigned int, bool > &DRMElems)
 Sets the possible DRM Element indexes. More...
 

Private Member Functions

void WriteNodalResponse (std::shared_ptr< Mesh > &mesh)
 Writes state variable data to the file. More...
 
void WriteElementResponse (std::shared_ptr< Mesh > &mesh)
 Writes element data to the file. More...
 
void WriteSectionResponse (std::shared_ptr< Mesh > &mesh)
 Writes section element data to the file. More...
 
void WriteVTKFiles (std::shared_ptr< Mesh > &mesh, unsigned int step)
 Writes output data in VTK format to the file. More...
 
std::string GetSpacedName (std::string theFile, std::string toReplace)
 Fix blank spaces provided by user in path. More...
 
void SetThreshold (Eigen::VectorXd &U, double WinTol=1E-33)
 Windows patch for small values. More...
 

Private Attributes

std::string File
 The name of the file to record. More...
 
std::string Name
 The object name to record solution. More...
 
std::string Combo
 The name of the LoadCombo. More...
 
std::string Response
 The object response to be stored. More...
 
unsigned int nSample
 The number of sampling points to record the solution. More...
 
unsigned int Counter
 The sampling rate counter. More...
 
unsigned int nParaview
 The number of features to be written in paraview. More...
 
unsigned int Precision
 The precision for results. More...
 
std::vector< double > Position
 Section position at strain/stress is computed. More...
 
std::vector< unsigned int > IDs
 Nodal/Element indexes to be recorded. More...
 
std::map< unsigned int, unsigned int > Tag
 Nodal Local indexes for this partition. More...
 
std::map< unsigned int, bool > IsDRMElem
 Nodal Local indexes for this partition. More...
 
std::ofstream OutputFile
 Name of the recorder handler. More...
 

Detailed Description

Class that stores the node, element, and section responses for a given analysis.

See also
Node.hpp Element.hpp Section.hpp

Constructor & Destructor Documentation

◆ Recorder() [1/3]

Recorder::Recorder ( std::string  file,
std::string  name,
unsigned int  nparaview,
unsigned int  nsample = 1,
unsigned int  precision = 10 
)

Creates a Recorder object to store Paraview solutions.

Parameters
fileThe file name where the results are going to be stored.
nameThe object name where the response is computed.
nparaviewThe number of features (for elements) to be written in Paraview.
nsampleThe number of sampling points to record the solution.
precisionThe precision number to store the results.
Note
More details can be found at Recorder.
See also
Recorder::Path, Recorder::Name, Recorder::Response, Recorder::IDs.

◆ Recorder() [2/3]

Recorder::Recorder ( std::string  file,
std::string  name,
std::string  type,
std::vector< unsigned int >  index,
unsigned int  nsample = 1,
unsigned int  precision = 10 
)

Creates a Recorder object to store Node / Element solutions.

Parameters
fileThe file name where the results are going to be stored.
nameThe object name where the response is computed.
typeThe response to be stored.
indexThe object identifiers that are going to be stored.
nsampleThe number of sampling points to record the solution.
precisionThe precision number to store the results.
Note
More details can be found at Recorder.
See also
Recorder::Path, Recorder::Name, Recorder::Response, Recorder::IDs.

◆ Recorder() [3/3]

Recorder::Recorder ( std::string  file,
std::string  name,
std::string  type,
std::vector< double >  coordinates,
std::vector< unsigned int >  index,
unsigned int  nsample = 1,
unsigned int  precision = 10 
)

Creates a Recorder object to store Section solutions.

Parameters
fileThe file name where the results are going to be stored.
nameThe object name where the response is computed.
typeThe response to be stored.
coordinatesThe position where the section response will be computed.
indexThe object identifiers that are going to be stored.
nsampleThe number of sampling points to record the solution.
precisionThe precision number to store the results.
Note
More details can be found at Recorder.
See also
Recorder::Path, Recorder::Name, Recorder::Response, Recorder::IDs.

◆ ~Recorder()

Recorder::~Recorder ( )

Destroys this Recorder object.

Member Function Documentation

◆ CopyRecorder()

std::unique_ptr<Recorder> Recorder::CopyRecorder ( )

Clone the 'Recorder' object.

Returns
A Recorder pointer to store solution.

◆ Finalize()

void Recorder::Finalize ( )

Finalize the recorder.

◆ GetName()

std::string Recorder::GetName ( )

Return the recorder name.

Returns
Provide a string with the name.

◆ GetSpacedName()

std::string Recorder::GetSpacedName ( std::string  theFile,
std::string  toReplace 
)
private

Fix blank spaces provided by user in path.

Parameters
theFileString with full path.
toReplaceThe string pattern to be replaced with.
Returns
String with the replaced pattern.

◆ Initialize()

void Recorder::Initialize ( std::shared_ptr< Mesh > &  mesh,
unsigned int  nsteps 
)

Initialize the recorder.

Parameters
meshThe finite element Mesh object.
nstepsThe number of time step of this simulation.

◆ SetComboName()

void Recorder::SetComboName ( std::string  name)

Sets the combination's name.

Parameters
nameThe LoadCombo name.

◆ SetDRMParaviewInterface()

void Recorder::SetDRMParaviewInterface ( std::map< unsigned int, bool > &  DRMElems)

Sets the possible DRM Element indexes.

Parameters
DRMElemsMaps that specify if the Element is DRM.

◆ SetThreshold()

void Recorder::SetThreshold ( Eigen::VectorXd &  U,
double  WinTol = 1E-33 
)
private

Windows patch for small values.

Parameters
UThe vector to set threshold
WinTolThe threshold value for windows machines

◆ WriteElementResponse()

void Recorder::WriteElementResponse ( std::shared_ptr< Mesh > &  mesh)
private

Writes element data to the file.

Parameters
meshThe finite element Mesh object.

◆ WriteNodalResponse()

void Recorder::WriteNodalResponse ( std::shared_ptr< Mesh > &  mesh)
private

Writes state variable data to the file.

Parameters
meshThe finite element Mesh object.

◆ WriteResponse()

void Recorder::WriteResponse ( std::shared_ptr< Mesh > &  mesh,
unsigned int  step 
)

Write information in the recorder.

Parameters
meshThe finite element Mesh object.
Note
More details can be found at Recorder.

◆ WriteSectionResponse()

void Recorder::WriteSectionResponse ( std::shared_ptr< Mesh > &  mesh)
private

Writes section element data to the file.

Parameters
meshThe finite element Mesh object.

◆ WriteVTKFiles()

void Recorder::WriteVTKFiles ( std::shared_ptr< Mesh > &  mesh,
unsigned int  step 
)
private

Writes output data in VTK format to the file.

Parameters
meshThe finite element Mesh object.
stepThe time step to be stored.

Member Data Documentation

◆ Combo

std::string Recorder::Combo
private

The name of the LoadCombo.

◆ Counter

unsigned int Recorder::Counter
private

The sampling rate counter.

◆ File

std::string Recorder::File
private

The name of the file to record.

◆ IDs

std::vector<unsigned int> Recorder::IDs
private

Nodal/Element indexes to be recorded.

◆ IsDRMElem

std::map<unsigned int, bool> Recorder::IsDRMElem
private

Nodal Local indexes for this partition.

◆ Name

std::string Recorder::Name
private

The object name to record solution.

◆ nParaview

unsigned int Recorder::nParaview
private

The number of features to be written in paraview.

◆ nSample

unsigned int Recorder::nSample
private

The number of sampling points to record the solution.

◆ OutputFile

std::ofstream Recorder::OutputFile
private

Name of the recorder handler.

◆ Position

std::vector<double> Recorder::Position
private

Section position at strain/stress is computed.

◆ Precision

unsigned int Recorder::Precision
private

The precision for results.

◆ Response

std::string Recorder::Response
private

The object response to be stored.

◆ Tag

std::map<unsigned int, unsigned int> Recorder::Tag
private

Nodal Local indexes for this partition.