tfel
Loading...
Searching...
No Matches
mfront::BehaviourInterfaceBase Struct Referenceabstract

#include </home/runner/work/tfel/tfel/mfront/include/MFront/BehaviourInterfaceBase.hxx>

Inheritance diagram for mfront::BehaviourInterfaceBase:
mfront::AbstractBehaviourInterface mfront::SupportedTypes mfront::GenericBehaviourInterface mfront::UMATInterfaceBase mfront::AbaqusInterfaceBase mfront::AnsysInterface mfront::AsterInterface mfront::CalculiXInterface mfront::CastemInterface mfront::ComsolInterface mfront::CyranoInterface mfront::DianaFEAInterface mfront::LSDYNAInterface

Public Types

using ModellingHypothesis = tfel::material::ModellingHypothesis
 a simple alias
using Hypothesis = ModellingHypothesis::Hypothesis
 a simple alias
Public Types inherited from mfront::AbstractBehaviourInterface
typedef tfel::material::ModellingHypothesis ModellingHypothesis
 a simple alias
typedef ModellingHypothesis::Hypothesis Hypothesis
 a simple alias
using CxxTokenizer = tfel::utilities::CxxTokenizer
 a simple alias
using tokens_iterator = CxxTokenizer::TokensContainer::const_iterator
 a simple alias
using DataMap = tfel::utilities::DataMap
 a simple alias
Public Types inherited from mfront::SupportedTypes
enum  TypeFlag { SCALAR , TVECTOR , STENSOR , TENSOR }
 flag associaed with a variable type
using const_iterator = tfel::utilities::CxxTokenizer::const_iterator
 a simple alias

Public Member Functions

 BehaviourInterfaceBase ()
 constructor
void setOptions (const DataMap &) override
 give options to the interface
std::string getInterfaceVersion () const override
bool isBehaviourConstructorRequired (const Hypothesis, const BehaviourDescription &) const override
std::pair< std::vector< BehaviourMaterialProperty >, SupportedTypes::TypeSize > buildMaterialPropertiesList (const BehaviourDescription &, const Hypothesis) const override
void writeBehaviourInitializeFunctions (std::ostream &, const BehaviourDescription &, const Hypothesis) const override
 write the initialize functions
void writeBehaviourPostProcessings (std::ostream &, const BehaviourDescription &, const Hypothesis) const override
 write the post-processings
virtual std::string getFunctionNameBasis (const std::string &) const =0
virtual std::string getHeaderGuard (const BehaviourDescription &) const
virtual void writeVisibilityDefines (std::ostream &) const
 include the appropriate headers and write the definition of the MFRONT_SHAREDOBJ macro which is used to define the visibility of the generated functions.
virtual void writeSetOutOfBoundsPolicyFunctionDeclaration (std::ostream &, const std::string &) const
virtual void writeGetOutOfBoundsPolicyFunctionImplementation (std::ostream &, const BehaviourDescription &, const std::string &) const
virtual void writeSetOutOfBoundsPolicyFunctionImplementation (std::ostream &, const BehaviourDescription &, const std::string &) const
virtual void writeSetParametersFunctionsDeclarations (std::ostream &, const BehaviourDescription &, const std::string &) const
virtual void writeSetParametersFunctionsImplementations (std::ostream &, const BehaviourDescription &, const std::string &) const
 generate the implementations of the functions allowing to modify the parameters of a behaviour.
virtual void setGenerateMTestFileOnFailureAttribute (BehaviourDescription &, const bool) const
 set an attribute stating that a MTest file shall be generated on integration failure.
virtual bool shallGenerateMTestFileOnFailure (const BehaviourDescription &) const
virtual std::pair< bool, SupportedTypes::TypeSize > checkIfAxialStrainIsDefinedAndGetItsOffset (const BehaviourDescription &, const Hypothesis) const
virtual std::pair< bool, SupportedTypes::TypeSize > checkIfAxialDeformationGradientIsDefinedAndGetItsOffset (const BehaviourDescription &, const Hypothesis) const
virtual bool readBooleanValue (const std::string &, tokens_iterator &, const tokens_iterator) const
 extract a boolean value from the current token
 ~BehaviourInterfaceBase () override
 destructor
Public Member Functions inherited from mfront::AbstractBehaviourInterface
virtual std::string getInterfaceName () const =0
 the name of the interface is mostly used internally to build
virtual std::pair< bool, tokens_iterator > treatKeyword (BehaviourDescription &, const std::string &, const std::vector< std::string > &, tokens_iterator, const tokens_iterator)=0
 treat a keyword
virtual std::set< Hypothesis > getModellingHypothesesToBeTreated (const BehaviourDescription &) const =0
virtual void writeInterfaceSpecificIncludes (std::ostream &, const BehaviourDescription &) const =0
virtual void exportMechanicalData (std::ostream &, const Hypothesis, const BehaviourDescription &) const =0
virtual void writeBehaviourConstructorHeader (std::ostream &, const BehaviourDescription &, const Hypothesis, const std::string &) const =0
 write the behaviour constructor header associated with the interface. This method allow the interface to add a new constructor containing specific arguments and the call specific constructors for the behaviour data and integration data, as build by the writeBehaviourDataConstructor and the writeIntegrationDataConstructor methods respectively. This body of this constructor will be populated by the writeBehaviourConstructorBody method.
virtual void writeBehaviourConstructorBody (std::ostream &, const BehaviourDescription &, const Hypothesis) const =0
 complete the body of the behaviour constructor associated with the interface.
virtual void writeBehaviourDataConstructor (std::ostream &, const Hypothesis, const BehaviourDescription &) const =0
virtual void writeBehaviourDataMainVariablesSetters (std::ostream &, const BehaviourDescription &) const =0
virtual void writeIntegrationDataConstructor (std::ostream &, const Hypothesis, const BehaviourDescription &) const =0
virtual void writeIntegrationDataMainVariablesSetters (std::ostream &, const BehaviourDescription &) const =0
 write the setters associated with the main variables
virtual void endTreatment (const BehaviourDescription &, const FileDescription &) const =0
 write output files
virtual void getTargetsDescription (TargetsDescription &, const BehaviourDescription &)=0
virtual ~AbstractBehaviourInterface ()
 destructor
Public Member Functions inherited from mfront::SupportedTypes
 SupportedTypes ()
 default constructor
 SupportedTypes (SupportedTypes &&)=default
 move constructor
 SupportedTypes (const SupportedTypes &)=default
 copy constructor
SupportedTypes & operator= (SupportedTypes &&)=default
 move assignement
SupportedTypes & operator= (const SupportedTypes &)=default
 copy assignement
virtual ~SupportedTypes ()
 desctructor

Static Public Attributes

static const char *const generateMTestFileAttribute
 attribute used to store if an MTest file shall be generated
Static Public Attributes inherited from mfront::SupportedTypes
static constexpr int ArraySizeLimit = 10u
 limit for small array support

Additional Inherited Members

Static Public Member Functions inherited from mfront::SupportedTypes
static const std::map< std::string, TypeFlag, std::less<> > & getTypeFlags ()
static bool isSupportedConstexprIntegerVariables (const std::string_view)
static std::string extractType (const_iterator &, const const_iterator &, const TypeParsingOptions &=TypeParsingOptions())
static std::string extractType (const std::string_view, const TypeParsingOptions &=TypeParsingOptions())
static bool hasTypeFlag (const std::string_view)
static bool isScalarType (const std::string_view)
static TypeFlag getTypeFlag (const std::string_view)
static int getTypeIdentifier (const std::string_view)
static TypeSize getTypeSize (const std::string_view, const unsigned short=1)
static std::string getTimeDerivativeType (const std::string_view)

Detailed Description

This class provides some helper function for behaviours interfaces based on C-functions as entry points, which is currently the most current case (to the very exception of the ZMAT interface).

Member Function Documentation

◆ buildMaterialPropertiesList()

std::pair< std::vector< BehaviourMaterialProperty >, SupportedTypes::TypeSize > mfront::BehaviourInterfaceBase::buildMaterialPropertiesList ( const BehaviourDescription & ,
const Hypothesis  ) const
nodiscardoverridevirtual
Returns
a pair which first member gives the position of the material properties in the values given through the interface and which second member is an offset giving the number of imposed material properties.
Parameters
[in]mbbehaviour description
[in]hmodelling hypothesis

Implements mfront::AbstractBehaviourInterface.

Reimplemented in mfront::CastemInterface.

◆ checkIfAxialDeformationGradientIsDefinedAndGetItsOffset()

virtual std::pair< bool, SupportedTypes::TypeSize > mfront::BehaviourInterfaceBase::checkIfAxialDeformationGradientIsDefinedAndGetItsOffset ( const BehaviourDescription & ,
const Hypothesis  ) const
nodiscardvirtual
Returns
a pair. If the first entry is true, the "deformation gradient" was found and the second contains its offset
Parameters
[in]mbmaterial description
[in]hmodelling hypothesis

◆ checkIfAxialStrainIsDefinedAndGetItsOffset()

virtual std::pair< bool, SupportedTypes::TypeSize > mfront::BehaviourInterfaceBase::checkIfAxialStrainIsDefinedAndGetItsOffset ( const BehaviourDescription & ,
const Hypothesis  ) const
nodiscardvirtual
Returns
a pair. If the first entry is true, the "axial strain" was found and the second contains its offset
Parameters
[in]mbmaterial description
[in]hmodelling hypothesis

◆ getFunctionNameBasis()

virtual std::string mfront::BehaviourInterfaceBase::getFunctionNameBasis ( const std::string & ) const
nodiscardpure virtual
Returns
the basis for the function(s)' names implementing the behaviour generated by the interface. This can be different from the name of the behaviour to comply with the targeted code restrictions. For example, the Abaqus interfaces require the function name to be upper-cased.
Note
Some interfaces generate one function per behaviour. The name of this function shall be the one returned by this method. The other interfaces generate one function per hypothesis: the function to be called the appends a suffix associated with the modelling hypothesis to the name returned by this method. In any case, the UMAT++ symbols' names are build using the name returned by this method.
Parameters
[in]n: name of the behaviour as defined by interface (generally taking into account the material and the behaviour name)

Implemented in mfront::AbaqusInterfaceBase, mfront::AnsysInterface, mfront::AsterInterface, mfront::CalculiXInterface, mfront::CastemInterface, mfront::ComsolInterface, mfront::CyranoInterface, mfront::DianaFEAInterface, mfront::GenericBehaviourInterface, and mfront::LSDYNAInterface.

◆ getHeaderGuard()

virtual std::string mfront::BehaviourInterfaceBase::getHeaderGuard ( const BehaviourDescription & ) const
nodiscardvirtual
Returns
an header guard based on the name of the interface, as returned by getInterfaceName, and the name of the behaviour.
Parameters
[in]bdbehaviour description

◆ getInterfaceVersion()

std::string mfront::BehaviourInterfaceBase::getInterfaceVersion ( ) const
nodiscardoverridevirtual
Returns
the version of the interface

Implements mfront::AbstractBehaviourInterface.

Reimplemented in mfront::Castem21Interface.

◆ isBehaviourConstructorRequired()

bool mfront::BehaviourInterfaceBase::isBehaviourConstructorRequired ( const Hypothesis ,
const BehaviourDescription &  ) const
nodiscardoverridevirtual
Returns
true if the interface will create constructors in the behaviour class.
Parameters
[in]h: modelling hypothesis
[in]mb: behaviour description

Implements mfront::AbstractBehaviourInterface.

◆ readBooleanValue()

virtual bool mfront::BehaviourInterfaceBase::readBooleanValue ( const std::string & ,
tokens_iterator & ,
const tokens_iterator  ) const
nodiscardvirtual

extract a boolean value from the current token

Parameters
[in]keycurrently treated keyword
[in]currentiterator to the current token
[in]enditerator after the last token

◆ setGenerateMTestFileOnFailureAttribute()

virtual void mfront::BehaviourInterfaceBase::setGenerateMTestFileOnFailureAttribute ( BehaviourDescription & ,
const bool  ) const
virtual

set an attribute stating that a MTest file shall be generated on integration failure.

Parameters
[in,out]bdbehavour description
[in]battribute value

◆ setOptions()

void mfront::BehaviourInterfaceBase::setOptions ( const DataMap & )
overridevirtual

give options to the interface

Those options may have been read from a configuration file or from the command line

Parameters
[in]optsoptions

Implements mfront::AbstractBehaviourInterface.

◆ shallGenerateMTestFileOnFailure()

virtual bool mfront::BehaviourInterfaceBase::shallGenerateMTestFileOnFailure ( const BehaviourDescription & ) const
nodiscardvirtual
Returns
if a behaviour shall generate a MTest file on integration failure.
Parameters
[in]bdbehavour description

◆ writeBehaviourInitializeFunctions()

void mfront::BehaviourInterfaceBase::writeBehaviourInitializeFunctions ( std::ostream & ,
const BehaviourDescription & ,
const Hypothesis  ) const
overridevirtual

write the initialize functions

Parameters
[in]osoutput stream
[in]bdbehaviour description
[in]hmodelling hypothesis

Implements mfront::AbstractBehaviourInterface.

Reimplemented in mfront::GenericBehaviourInterface.

◆ writeBehaviourPostProcessings()

void mfront::BehaviourInterfaceBase::writeBehaviourPostProcessings ( std::ostream & ,
const BehaviourDescription & ,
const Hypothesis  ) const
overridevirtual

write the post-processings

Parameters
[in]osoutput stream
[in]bdbehaviour description
[in]hmodelling hypothesis

Implements mfront::AbstractBehaviourInterface.

Reimplemented in mfront::GenericBehaviourInterface.

◆ writeSetParametersFunctionsImplementations()

virtual void mfront::BehaviourInterfaceBase::writeSetParametersFunctionsImplementations ( std::ostream & ,
const BehaviourDescription & ,
const std::string &  ) const
virtual

generate the implementations of the functions allowing to modify the parameters of a behaviour.

Parameters
[out]outoutput stream

◆ writeVisibilityDefines()

virtual void mfront::BehaviourInterfaceBase::writeVisibilityDefines ( std::ostream & ) const
virtual

include the appropriate headers and write the definition of the MFRONT_SHAREDOBJ macro which is used to define the visibility of the generated functions.

Parameters
[out]outoutput file

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