tfel
Loading...
Searching...
No Matches
mtest::StudyCurrentState Struct Reference

structure describing the current state of a study More...

#include </home/runner/work/tfel/tfel/mtest/include/MTest/StudyCurrentState.hxx>

Public Types

using size_type = tfel::math::vector<real>::size_type
 a simple alias

Public Member Functions

 StudyCurrentState ()
 default constructor
 StudyCurrentState (const StudyCurrentState &)
 StudyCurrentState (StudyCurrentState &&) noexcept
StudyCurrentState & operator= (const StudyCurrentState &)
StudyCurrentState & operator= (StudyCurrentState &&) noexcept
StudyCurrentState makeDeepCopy () const
 make a deep copy of the object Contrary to standard copy which shares pointers to the structure current states with the original object, those states are duplicated in a deep copy.
void initialize (const StudyCurrentState::size_type)
 allocate memory
void update (const real)
 update the state: values at the end of the time step becomes the values at the beginning of the next time step
void revert ()
 revert the state: values at the end of the time step are set equal to the values at the beginning of the next time step
StructureCurrentState & getStructureCurrentState (const std::string &)
const StructureCurrentState & getStructureCurrentState (const std::string &) const
bool containsParameter (const std::string &) const
template<typename T>
bool checkParameterType (const std::string &) const
template<typename T>
T & getParameter (const std::string &, const bool=false)
template<typename T>
const T & getParameter (const std::string &) const
template<typename T>
T & setParameter (const std::string &, const T &)
 set a parameter
bool containsEvolution (const std::string &) const
void addEvolution (const std::string &, std::shared_ptr< Evolution >)
 add a new evolution
Evolution & getEvolution (const std::string &)
const Evolution & getEvolution (const std::string &) const
bool getFailureStatus () const
bool getFailureCriterionStatus (const std::size_t) const
void setFailureCriterionStatus (const std::size_t, const bool)
 set the status of a failure criterion
void setNumberOfFailureCriterionStatus (const std::size_t)
 set the number of failure criterion status
std::size_t getNumberOfFailureCriterionStatus () const noexcept

Public Attributes

tfel::math::vector< real > u_1
tfel::math::vector< real > u0
tfel::math::vector< real > u1
tfel::math::vector< real > u10
unsigned int period = 1u
unsigned int iterations = 0u
unsigned int subSteps = 0u
real dt_1 = real{}

Static Protected Member Functions

static void throwUnknownParameterException (const std::string &)
 throw an exception stating that no parameter with the given name has been found
static void throwAlreadyDeclaredParameterException (const std::string &)
 throw an exception stating that a parameter with the given name has been found

Protected Attributes

std::map< std::string, StudyParameter > parameters
 study parameters
std::map< std::string, std::shared_ptr< StructureCurrentState > > s
 current state of the structures indexed by the structure's names
std::map< std::string, std::shared_ptr< Evolution > > evs
 evolutions
std::vector< bool > failure_criterion_status
 failure criteria status

Detailed Description

structure describing the current state of a study

Member Function Documentation

◆ addEvolution()

void mtest::StudyCurrentState::addEvolution ( const std::string & ,
std::shared_ptr< Evolution >  )

add a new evolution

Parameters
[in]n: name of the evolution
[in]e: evolution

◆ checkParameterType()

template<typename T>
bool mtest::StudyCurrentState::checkParameterType ( const std::string & n) const
nodiscard
Returns
true if the study parameter with the specified name has the specified type
Template Parameters
T: requested type
Parameters
[in]n: the requested name
Note
an exception is thrown if no data of the specified name is found or if the object type has not the requested type

◆ containsEvolution()

bool mtest::StudyCurrentState::containsEvolution ( const std::string & ) const
nodiscard
Parameters
[in]n: name of the evolution

◆ containsParameter()

bool mtest::StudyCurrentState::containsParameter ( const std::string & ) const
nodiscard
Parameters
[in]nparameter name

◆ getEvolution() [1/2]

Evolution & mtest::StudyCurrentState::getEvolution ( const std::string & )
nodiscard
Returns
the evolution with the given name
Parameters
[in]n: name of the evolution

◆ getEvolution() [2/2]

const Evolution & mtest::StudyCurrentState::getEvolution ( const std::string & ) const
nodiscard
Returns
the evolution with the given name
Parameters
[in]n: name of the evolution

◆ getFailureCriterionStatus()

bool mtest::StudyCurrentState::getFailureCriterionStatus ( const std::size_t ) const
nodiscard
Returns
the status of a failure criterion
Parameters
[in]iindex of the failure criterion

◆ getFailureStatus()

bool mtest::StudyCurrentState::getFailureStatus ( ) const
nodiscard
Returns
if any of the failure criterion is true

◆ getNumberOfFailureCriterionStatus()

std::size_t mtest::StudyCurrentState::getNumberOfFailureCriterionStatus ( ) const
nodiscardnoexcept
Returns
the number of failure criterion status

◆ getParameter() [1/2]

template<typename T>
const T & mtest::StudyCurrentState::getParameter ( const std::string & n) const
nodiscard
Returns
the object holded by the study parameter with the specified name
Template Parameters
T: requested type
Parameters
[in]n: the requested name
Note
an exception is thrown if no data of the specified name is found or if the object type has not the requested type

◆ getParameter() [2/2]

template<typename T>
T & mtest::StudyCurrentState::getParameter ( const std::string & n,
const bool b = false )
nodiscard
Returns
the object holded by the study parameter with the specified name
Template Parameters
T: requested type
Parameters
[in]n: the requested name
[in]b: create the object if it does not exists
Note
an exception is thrown if no data of the specified name is found or if the object type has not the requested type

◆ getStructureCurrentState() [1/2]

StructureCurrentState & mtest::StudyCurrentState::getStructureCurrentState ( const std::string & )
nodiscard
Returns
the state associated with a structure
Parameters
[in]nstructure name

◆ getStructureCurrentState() [2/2]

const StructureCurrentState & mtest::StudyCurrentState::getStructureCurrentState ( const std::string & ) const
nodiscard
Returns
the state associated with a structure
Parameters
[in]nstructure name

◆ initialize()

void mtest::StudyCurrentState::initialize ( const StudyCurrentState::size_type )

allocate memory

Parameters
[out]pszproblem size

◆ setFailureCriterionStatus()

void mtest::StudyCurrentState::setFailureCriterionStatus ( const std::size_t ,
const bool  )

set the status of a failure criterion

Parameters
[in]iindex of the failure criterion
[in]statusnew status

◆ setNumberOfFailureCriterionStatus()

void mtest::StudyCurrentState::setNumberOfFailureCriterionStatus ( const std::size_t )

set the number of failure criterion status

Parameters
[in]nnumber of the failure criteria
Note
the newly allocated status are initialized to false

◆ setParameter()

template<typename T>
T & mtest::StudyCurrentState::setParameter ( const std::string & n,
const T & v )

set a parameter

Template Parameters
T: type of the parameter
Parameters
[in]n: parameter name
[in]v: parameter value
Note
an exception is thrown if a data of the specified name is found

◆ throwAlreadyDeclaredParameterException()

void mtest::StudyCurrentState::throwAlreadyDeclaredParameterException ( const std::string & )
staticprotected

throw an exception stating that a parameter with the given name has been found

Parameters
[in]nparameter name

◆ throwUnknownParameterException()

void mtest::StudyCurrentState::throwUnknownParameterException ( const std::string & )
staticprotected

throw an exception stating that no parameter with the given name has been found

Parameters
[in]nparameter name

◆ update()

void mtest::StudyCurrentState::update ( const real )

update the state: values at the end of the time step becomes the values at the beginning of the next time step

Parameters
[in]dttime increment

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