tfel
Loading...
Searching...
No Matches
mfront::GenericBehaviourInterface Struct Reference

a generic behaviour interface See https://github.com/thelfer/MFrontGenericInterfaceSupport More...

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

Inheritance diagram for mfront::GenericBehaviourInterface:
mfront::BehaviourInterfaceBase mfront::AbstractBehaviourInterface mfront::SupportedTypes

Public Member Functions

std::string getInterfaceName () const override
 the name of the interface is mostly used internally to build
std::pair< bool, tokens_iterator > treatKeyword (BehaviourDescription &, const std::string &, const std::vector< std::string > &, tokens_iterator, const tokens_iterator) override
 treat a keyword
std::set< Hypothesis > getModellingHypothesesToBeTreated (const BehaviourDescription &) const override
void writeInterfaceSpecificIncludes (std::ostream &, const BehaviourDescription &) const override
void endTreatment (const BehaviourDescription &, const FileDescription &) const override
 write output files
void getTargetsDescription (TargetsDescription &, const BehaviourDescription &) override
void writeBehaviourConstructorHeader (std::ostream &, const BehaviourDescription &, const Hypothesis, const std::string &) const override
 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.
void writeBehaviourConstructorBody (std::ostream &, const BehaviourDescription &, const Hypothesis) const override
 complete the body of the behaviour constructor associated with the interface.
void writeBehaviourDataConstructor (std::ostream &, const Hypothesis, const BehaviourDescription &) const override
void writeIntegrationDataConstructor (std::ostream &, const Hypothesis, const BehaviourDescription &) const override
void writeBehaviourDataMainVariablesSetters (std::ostream &, const BehaviourDescription &) const override
void writeIntegrationDataMainVariablesSetters (std::ostream &, const BehaviourDescription &) const override
 write the setters associated with the main variables
void exportMechanicalData (std::ostream &, const Hypothesis, const BehaviourDescription &) 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
std::string getFunctionNameBasis (const std::string &) const override
virtual std::string getLibraryName (const BehaviourDescription &) const
virtual std::string getFunctionNameForHypothesis (const std::string &, const Hypothesis) const
 ~GenericBehaviourInterface () override
 destructor
Public Member Functions inherited from mfront::BehaviourInterfaceBase
 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
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 ~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 Member Functions

static std::string getName ()
static unsigned short getAPIVersion ()
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)

Protected Member Functions

virtual void generateMTestFile (std::ostream &, const BehaviourDescription &, const Hypothesis) const
 write the generation of an MTest file for the given hypothesis

Protected Attributes

std::optional< std::set< GenericBehaviourInterface::Hypothesis > > selectedHypotheses
 list of selected hypotheses

Additional Inherited Members

Public Types inherited from mfront::BehaviourInterfaceBase
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
Static Public Attributes inherited from mfront::BehaviourInterfaceBase
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

Detailed Description

Member Function Documentation

◆ endTreatment()

void mfront::GenericBehaviourInterface::endTreatment ( const BehaviourDescription & ,
const FileDescription &  ) const
overridevirtual

write output files

Parameters
[in]mb: behaviour description
[in]fd: mfront file description

Implements mfront::AbstractBehaviourInterface.

◆ exportMechanicalData()

void mfront::GenericBehaviourInterface::exportMechanicalData ( std::ostream & ,
const Hypothesis ,
const BehaviourDescription &  ) const
overridevirtual

◆ generateMTestFile()

virtual void mfront::GenericBehaviourInterface::generateMTestFile ( std::ostream & ,
const BehaviourDescription & ,
const Hypothesis  ) const
protectedvirtual

write the generation of an MTest file for the given hypothesis

Parameters
[out]outoutput stream
[in]bdbehaviour description
[in]hmodelling hypothesis

◆ getAPIVersion()

unsigned short mfront::GenericBehaviourInterface::getAPIVersion ( )
staticnodiscard
Returns
the current API version

This API version changes everytime the API of the generic interface changes.

◆ getFunctionNameBasis()

std::string mfront::GenericBehaviourInterface::getFunctionNameBasis ( const std::string & ) const
nodiscardoverridevirtual
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)

Implements mfront::BehaviourInterfaceBase.

◆ getFunctionNameForHypothesis()

virtual std::string mfront::GenericBehaviourInterface::getFunctionNameForHypothesis ( const std::string & ,
const Hypothesis  ) const
nodiscardvirtual
Returns
the name of the function generated for the given hypothesis
Parameters
[in]basename for the function to be generated

◆ getInterfaceName()

std::string mfront::GenericBehaviourInterface::getInterfaceName ( ) const
nodiscardoverridevirtual

the name of the interface is mostly used internally to build

  • the name of the variable passed to the constructors.
  • the headers guards.
  • etc...
    Returns
    the name of the interface

Implements mfront::AbstractBehaviourInterface.

◆ getModellingHypothesesToBeTreated()

std::set< Hypothesis > mfront::GenericBehaviourInterface::getModellingHypothesesToBeTreated ( const BehaviourDescription & ) const
nodiscardoverridevirtual
Returns
the list of modelling hypotheses treated by the interface
Parameters
[in]mb: behaviour description

Implements mfront::AbstractBehaviourInterface.

◆ getName()

std::string mfront::GenericBehaviourInterface::getName ( )
staticnodiscard
Returns
the interface name

◆ getTargetsDescription()

void mfront::GenericBehaviourInterface::getTargetsDescription ( TargetsDescription & ,
const BehaviourDescription &  )
overridevirtual
Parameters
[out]d: target description
[out]bd: behaviour description

Implements mfront::AbstractBehaviourInterface.

◆ treatKeyword()

std::pair< bool, tokens_iterator > mfront::GenericBehaviourInterface::treatKeyword ( BehaviourDescription & ,
const std::string & ,
const std::vector< std::string > & ,
tokens_iterator ,
const tokens_iterator  )
nodiscardoverridevirtual

treat a keyword

Parameters
[in,out]bdbehaviour description
[in]keykeyword to be treated
[in]ilist of interfaces to which the keyword is restricted
[in]pcurrent position in the file
[in]peiterator past the end of the file
Returns
a pair. The first entry is true if the keyword was treated by the interface. The second entry is an iterator after the last token treated.

Implements mfront::AbstractBehaviourInterface.

◆ writeBehaviourConstructorBody()

void mfront::GenericBehaviourInterface::writeBehaviourConstructorBody ( std::ostream & ,
const BehaviourDescription & ,
const Hypothesis  ) const
overridevirtual

complete the body of the behaviour constructor associated with the interface.

Parameters
[in]osoutput file
[in]mbbehaviour description
[in]hmodelling hypothesis

Implements mfront::AbstractBehaviourInterface.

◆ writeBehaviourConstructorHeader()

void mfront::GenericBehaviourInterface::writeBehaviourConstructorHeader ( std::ostream & ,
const BehaviourDescription & ,
const Hypothesis ,
const std::string &  ) const
overridevirtual

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.

Parameters
[in]behaviourFile: output file
[in]mb: behaviour description
[in]h: modelling hypothesis
[in]initStateVarsIncrements: constructor part assigning default value (zero) to state variable increments

Implements mfront::AbstractBehaviourInterface.

◆ writeBehaviourDataConstructor()

void mfront::GenericBehaviourInterface::writeBehaviourDataConstructor ( std::ostream & ,
const Hypothesis ,
const BehaviourDescription &  ) const
overridevirtual

◆ writeBehaviourDataMainVariablesSetters()

void mfront::GenericBehaviourInterface::writeBehaviourDataMainVariablesSetters ( std::ostream & ,
const BehaviourDescription &  ) const
overridevirtual

write the behaviour constructor associated with the law

Parameters
[in]behaviourFile: output file
[in]mb: behaviour description

Implements mfront::AbstractBehaviourInterface.

◆ writeBehaviourInitializeFunctions()

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

write the initialize functions

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

Reimplemented from mfront::BehaviourInterfaceBase.

◆ writeBehaviourPostProcessings()

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

write the post-processings

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

Reimplemented from mfront::BehaviourInterfaceBase.

◆ writeIntegrationDataConstructor()

void mfront::GenericBehaviourInterface::writeIntegrationDataConstructor ( std::ostream & ,
const Hypothesis ,
const BehaviourDescription &  ) const
overridevirtual

◆ writeIntegrationDataMainVariablesSetters()

void mfront::GenericBehaviourInterface::writeIntegrationDataMainVariablesSetters ( std::ostream & ,
const BehaviourDescription &  ) const
overridevirtual

write the setters associated with the main variables

Parameters
[in]behaviourFile: output file
[in]mb: behaviour description

Implements mfront::AbstractBehaviourInterface.

◆ writeInterfaceSpecificIncludes()

void mfront::GenericBehaviourInterface::writeInterfaceSpecificIncludes ( std::ostream & ,
const BehaviourDescription &  ) const
overridevirtual

write interface specific includes

Parameters
[in]out: output file
[in]mb: behaviour description

Implements mfront::AbstractBehaviourInterface.


The documentation for this struct was generated from the following file:
  • GenericBehaviourInterface.hxx