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

base class for schemes describing a single structure More...

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

Inheritance diagram for mtest::SingleStructureScheme:
mtest::SchemeBase mtest::Scheme mtest::Study tfel::tests::Test mtest::MTest mtest::PipeTest tfel::utilities::MTestDocParser

Public Types

using Parameters = tfel::utilities::Data
 a simple alias
Public Types inherited from mtest::SchemeBase
enum  OutputFrequency { USERDEFINEDTIMES , EVERYPERIOD }
using ModellingHypothesis = tfel::material::ModellingHypothesis
 a simple alias
using Hypothesis = ModellingHypothesis::Hypothesis
 a simple alias
using EvolutionPtr = std::shared_ptr<Evolution>
 a simple alias
using BehaviourType
 a simple alias
using Kinematic = tfel::material::MechanicalBehaviourBase::Kinematic
 a simple alias
Public Types inherited from mtest::Study
using size_type = tfel::math::vector<real>::size_type
 a simple alias

Public Member Functions

 SingleStructureScheme ()
 default constructor
virtual void setBehaviour (const std::string &, const std::string &, const std::string &, const Parameters &=Parameters())
 set the behaviour
virtual void setBehaviour (const std::string &, const std::string &, const std::string &, const std::string &, const Parameters &=Parameters())
 set the behaviour
virtual void setMaterialProperty (const std::string &, const EvolutionPtr, const bool)
 define a material property
virtual void setExternalStateVariable (const std::string &, const EvolutionPtr, const bool)
 define an external state variable
virtual BehaviourType getBehaviourType () const
virtual Kinematic getBehaviourKinematic () const
virtual std::shared_ptr< Behaviour > getBehaviour ()
virtual std::shared_ptr< const Behaviour > getBehaviour () const
virtual void setHandleThermalExpansion (const bool)
 set if mtest shall handle thermal expansion coefficient If true, the thermal expansion will be handled if the thermal expansion coefficients are defined.
bool doPackagingStep (StudyCurrentState &) const override
 perform the computation of the packaging step
std::pair< bool, real > prepare (StudyCurrentState &, const real, const real) const override
 update current state at the beginning of a new time step:
virtual void setParameter (const std::string &, const double)
virtual void setIntegerParameter (const std::string &, const int)
virtual void setUnsignedIntegerParameter (const std::string &, const unsigned int)
virtual void setInternalStateVariableInitialValue (const std::string &, const real)
 set the inital value of a scalar variable
virtual void setInternalStateVariableInitialValue (const std::string &, const std::vector< real > &)
 set the inital values of an internal state variable
virtual void setScalarInternalStateVariableInitialValue (const std::string &, const real)
 set the inital value of a scalar variable
virtual void setStensorInternalStateVariableInitialValues (const std::string &, const std::vector< real > &)
 set the inital values of a symetric tensor variable
virtual void setTensorInternalStateVariableInitialValues (const std::string &, const std::vector< real > &)
 set the inital values of a tensor variable
virtual void setOutOfBoundsPolicy (const tfel::material::OutOfBoundsPolicy)
 set the out of bounds policy
void completeInitialisation () override
 ~SingleStructureScheme () override
 destructor
Public Member Functions inherited from mtest::SchemeBase
 SchemeBase ()
 constructor
 SchemeBase (SchemeBase &&)=delete
 move constructor
 SchemeBase (const SchemeBase &)=delete
 copy constructor
SchemeBase & operator= (SchemeBase &&)=delete
 move assignement
SchemeBase & operator= (const SchemeBase &)=delete
 standard assignement
void setModellingHypothesis (const std::string &) override
virtual void setTimes (const std::vector< real > &)
virtual void setOutputFileName (const std::string &)
 set the output file
virtual bool isOutputFileNameDefined () const
virtual void setOutputFilePrecision (const unsigned int)
 set the output file precision
virtual void setResidualFileName (const std::string &)
 set the residual file
virtual bool isResidualFileNameDefined () const
virtual void setXMLOutputFileName (const std::string &)
 set the residual file
virtual bool isXMLOutputFileNameDefined () const
virtual std::string getXMLOutputFileName () const
virtual void setResidualFilePrecision (const unsigned int)
 set the residual file precision
const EvolutionManager & getEvolutions () const
virtual void addEvolution (const std::string &, const EvolutionPtr, const bool, const bool)
 add a new evolution
virtual void setEvolutionValue (const std::string &, const real, const real)
 set evolution value for a given time
virtual void setDescription (const std::string &)
 set the description
virtual void setAuthor (const std::string &)
 set the author
virtual void setDate (const std::string &)
 set the date
virtual void setOutputFrequency (const OutputFrequency)
 set the output frequency
virtual void setDynamicTimeStepScaling (const bool)
 set the maximal time step
virtual void setMaximalTimeStep (const real)
 set the maximal time step
virtual void setMinimalTimeStep (const real)
 set the minimal time step
virtual void setMaximalTimeStepScalingFactor (const real)
 set the maximal time step scaling factor
virtual void setMinimalTimeStepScalingFactor (const real)
 set the minimal time step scaling factor
virtual void setMaximumNumberOfIterations (const unsigned int)
virtual void setMaximumNumberOfSubSteps (const unsigned int)
virtual unsigned short getDimension () const
virtual ModellingHypothesis::Hypothesis getModellingHypothesis () const
virtual void setStiffnessUpdatingPolicy (const StiffnessUpdatingPolicy)
 set the stiffness updating policy
virtual void setPredictionPolicy (const PredictionPolicy)
 set the prediction policy
virtual void setStiffnessMatrixType (const StiffnessMatrixType)
 set the stiffness matrix type
virtual void setUseCastemAccelerationAlgorithm (const bool)
 set the use of the castem acceleration algorithm
virtual void setAccelerationAlgorithm (const std::string &)
 set the acceleration algorithm to be used
virtual void setAccelerationAlgorithmParameter (const std::string &, const std::string &)
 set a parameter of the acceleration algorithm
virtual void setCastemAccelerationTrigger (const int)
 set at which iteration the use of the castem acceleration algorithm will begin
virtual void setCastemAccelerationPeriod (const int)
 set at which period the use of the castem acceleration algorithm will take place
virtual void resetOutputFile ()
 close and reopen the output files
 ~SchemeBase () override
 destructor
Public Member Functions inherited from mtest::Scheme
 ~Scheme () override
 desctructor
Public Member Functions inherited from tfel::tests::Test
virtual std::string name () const =0
virtual std::string classname () const =0
virtual TestResult execute ()=0
 execute test
virtual ~Test ()
 destructor
Public Member Functions inherited from mtest::Study
virtual size_type getNumberOfUnknowns () const =0
virtual void initializeCurrentState (StudyCurrentState &) const =0
 initialize the current state
virtual void initializeWorkSpace (SolverWorkSpace &) const =0
 initialize the workspace
virtual void makeLinearPrediction (StudyCurrentState &, const real) const =0
 make a linear prediction of the unknows and state
virtual std::pair< bool, real > computePredictionStiffnessAndResidual (StudyCurrentState &, tfel::math::matrix< real > &, tfel::math::vector< real > &, const real &, const real &, const StiffnessMatrixType) const =0
 compute the stiffness matrix and the residual
virtual std::pair< bool, real > computeStiffnessMatrixAndResidual (StudyCurrentState &, tfel::math::matrix< real > &, tfel::math::vector< real > &, const real, const real, const StiffnessMatrixType) const =0
 compute the stiffness matrix and the residual
virtual real getErrorNorm (const tfel::math::vector< real > &) const =0
virtual bool checkConvergence (StudyCurrentState &, const tfel::math::vector< real > &, const tfel::math::vector< real > &, const SolverOptions &, const unsigned int, const real, const real) const =0
virtual std::vector< std::string > getFailedCriteriaDiagnostic (const StudyCurrentState &, const tfel::math::vector< real > &, const tfel::math::vector< real > &, const SolverOptions &, const real, const real) const =0
virtual void computeLoadingCorrection (StudyCurrentState &, SolverWorkSpace &, const SolverOptions &, const real, const real) const =0
virtual bool postConvergence (StudyCurrentState &, const real, const real, const unsigned int) const =0
virtual void printOutput (const real, const StudyCurrentState &, const bool) const =0
 print usefull information in the output file
virtual void setDefaultModellingHypothesis ()=0
 set the modelling hypothesis to the default one
virtual ~Study ()
 destructor

Protected Member Functions

virtual void checkBehaviourConsistency (const std::shared_ptr< Behaviour > &)
 check that the behaviour is consistent with the modelling hypothesis
virtual void setBehaviour (const std::shared_ptr< Behaviour > &)
 set the behaviour
StiffnessMatrixType getDefaultStiffnessMatrixType () const override
Protected Member Functions inherited from mtest::SchemeBase
void declareVariable (const std::string &, const bool)
 declare a new variable
void declareVariables (const std::vector< std::string > &, const bool)
 declare a list of new variables
Protected Member Functions inherited from mtest::Study
virtual void setGaussPointPositionForEvolutionsEvaluation (const CurrentState &) const =0
 set the position of the Gauss point in the evolution manager

Protected Attributes

std::vector< std::string > ivfullnames
 list of internal variable names, including their suffixes
std::shared_ptr< Behaviour > b
 the mechanical behaviour
std::shared_ptr< EvolutionManager > dmpv
 default values for material properties as given by the behaviour
std::vector< real > iv_t0
bool handleThermalExpansion = true
 handle the computation of thermal expansion
Protected Attributes inherited from mtest::SchemeBase
std::vector< std::string > vnames
 declared variable names
bool initialisationFinished = false
 initilisation stage
SolverOptions options
 solver options
std::vector< real > times
 times
std::string description
 description of the test
std::string author
 author
std::string date
 date
ModellingHypothesis::Hypothesis hypothesis
 modelling hypothesis
std::shared_ptr< EvolutionManager > evm
 list of evolutions
std::string output
 output file name
std::ofstream out
 output file
std::string residualFileName
 residual file name
std::string xmlFileName
 xml file name
std::ofstream residual
OutputFrequency output_frequency = USERDEFINEDTIMES
 output frequency
int oprec = -1
 output file precision
int rprec = -1
 residual file precision

Detailed Description

base class for schemes describing a single structure

Member Function Documentation

◆ checkBehaviourConsistency()

virtual void mtest::SingleStructureScheme::checkBehaviourConsistency ( const std::shared_ptr< Behaviour > & )
protectedvirtual

check that the behaviour is consistent with the modelling hypothesis

Parameters
[in]bp: pointer to the behaviour

Reimplemented in mtest::PipeTest.

◆ completeInitialisation()

void mtest::SingleStructureScheme::completeInitialisation ( )
overridevirtual

complete the initialisation. This method must be called once.

Note
this method must be called by the derived class.

Reimplemented from mtest::SchemeBase.

◆ doPackagingStep()

bool mtest::SingleStructureScheme::doPackagingStep ( StudyCurrentState & ) const
overridevirtual

perform the computation of the packaging step

Implements mtest::Study.

◆ getBehaviour() [1/2]

virtual std::shared_ptr< Behaviour > mtest::SingleStructureScheme::getBehaviour ( )
virtual
Returns
the behaviour

◆ getBehaviour() [2/2]

virtual std::shared_ptr< const Behaviour > mtest::SingleStructureScheme::getBehaviour ( ) const
virtual
Returns
the behaviour

◆ getBehaviourKinematic()

virtual Kinematic mtest::SingleStructureScheme::getBehaviourKinematic ( ) const
virtual
Returns
the behaviour kinematic

◆ getBehaviourType()

virtual BehaviourType mtest::SingleStructureScheme::getBehaviourType ( ) const
virtual
Returns
the behaviour type

◆ getDefaultStiffnessMatrixType()

StiffnessMatrixType mtest::SingleStructureScheme::getDefaultStiffnessMatrixType ( ) const
overrideprotectedvirtual
Returns
the default stiffness matrix type

Implements mtest::SchemeBase.

◆ prepare()

std::pair< bool, real > mtest::SingleStructureScheme::prepare ( StudyCurrentState & ,
const real ,
const real  ) const
nodiscardoverridevirtual

update current state at the beginning of a new time step:

  • update the material properties
  • update the external state variables
  • compute the thermal expansion if mandatory
    Parameters
    [out]scurrent structure state
    [in]tcurrent time
    [in]dttime increment

Implements mtest::Study.

◆ setBehaviour() [1/3]

virtual void mtest::SingleStructureScheme::setBehaviour ( const std::shared_ptr< Behaviour > & )
protectedvirtual

set the behaviour

Parameters
[in]bp: pointer to the behaviour

◆ setBehaviour() [2/3]

virtual void mtest::SingleStructureScheme::setBehaviour ( const std::string & ,
const std::string & ,
const std::string & ,
const Parameters & = Parameters() )
virtual

set the behaviour

Parameters
[in]iinterface
[in]llibrary name
[in]ffunction
[in]dparameters

◆ setBehaviour() [3/3]

virtual void mtest::SingleStructureScheme::setBehaviour ( const std::string & ,
const std::string & ,
const std::string & ,
const std::string & ,
const Parameters & = Parameters() )
virtual

set the behaviour

Parameters
[in]wbehaviour wrapper
[in]iinterface
[in]llibrary name
[in]ffunction
[in]dparameters

◆ setExternalStateVariable()

virtual void mtest::SingleStructureScheme::setExternalStateVariable ( const std::string & ,
const EvolutionPtr ,
const bool  )
virtual

define an external state variable

Parameters
[in]n: evolution name
[in]p: evolution pointer
[in]check: check if the evolution already exists.
Note
if check is true and the evolution already exists, an exeception is thrown.

◆ setHandleThermalExpansion()

virtual void mtest::SingleStructureScheme::setHandleThermalExpansion ( const bool )
virtual

set if mtest shall handle thermal expansion coefficient If true, the thermal expansion will be handled if the thermal expansion coefficients are defined.

Parameters
[in]b: boolean

◆ setIntegerParameter()

virtual void mtest::SingleStructureScheme::setIntegerParameter ( const std::string & ,
const int  )
virtual
Parameters
[in]n: parameter name
[in]v: parameter value

◆ setInternalStateVariableInitialValue() [1/2]

virtual void mtest::SingleStructureScheme::setInternalStateVariableInitialValue ( const std::string & ,
const real  )
virtual

set the inital value of a scalar variable

Parameters
[in]v: value

◆ setInternalStateVariableInitialValue() [2/2]

virtual void mtest::SingleStructureScheme::setInternalStateVariableInitialValue ( const std::string & ,
const std::vector< real > &  )
virtual

set the inital values of an internal state variable

Parameters
[in]nname
[in]vvalues

◆ setMaterialProperty()

virtual void mtest::SingleStructureScheme::setMaterialProperty ( const std::string & ,
const EvolutionPtr ,
const bool  )
virtual

define a material property

Parameters
[in]n: evolution name
[in]p: evolution pointer
[in]check: check if the evolution already exists.
Note
if check is true and the evolution already exists, an exeception is thrown.

◆ setOutOfBoundsPolicy()

virtual void mtest::SingleStructureScheme::setOutOfBoundsPolicy ( const tfel::material::OutOfBoundsPolicy )
virtual

set the out of bounds policy

Parameters
[in]a: out of bounds policy

◆ setParameter()

virtual void mtest::SingleStructureScheme::setParameter ( const std::string & ,
const double  )
virtual
Parameters
[in]n: parameter name
[in]v: parameter value

◆ setScalarInternalStateVariableInitialValue()

virtual void mtest::SingleStructureScheme::setScalarInternalStateVariableInitialValue ( const std::string & ,
const real  )
virtual

set the inital value of a scalar variable

Parameters
[in]nname
[in]v: value
Deprecated
{replaced by setInternalStateVariableInitialValue}

◆ setStensorInternalStateVariableInitialValues()

virtual void mtest::SingleStructureScheme::setStensorInternalStateVariableInitialValues ( const std::string & ,
const std::vector< real > &  )
virtual

set the inital values of a symetric tensor variable

Parameters
[in]nname
[in]v: values
Deprecated
{replaced by setInternalStateVariableInitialValue}

◆ setTensorInternalStateVariableInitialValues()

virtual void mtest::SingleStructureScheme::setTensorInternalStateVariableInitialValues ( const std::string & ,
const std::vector< real > &  )
virtual

set the inital values of a tensor variable

Parameters
[in]nname
[in]v: values
Deprecated
{replaced by setInternalStateVariableInitialValue}

◆ setUnsignedIntegerParameter()

virtual void mtest::SingleStructureScheme::setUnsignedIntegerParameter ( const std::string & ,
const unsigned int  )
virtual
Parameters
[in]n: parameter name
[in]v: parameter value

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