IFEM  90A354
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
SIMsolution Class Reference

Solution vector container with serialization support. More...

#include <SIMsolution.h>

Inheritance diagram for SIMsolution:
Inheritance graph
[legend]
Collaboration diagram for SIMsolution:
Collaboration graph
[legend]

Public Member Functions

virtual const VectorsgetSolutions () const
 Returns a const reference to the solution vectors.
 
virtual VectorstheSolutions ()
 Returns a reference to the solution vectors (for assignment).
 
virtual const VectorgetSolution (int ix=0) const
 Returns a const reference to current solution vector.
 
virtual void setSolution (const RealArray &s, int ix=0)
 Modifies the current solution vector (used by sub-iterations only).
 

Protected Types

using SerializeMap = std::map< std::string, std::string >
 Convenience type.
 

Protected Member Functions

 SIMsolution ()=default
 The default constructor is protected to allow sub-classes only.
 
virtual ~SIMsolution ()=default
 Empty default destructor.
 
void initSolution (size_t ndof, size_t nsol=1)
 Initializes the solution vectors. More...
 
void pushSolution (unsigned short int nVecState=1)
 Pushes the solution vector stack. More...
 
bool saveSolution (SerializeMap &data, const std::string &name) const
 Writes current solution to a serialization container. More...
 
bool restoreSolution (const SerializeMap &data, const std::string &name)
 Restores the solution from a serialization container. More...
 

Static Protected Member Functions

static std::string serialize (const double *v, size_t n)
 Helper method for serializing a double array into a text string. More...
 
static void deSerialize (const std::string &data, double *v, size_t n)
 Helper method for deserializing a double array from a text string. More...
 

Protected Attributes

Vectors solution
 Stack of solution vectors.
 

Detailed Description

Solution vector container with serialization support.

Member Function Documentation

◆ deSerialize()

void SIMsolution::deSerialize ( const std::string &  data,
double *  v,
size_t  n 
)
staticprotected

Helper method for deserializing a double array from a text string.

Parameters
[in]dataThe serialized string
[out]vPointer to double array (assumed allocated outside)
[in]nLength of array

Referenced by HHTSIM::deSerialize(), MultiStepSIM::deSerialize(), and NewmarkNLSIM::deSerialize().

◆ initSolution()

void SIMsolution::initSolution ( size_t  ndof,
size_t  nsol = 1 
)
protected

Initializes the solution vectors.

Parameters
[in]ndofNumber of degrees of freedom
[in]nsolNumber of solution vectors

References solution.

Referenced by MultiStepSIM::initSol().

◆ pushSolution()

void SIMsolution::pushSolution ( unsigned short int  nVecState = 1)
protected

Pushes the solution vector stack.

Parameters
[in]nVecStateNumber of vectors per state

References solution.

Referenced by EigenModeSIM::advanceStep(), NewmarkSIM::advanceStep(), and NonLinSIM::advanceStep().

◆ restoreSolution()

bool SIMsolution::restoreSolution ( const SerializeMap data,
const std::string &  name 
)
protected

Restores the solution from a serialization container.

Parameters
[in]dataContainer for serialized data
[in]nameName of simulator the solution belongs to

References theSolutions().

Referenced by HHTSIM::deSerialize(), MultiStepSIM::deSerialize(), and NewmarkNLSIM::deSerialize().

◆ saveSolution()

bool SIMsolution::saveSolution ( SerializeMap data,
const std::string &  name 
) const
protected

Writes current solution to a serialization container.

Parameters
dataContainer for serialized data
[in]nameName of simulator the solution belongs to

References getSolutions().

Referenced by HHTSIM::serialize(), MultiStepSIM::serialize(), and NewmarkNLSIM::serialize().

◆ serialize()

std::string SIMsolution::serialize ( const double *  v,
size_t  n 
)
staticprotected

Helper method for serializing a double array into a text string.

Parameters
[in]vPointer to double array
[in]nLength of array
Returns
The serialized string

Referenced by HHTSIM::serialize(), MultiStepSIM::serialize(), and NewmarkNLSIM::serialize().


The documentation for this class was generated from the following files: