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

this class provides most functionnalities used by mechanical behaviour parsers. More...

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

Inheritance diagram for mfront::BehaviourDSLCommon:
mfront::AbstractBehaviourDSL mfront::DSLBase mfront::SupportedTypes mfront::AbstractDSL mfront::AbstractDSL tfel::utilities::CxxTokenizer tfel::utilities::CxxTokenizerOptions mfront::BehaviourDSLBase< DefaultDSLBase > mfront::BehaviourDSLBase< ImplicitDSLBase > mfront::BehaviourDSLBase< IsotropicBehaviourDSLBase > mfront::BehaviourDSLBase< RungeKuttaDSLBase > mfront::BehaviourDSLBase< Child > mfront::DefaultDSLBase mfront::ImplicitDSLBase mfront::IsotropicBehaviourDSLBase mfront::RungeKuttaDSLBase mfront::DefaultCZMDSL mfront::DefaultDSL mfront::DefaultFiniteStrainDSL mfront::DefaultGenericBehaviourDSL mfront::DefaultModelDSL mfront::ImplicitCZMDSL mfront::ImplicitDSL mfront::ImplicitDSLII mfront::ImplicitFiniteStrainDSL mfront::ImplicitGenericBehaviourDSL mfront::ImplicitModelDSL mfront::IsotropicMisesCreepDSL mfront::IsotropicMisesPlasticFlowDSL mfront::IsotropicStrainHardeningMisesCreepDSL mfront::MultipleIsotropicMisesFlowsDSL mfront::RungeKuttaDSL mfront::RungeKuttaFiniteStrainDSL mfront::RungeKuttaGenericBehaviourDSL mfront::RungeKuttaModelDSL

Classes

struct  StandardVariableModifier
 create a variable modifier from a method More...
struct  StandardWordAnalyser
struct  CodeBlockOptions
 structure holding options passed to code blocks More...

Public Types

using Hook = std::function<void()>
 a simple alias
using OrthotropicAxesConvention = tfel::material::OrthotropicAxesConvention
 a simple alias
Public Types inherited from mfront::AbstractBehaviourDSL
using MaterialPropertyInput = BehaviourDescription::MaterialPropertyInput
 a simple alias
using ModellingHypothesis = tfel::material::ModellingHypothesis
 a simple alias
using Hypothesis = ModellingHypothesis::Hypothesis
 a simple alias
Public Types inherited from mfront::AbstractDSL
enum  DSLTarget { MATERIALPROPERTYDSL , BEHAVIOURDSL , MODELDSL }
 list of dsl targets
using DSLOptions = tfel::utilities::DataMap
 a simple alias
Public Types inherited from tfel::utilities::CxxTokenizer
using TokensContainer = std::vector<Token>
 a simple alias
using const_iterator = TokensContainer::const_iterator
 a simple alias
using size_type = TokensContainer::size_type
 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

const BehaviourDescription & getBehaviourDescription () const final
std::map< std::string, std::shared_ptr< AbstractBehaviourInterface > > getBehaviourInterfaces () const override
std::shared_ptr< MaterialPropertyDescription > handleMaterialPropertyDescription (const std::string &) override
 This function handles a material property treated as a dependency of the current file.
std::string getMaterialKnowledgeIdentifier () const override
std::string getMaterialName () const override
std::string getOverridableVariableNameByExternalName (const std::string &) const override
void overrideByAParameter (const std::string &, const double) override
 specify that the given variable must be overriden by a parameter.
std::map< std::string, double > getOverridenParameters () const override
void analyseFile (const std::string &, const std::vector< std::string > &, const std::map< std::string, std::string > &) override
 analyse a file
void importFile (const std::string &, const std::vector< std::string > &, const std::map< std::string, std::string > &) override
 import a file
void analyseString (const std::string &) override
 analyse the specified string.
void endsInputFileProcessing () override
 method called at the end of the input file processing.
void makeConsistencyChecks () const override
 method called after processing the input file processing.
virtual void declareMainVariables ()
 method called when a new gradient or a new thermodynamic force is defined. It declares as many pair of gradient and thermodynamic force as possible.
virtual void addHook (const std::string &, const Hook)
void getKeywordsList (std::vector< std::string > &) const override
 return the list of keywords usable with this parser
void addMaterialProperties (const VariableDescriptionContainer &) override
 add the given material properties
void addParameters (const VariableDescriptionContainer &) override
 add the given parameters
void addStateVariables (const VariableDescriptionContainer &) override
 add the given state variables
void addAuxiliaryStateVariables (const VariableDescriptionContainer &) override
 add the given auxiliary state variables
void addExternalStateVariables (const VariableDescriptionContainer &) override
 add the given external state variables
void addLocalVariables (const VariableDescriptionContainer &) override
 add the given local state variables
void addIntegrationVariables (const VariableDescriptionContainer &) override
 add the given integration variables
Public Member Functions inherited from mfront::AbstractBehaviourDSL
 AbstractBehaviourDSL ()=default
 constructor
DSLTarget getTargetType () const final
virtual BehaviourDSLDescription getBehaviourDSLDescription () const =0
virtual std::unique_ptr< AbstractBehaviourCodeGenerator > getCodeGenerator () const =0
virtual std::string getCodeBlockTemplate (const std::string &, const MFrontTemplateGenerationOptions &) const =0
 ~AbstractBehaviourDSL () override
 destructor
Public Member Functions inherited from mfront::AbstractDSL
virtual ~AbstractDSL ()
 destructor
Public Member Functions inherited from mfront::DSLBase
std::vector< DSLOptionDescription > getDSLOptions () const override
const FileDescription & getFileDescription () const final
const TargetsDescription & getTargetsDescription () const override
virtual void openFile (const std::string &, const std::vector< std::string > &, const std::map< std::string, std::string > &)
 open a file and add given external instructions at the beginning
Public Member Functions inherited from tfel::utilities::CxxTokenizer
 CxxTokenizer ()
 default constructor
 CxxTokenizer (const CxxTokenizerOptions &)
 constructor with options
 CxxTokenizer (const std::string &)
 constructor from a file
 CxxTokenizer (const std::string &, const CxxTokenizerOptions &)
 constructor from a file
template<typename InputIterator>
void import (const InputIterator, const InputIterator)
 import the specified tokens
void parseString (const std::string &)
 analyse the string given all previous tokens are erased
void openFile (const std::string &)
 import the specified file
void printFileTokens (std::ostream &) const
 print the stored tokens to the specified stream
void setCStyleCommentOpened (const bool)
 assume that a C-style comment was opened at the beginning of the processing. This is usefull when parsing a file line by line
bool isCStyleCommentOpened () const
void setRawStringOpened (const bool)
 assume that a raw string was opened at the beginning of the processing.
void setRawStringDelimiter (std::string_view)
 set the raw string deliminter. This assume that a raw string was opened at the beginning of the processing, i.e. sets the rawStringOpened boolean to true.
bool isRawStringOpened () const
std::string getCurrentRawStringDelimiter () const noexcept
void stripComments ()
 remove all comment tokens
void clear ()
 clear the object
void treatCharAsString (const bool)
 set if char tokens shall be treated as string tokens
void keepCommentBoundaries (const bool)
 set if the comment boundaries must be left in the resulting tokens.
void treatDotAsSeparator (const bool)
 set if '.' shall be treated as as sperator
void treatPlusAsSeparator (const bool)
 set if '+' shall be treated as as sperator
void treatMinusAsSeparator (const bool)
 set if '-' shall be treated as as sperator
void mergeStrings (const bool)
 set if successive strings shall be merged
void extractNumbers (const bool)
 set if tokens shall be split to extract numbers
void addSeparator (const std::string &)
 add a new separator
void substitute (const std::map< std::string, std::string > &)
 apply the given substitutions by calling replace_all on the values hold by the standard and string tokens.
bool empty () const
const_iterator begin () const
const_iterator end () const
const_iterator cbegin () const
const_iterator cend () const
const Token & operator[] (const size_type) const
size_type size () const
virtual ~CxxTokenizer ()
 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 tfel::utilities::DataMapValidator getDSLOptionsValidator ()
Static Public Member Functions inherited from mfront::DSLBase
static tfel::utilities::DataMapValidator getDSLOptionsValidator ()
Static Public Member Functions inherited from tfel::utilities::CxxTokenizer
static bool isValidIdentifier (std::string_view, const IsValidIdentifierOptions &)
static bool isValidIdentifier (std::string_view, const bool=true)
static void checkNotEndOfLine (const std::string &, const_iterator &, const const_iterator)
 an helper method throwing an exception if the given iterator is egal to the third argument (which shall point after the last token of the line)
static void checkNotEndOfLine (const std::string &, const std::string &, const_iterator &, const const_iterator)
 an helper method throwing an exception if the given iterator is egal to the fourth argument (which shall point after the last token of the line)
static void readSpecifiedToken (const std::string &, const std::string &, const_iterator &, const const_iterator)
 an helper method throwing an exception if the given iterator is egal to the fourth argument (which shall point after the last token of the line) or if the given token is not equal to the expected value
static unsigned int readUnsignedInt (const_iterator &, const const_iterator)
 an helper method to extract an unsigned int from the given token
static std::string readString (const_iterator &, const const_iterator)
 an helper method to extract a string from the given token
static std::vector< std::string > readArray (const std::string &, const_iterator &, const const_iterator)
 an helper method to extract a set of values from the given as an array
static void readArray (const std::string &, std::vector< std::string > &, const_iterator &, const const_iterator)
 an helper method to extract a set of values from the given as an array
static std::vector< Token > readList (const std::string &, const std::string &, const std::string &, const_iterator &, const const_iterator)
 extract a list of token
static void readList (std::vector< Token > &, const std::string &, const std::string &, const std::string &, const_iterator &, const const_iterator)
 extract a list of token
static std::vector< std::string > readStringArray (const_iterator &, const const_iterator)
 an helper method to extract a set of values from the given as an array
static double readDouble (const_iterator &, const const_iterator)
 an helper method to extract a double from the given token
static int readInt (const_iterator &, const const_iterator)
 an helper method to extract a int from the given token
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 Types

using CallBack = std::function<void()>
 a simple alias

Protected Member Functions

 BehaviourDSLCommon (const DSLOptions &)
 constructor
void writeMaterialPropertyEvaluation (std::ostream &, const BehaviourDescription::MaterialProperty &, std::function< std::string(const MaterialPropertyInput &)> &) const override
 write the call to a material property
void addExternalMFrontFile (const std::string &, const std::vector< std::string > &, const tfel::utilities::DataMap &) override
 add a dependency to an external MFront file
const MaterialKnowledgeDescription & getMaterialKnowledgeDescription () const override
std::vector< DSLOptionDescription > getDSLOptions () const override
DSLOptions buildDSLOptions () const override
bool useQt () const override
void disableQuantitiesUsageIfNotAlreadySet () override
 disable the usage of quantities if not already set
std::string getClassName () const override
void addMaterialLaw (const std::string &) override
 add a material law
void appendToIncludes (const std::string &) override
 append the given code to the includes
void appendToMembers (const std::string &) override
 append the given code to the members
void appendToPrivateCode (const std::string &) override
 append the given code to the private code
void appendToSources (const std::string &) override
 append the given code to the sources
std::set< Hypothesis > getModellingHypothesesToBeTreated () const
virtual void analyse ()
virtual void treatDisabledCallBack ()
virtual void disableCallBack (const std::string &)
virtual void addCallBack (const std::string &, const CallBack, const bool=false)
 add a new call-back associated with a keyword
virtual void getSymbols (std::map< std::string, std::string > &, const Hypothesis, const std::string &)
 get all symbols required to interpret the given code block.
virtual void readCodeBlockOptions (CodeBlockOptions &, const bool)
CodeBlockOptions treatCodeBlock (const std::string &, std::function< std::string(const Hypothesis, const std::string &, const bool)>, const bool, const bool)
 read the next code block and adds it tho the mechanical behaviour
void treatCodeBlock (const CodeBlockOptions &, const std::string &, std::function< std::string(const Hypothesis, const std::string &, const bool)>, const bool)
 read the next code block and adds it tho the mechanical behaviour
CodeBlockOptions treatCodeBlock (const std::string &, std::function< std::string(const Hypothesis, const std::string &, const bool)>, std::function< void(CodeBlock &, const Hypothesis, const std::string &)>, const bool, const bool)
 read the next code block and adds it tho the mechanical behaviour
void treatCodeBlock (const CodeBlockOptions &, const std::string &, std::function< std::string(const Hypothesis, const std::string &, const bool)>, std::function< void(CodeBlock &, const Hypothesis, const std::string &)>, const bool)
 read the next code block and adds it tho the mechanical behaviour
CodeBlockOptions treatCodeBlock (const std::string &, const std::string &, std::function< std::string(const Hypothesis, const std::string &, const bool)>, std::function< std::string(const Hypothesis, const std::string &, const bool)>, const bool, const bool)
 read the next code block and adds it tho the mechanical behaviour
void treatCodeBlock (const CodeBlockOptions &, const std::string &, const std::string &, std::function< std::string(const Hypothesis, const std::string &, const bool)>, std::function< std::string(const Hypothesis, const std::string &, const bool)>, const bool)
 read the next code block and adds it tho the mechanical behaviour
CodeBlock readNextBlock (const Hypothesis, const std::string &, std::function< std::string(const Hypothesis, const std::string &, const bool)>, std::function< void(CodeBlock &, const Hypothesis, const std::string &)>, const bool)
 read the next code block for the given hypothesis
CodeBlock readNextBlock (const Hypothesis, const std::string &, std::function< std::string(const Hypothesis, const std::string &, const bool)>, const bool)
 read the next code block for the given hypothesis
void treatUnsupportedCodeBlockOptions (const CodeBlockOptions &)
 throw an exception is some options were not recognized
void addStaticVariableDescription (const StaticVariableDescription &) override
 add a static variable description
std::map< std::string, int > getIntegerConstants () const override
int getIntegerConstant (const std::string &) const override
virtual void disableVariableDeclaration ()
 disable the declaration of new variables
virtual void completeVariableDeclaration ()
 method called at the end of the input file processing.
void generateOutputFiles () override
 treat the specified file.
std::set< Hypothesis > getDefaultModellingHypotheses () const override
bool isModellingHypothesisSupported (const Hypothesis) const override
virtual std::string standardModifier (const Hypothesis, const std::string &, const bool)
 the standard variable modifier
virtual std::string predictionOperatorVariableModifier (const Hypothesis, const std::string &, const bool)
virtual std::string tangentOperatorVariableModifier (const Hypothesis, const std::string &, const bool)
virtual BehaviourVariableDescription readBehaviourVariableDescription ()
 read the description of a behaviour variable
virtual BehaviourVariableDescription readBehaviourVariableDescription (const std::string &, const tfel::utilities::Token::size_type, const std::optional< std::string > &={})
 read the description of a behaviour variable
BehaviourDescription::MaterialProperty extractMaterialProperty (const std::string &, const tfel::utilities::Token &)
 extract a material property from a token. If the token is a string, it is interpred as a mfront file name. Otherwise, the token is converted to a scalar.
virtual std::vector< BehaviourDescription::MaterialProperty > readMaterialPropertyOrArrayOfMaterialProperties (const std::string &m)
 read an an array of material properties. String are interpreted as mfront file name. Other tokens are interpreted as long double.
virtual void readStringList (std::vector< std::string > &)
virtual std::set< Hypothesis > readHypothesesList ()
virtual void readHypothesesList (std::set< Hypothesis > &)
void appendToHypothesesList (std::set< Hypothesis > &, const std::string &) const
 append the given modelling hypothesis to the set of hypothesis
virtual void readVariableList (VariableDescriptionContainer &, std::set< Hypothesis > &, void(BehaviourDescription::*)(const Hypothesis, const VariableDescriptionContainer &, const BehaviourData::RegistrationStatus), const bool)
virtual void addVariableList (const std::set< Hypothesis > &, const VariableDescriptionContainer &, void(BehaviourDescription::*)(const Hypothesis, const VariableDescriptionContainer &, const BehaviourData::RegistrationStatus))
void reserveName (const std::string &) final
 register a name.
void registerDefaultVarNames ()
 register the default variable names
void setInterfaces (const std::set< std::string > &) override
 set list of interfaces
bool isNameReserved (const std::string &) const override
 look if a name is reserved
void setUnitSystem (const std::string_view) override
 set the unit system
void setMaterial (const std::string &) override
 set the material described by the implementation
void setMaterialKnowledgeIdentifier (const std::string &) override
 set the name of the implementation, i.e. the material property' name, the behaviour' name or the model' name.
virtual void treatGradient ()
 treat the @Gradient keyword.
virtual void treatThermodynamicForce ()
 treat the @ThermodynamicForce keyword. Also treat the @Flux keyword.
virtual void treatTangentOperatorBlock ()
 treat the @TangentOperatorBlock keyword.
virtual void treatSpeedOfSound ()
 treat the @SpeedOfSound keyword.
virtual void treatTangentOperatorBlocks ()
 treat the @TangentOperatorBlocks keyword.
virtual void treatAdditionalTangentOperatorBlock ()
 treat the @AdditionalTangentOperatorBlock keyword.
virtual void treatAdditionalTangentOperatorBlocks ()
 treat the @AdditionalTangentOperatorBlocks keyword.
virtual void treatBrick ()
 treat the @Brick keyword
virtual void treatModel ()
 treat the @Model keyword
virtual void treatModel2 ()
 alternative treatment of the @Model keyword
virtual ModelDescription getModelDescription (const std::string &)
 get a model description from an mfront file
virtual BehaviourDescription getBehaviourDescription (const std::string &)
 get a behaviour description from an mfront file
void treatPrivate () override
 treat the @Private keyword
void treatMembers () override
 treat the @Members keyword
virtual void treatInitializeFunction ()
 treat the @InitializeFunction keyword
virtual void treatPostProcessing ()
 treat the @PostProcessing keyword
virtual void treatStrainMeasure ()
 treat the @StrainMeasure keyword
virtual void treatTangentOperator ()
 treat the @TangentOperator keyword
virtual void readTangentOperatorCodeBlock (const CodeBlockOptions &, const std::string &)
 read a code block describing the computation of one of the tangent operator
virtual void treatIsTangentOperatorSymmetric ()
 treat the @IsTangentOperatorSymmetric keyword
virtual void treatLibrary ()
 treat the @Library keyword
virtual void treatProfiling ()
 treat the @Profiling keyword
virtual void treatModellingHypothesis ()
 treat the @ModellingHypothesis keyword
virtual void treatModellingHypotheses ()
 treat the @ModellingHypotheses keyword
virtual void treatUpdateAuxiliaryStateVariables ()
 treat the @UpdateAuxiliaryStateVariables keyword
virtual void treatInitialize ()
 treat the @Initialize keyword
virtual void treatInternalEnergy ()
 treat the @InternalEnergy keyword
virtual void treatDissipatedEnergy ()
 treat the @DissipatedEnergy keyword
virtual void treatComputeStressFreeExpansion ()
 treat the @ComputeStressFreeExpansion keyword
virtual void treatUsableInPurelyImplicitResolution ()
 treat the @UsableInPurelyImplicitResolution keyword
virtual void treatParameter ()
 treat the @Parameter keyword
virtual void treatLocalVar ()
 treat the @LocalVariables keyword
virtual void treatComputeThermalExpansion ()
 handle the @ComputeThermalExpansion keyword
virtual void treatComputeThermalExpansionFirstSyntax ()
virtual void treatComputeThermalExpansionSecondSyntax ()
virtual void treatComputeStiffnessTensor ()
 handle the @ComputeStiffnessTensor keyword
virtual void treatElasticMaterialProperties ()
 handle the @ElasticMaterialProperties keyword
virtual void readElasticMaterialProperties ()
 read the elastic material properties and assign them to the behaviour Description
virtual std::vector< BehaviourDescription::MaterialProperty > readElasticMaterialPropertiesI ()
 helper function to read the elastic material properties
virtual std::vector< BehaviourDescription::MaterialProperty > readElasticMaterialPropertiesII ()
 helper function to read the elastic material properties
virtual void treatHillTensor ()
 handle the @HillTensor keyword
virtual std::vector< BehaviourDescription::MaterialProperty > readHillTensorDefinitionI ()
 helper function to read the elastic material properties
virtual std::vector< BehaviourDescription::MaterialProperty > readHillTensorDefinitionII ()
 helper function to read the elastic material properties
virtual void treatInitLocalVariables ()
 handle the @InitLocalVariables keyword
virtual void treatOrthotropicBehaviour ()
 handle the @OrthotropicBehaviour keyword
virtual void treatIsotropicElasticBehaviour ()
 handle the @IsotropicElasticBehaiour keyword
virtual void treatIsotropicBehaviour ()
 handle the @IsotropicBehaviour keyword
virtual void treatRequireStiffnessOperator ()
 handle the @RequireStiffnessOperator keyword
virtual void treatRequireStiffnessTensor ()
 handle the @RequireStiffnessTensor keyword
virtual void treatStiffnessTensorOption ()
virtual void treatRequireThermalExpansionCoefficientTensor ()
 handle the @RequireThermalExpansionCoefficientTensor keyword
virtual void treatBehaviour ()
 handle the @Behaviour keyword
virtual void treatBehaviourVariable ()
 handle the @BehaviourVariable keyword
virtual void treatBehaviourVariableFactory ()
 handle the @BehaviourVariableFactory keyword
virtual void treatInterface ()
 handle the @Interface keyword
virtual void treatStateVariable ()
 handle the @StateVariable keyword
virtual void treatAuxiliaryStateVariable ()
 handle the @AuxiliaryStateVariable keyword
virtual void treatAuxiliaryModel ()
 handle the @AuxiliaryModel keyword
virtual void treatExternalStateVariable ()
 handle the @ExternalStateVariable keyword
virtual void treatInitializeFunctionVariable ()
 handle the @InitializeFunctionVariable keyword
virtual void treatPostProcessingVariable ()
 handle the @PostProcessingVariable keyword
virtual void treatMinimalTimeStepScalingFactor ()
 treat the @MinimalTimeStepScalingFactor keyword
virtual void treatMaximalTimeStepScalingFactor ()
 treat the @MaximalTimeStepScalingFactor keyword
virtual void treatAPrioriTimeStepScalingFactor ()
 treat the @APrioriTimeStepScalingFactor keyword
virtual void treatIntegrator ()
 treat the @Integrator keyword
virtual void treatAPosterioriTimeStepScalingFactor ()
 treat the @APosterioriTimeStepScalingFactor keyword
virtual void treatCoef ()
 treat the @MaterialProperty and the @Coef keywords
virtual void treatUseQt ()
 treat the @UseQt keyword
virtual void treatBounds ()
 treat the @Bounds keyword
virtual void treatPhysicalBounds ()
 treat the @PhysicalBounds keyword
virtual void treatPredictionOperator ()
 treat the @PredictionOperator keyword
virtual void treatSwelling ()
 treat the @Swelling keyword
virtual void treatAxialGrowth ()
 treat the @AxialGrowth keyword
virtual void treatRelocation ()
 treat the @Relocation keyword
virtual void treatCrystalStructure ()
 treat the @CrystalStructure keyword
virtual void treatSlipSystem ()
 treat the @SlipSystem keyword
virtual void treatSlipSystems ()
 treat the @SlipSystems keyword
virtual void treatInteractionMatrix ()
 treat the @InteractionMatrix keyword
virtual void treatDislocationsMeanFreePathInteractionMatrix ()
 treat the @DislocationsMeanFreePathInteractionMatrix keyword.
virtual std::vector< BehaviourData::StressFreeExpansionHandler > readStressFreeExpansionHandler ()
 read a swelling description.
virtual BehaviourData::StressFreeExpansionHandler readStressFreeExpansionHandler (const tfel::utilities::Token &)
 extract a swelling description from a token
virtual void treatGradientMethod ()
 treat methods associated with a gradient
virtual void treatThermodynamicForceMethod ()
 treat methods associated with a thermodynamic force
virtual void treatParameterMethod (const Hypothesis)
 treat methods associated with a parameter
virtual std::string treatSetGlossaryNameMethod ()
 analyse the setGlossaryNameMethod and returns its argument
virtual std::string treatSetEntryNameMethod ()
 analyse the setEntryNameMethod and returns its argument
virtual bool isCallableVariable (const Hypothesis, const std::string &) const
virtual void treatVariableMethod (const Hypothesis)
virtual void treatUnknownVariableMethod (const Hypothesis, const std::string &)
void treatUnknownKeyword () override
 method called when an unknown keyword is parsed
 ~BehaviourDSLCommon () override
 destructor
virtual void declareExternalStateVariableProbablyUnusableInPurelyImplicitResolution (const Hypothesis, const std::string &)
virtual void setMinimalTangentOperator ()
 if no tangent operator was provided, but that the behaviour requires a stiffness matrix, this method creates a minimal tangent operator for elasticity.
virtual void setComputeFinalThermodynamicForcesFromComputeFinalThermodynamicForcesCandidateIfNecessary ()
 if the compte final thermodynamic forces code is not available, create it from the ComputeFinalThermodynamicForcesCandidate code if it is available.
virtual void doPedanticChecks () const
 perform pedantic checks
void checkTangentOperatorBlock (const std::string &, const CodeBlock &) const
 performs common checks on a code block computing the consistent tangent operator or the tangent operator blocks
void treatModel (const std::string &, void(BehaviourDescription::*)(const ModelDescription &), void(BehaviourDescription::*)(const BehaviourVariableDescription &))
 common implementation used by the treatModel and treatAuxiliaryModel methods
void readNextBlock (CodeBlock &, CodeBlock &, const CodeBlockParserOptions &, const CodeBlockParserOptions &)
 parse the next code block twice.
CodeBlock readNextBlock (const CodeBlockParserOptions &)
Protected Member Functions inherited from mfront::DSLBase
 DSLBase (const DSLOptions &)
 constructor
virtual void overrideMaterialKnowledgeIdentifier (const std::string &)
 specify the name of the implementation before parsing the MFront source file. Any name specified in the MFront file, through the @Law, @Behaviour or @Model keywords, will be ignored.
virtual void overrideMaterialName (const std::string &)
 specify the name of the material before parsing the MFront source file. Any material name specified with the @Material keyword will be ignored.
virtual void overrideAuthorName (const std::string &)
 specify the name of the author before parsing the MFront source file. Any author' name specified with the @Author keyword will be ignored.
virtual void overrideDate (const std::string &)
 specify the date of the MFront implementation before parsing the MFront source file. Any date specified with the @Date keyword will be ignored.
virtual void overrideDescription (const std::string &)
 specify the description of the MFront implementation before parsing the MFront source file. Any description specified with the @Description keyword will be ignored.
virtual void overrideUnitSystem (const std::string &)
 specify the unit system of the MFront implementation before parsing the MFront source file. Any unit system specified with the @UnitSystem keyword will be ignored.
void checkNotEndOfFile (const std::string &, const std::string &="") const
 check that the end of file in not reached yet
void readSpecifiedToken (const std::string &, const std::string &)
 read a specified token and advance to the next token
void throwRuntimeError (const std::string &, const std::string &) const
 throw an std::runtime_error
std::string readUntilEndOfInstruction ()
unsigned short readUnsignedShort (const std::string &)
void readNextBlock (CodeBlock &, CodeBlock &, const CodeBlockParserOptions &, const CodeBlockParserOptions &)
 parse the next code block twice.
CodeBlock readNextBlock (const CodeBlockParserOptions &)
std::string readOnlyOneToken ()
 read one token and increment "current"
template<typename T>
std::pair< bool, T > readInitialisationValue (const std::string &, const bool)
virtual SupportedTypes::TypeParsingOptions getTypeParsingOptions () const
 return the type parsing options used by the DSL
std::string readType ()
 read a C++ type
std::optional< std::string > readVariableTypeIfPresent ()
 read a C++ type if present
bool readSafeOptionTypeIfPresent ()
unsigned int readArrayOfVariablesSize (const std::string &, const bool)
void readVarList (VariableDescriptionContainer &, const std::string &, const bool)
void readVarList (VariableDescriptionContainer &, const bool)
bool readBooleanValue (const std::string &)
std::string readString (const std::string &)
std::vector< std::string > readArrayOfString (const std::string &)
std::vector< double > readArrayOfDouble (const std::string &)
std::vector< std::string > readStringOrArrayOfString (const std::string &)
void readList (std::vector< tfel::utilities::Token > &, const std::string &, const std::string &, const std::string &, const bool)
 extract a list of token
std::vector< tfel::utilities::Token > readList (const std::string &, const std::string &, const std::string &, const bool)
std::string readSpecifiedValue (const std::string &, const std::string &)
std::vector< std::string > readSpecifiedValues (const std::string &, const std::string &, const std::string &)
std::vector< std::string > readSpecifiedValues (const std::string &, const std::vector< std::string > &)
std::pair< std::string, VariableBoundsDescription > readVariableBounds ()
 read the bounds associated to a variable
virtual void callMFront (const std::vector< std::string > &, const std::vector< std::string > &, const tfel::utilities::DataMap &)
virtual void setAuthor (const std::string &)
 set the author of the implementation
virtual void setDate (const std::string &)
 set the date at which the implementation has been written
virtual void setDescription (const std::string &)
 set the description of the MFront file
virtual void treatMaterial ()
 treat the @Material keyword
virtual void treatUnitSystem ()
 treat the @UnitSystem keyword
virtual void treatMFront ()
 handle the @MFront keyword
virtual void treatImport ()
 handle the @Import keyword
virtual void treatMaterialLaw ()
 handle the @MaterialLaw keyword
virtual void treatLink ()
 handle the @Link keyword
virtual void treatTFELLibraries ()
 handle the @TFELLibraries keyword
virtual void treatAuthor ()
 handle the @Author keyword
virtual void treatDate ()
 handle the @Data keyword
virtual void treatIncludes ()
 handle the @Includes keyword
virtual void treatSources ()
 handle the @Sources keyword
virtual void treatDSL ()
 handle the @DSL or @Parser keyword
virtual void treatStaticVar ()
 handle the @StaticVar keyword
virtual void treatIntegerConstant ()
 handle the @IntegerConstant keyword
virtual void treatDescription ()
 handle the @Description keyword
virtual void treatLonelySeparator ()
 handle the @LonelySeparator keyword
virtual void ignoreKeyWord (const std::string &)
virtual void completeTargetsDescription ()
 this method must be called at the end of the treatment:
virtual void registerIntegerConstant (const std::string &, const size_t, const int)
 register an integer constant.
double readDouble ()
 extract a double from the current token
 ~DSLBase () override
 destructor
Protected Member Functions inherited from tfel::utilities::CxxTokenizer
virtual void parseStream (std::istream &, Token::size_type &, const std::string &)
 tokenize the lines of a stream
virtual void splitLine (const std::string &, const Token::size_type)
virtual void parseChar (Token::size_type &, std::string::const_iterator &, const std::string::const_iterator, const Token::size_type)
virtual void parseString (Token::size_type &, std::string::const_iterator &, const std::string::const_iterator, const Token::size_type, const char)
virtual void parseCComment (Token::size_type &, std::string::const_iterator &, const std::string::const_iterator, const Token::size_type)
virtual void parseCxxComment (Token::size_type &, std::string::const_iterator &, const std::string::const_iterator, const Token::size_type)
virtual void try_join (Token::size_type &, std::string::const_iterator &, const std::string::const_iterator, const Token::size_type, const char)
virtual void try_join (Token::size_type &, std::string::const_iterator &, const std::string::const_iterator, const Token::size_type, const char, const char)
virtual void parseNumber (Token::size_type &, std::string::const_iterator &, const std::string::const_iterator, const Token::size_type)
 read a number
virtual void parsePreprocessorDirective (Token::size_type &, std::string::const_iterator &, const std::string::const_iterator, const std::string::const_iterator, const Token::size_type)
virtual void parseStandardLine (Token::size_type &, std::string::const_iterator &, const std::string::const_iterator, const std::string::const_iterator, const Token::size_type)
virtual void parseRawString (Token::size_type &, std::string::const_iterator &, const std::string::const_iterator, const Token::size_type, const Token::size_type)
 read the contents of a raw string literal, which starts at the current iterator, past the opening R"delim( prefix
Protected Member Functions inherited from tfel::utilities::CxxTokenizerOptions
 CxxTokenizerOptions ()
 default constructor
 CxxTokenizerOptions (const CxxTokenizerOptions &)
 copy constructor
 CxxTokenizerOptions (CxxTokenizerOptions &&) noexcept
 move constructor
CxxTokenizerOptions & operator= (const CxxTokenizerOptions &)
 standard assignement
CxxTokenizerOptions & operator= (CxxTokenizerOptions &&) noexcept
 move assignement
 ~CxxTokenizerOptions ()
 destructor

Protected Attributes

BehaviourDescription mb
 behaviour description
std::vector< std::shared_ptr< AbstractBehaviourBrick > > bricks
 registred bricks
std::set< std::string > registredKeyWords
 the list of registred keywords
std::map< std::string, std::shared_ptr< AbstractBehaviourInterface > > interfaces
 list of registred interfaces, indexed by their name
std::map< std::string, CallBack > callBacks
 list of call backs
std::map< std::string, std::vector< Hook > > hooks
 hooks assigned to callbacks
std::vector< Gradient > gradients
 list of declared gradients
std::vector< ThermodynamicForce > thermodynamic_forces
 list of declared thermodynamic forces
bool explicitlyDeclaredUsableInPurelyImplicitResolution
Protected Attributes inherited from mfront::DSLBase
FileDescription fd
 description of the file treated
TargetsDescription td
 main targets description
std::vector< std::string > ldflags
 additional linker flags
std::vector< std::string > additional_libraries_sources
 additional libraries's sources
std::vector< std::string > link_libraries
 additional link libraries
std::vector< std::string > link_directories
 additional link directories
std::vector< TargetsDescription > atds
 auxiliary target descriptions
TokensContainer::const_iterator current
 current position in the input stream
std::string currentComment
 current comment This is the user comment associated with the current keyword, if any.
std::string overriden_implementation_name
 overriden implementation name
std::string overriden_material
 overriden material
std::string overriden_author
 overriden author
std::string overriden_date
 overriden date
std::string overriden_description
 overriden description
std::string overriden_unit_system
 overriden unit system
Protected Attributes inherited from tfel::utilities::CxxTokenizer
std::vector< std::string > additional_separators
TokensContainer tokens
 list of tokens read
std::map< Token::size_type, std::string > comments
 store the comments which have been removed by the stripComments method. The key of the map is the line a comment starts on and the value is the values of the comments of this line, in the order they appear in the line, separated by a space character.
bool cStyleCommentOpened = false
 if true, a cStyle comment what opened when the last line treatment was finised
bool rawStringOpened = false
std::string currentRawStringDelimiter
 name of the current delimiter for a raw string
Protected Attributes inherited from tfel::utilities::CxxTokenizerOptions
bool bKeepCommentBoundaries = false
 if true, keep the comment boundaries
bool shallMergeStrings = false
 if true, successive strings are merged
bool allowStrayHashCharacter = false
 allow stray hash character
bool treatHashCharacterAsCommentDelimiter = false
 the hash character can start a comment, as in python, shell, etc..
bool allowStrayBackSlash = false
 allow stray backslash
bool treatPreprocessorDirectives = true
 treat preprocessor directives
bool treatStrings = true
 treat strings and characters If false, the ' and '"' are treated as indivdual tokens
bool treatNumbers = true
 extract number
bool treatCComments = true
 treat comments
bool treatCxxComments = true
 treat comments
bool joinCxxTwoCharactersSeparators = true
bool graveAccentAsSeparator = true
 strings and characters
bool charAsString = false
bool dotAsSeparator = true
 treat . as a separator
bool plusAsSeparator = true
 treat + as a separator
bool minusAsSeparator = true
 treat - as a separator
bool addCurlyBraces = false
 add curly braces at the beginning and at the end of the file

Additional Inherited Members

Static Public Attributes inherited from mfront::DSLBase
static const char *const defaultOutOfBoundsPolicyOption
 standard option name
static const char *const runtimeModificationOfTheOutOfBoundsPolicyOption
 standard option name
static const char *const parametersAsStaticVariablesOption
 standard option name
static const char *const initializationFromFileOption
 standard option name
static const char *const validatorOption
 standard option name
static const char *const buildIdentifierOption
 standard option name
static const char *const overridingParameters
 standard option
static const char *const disableRuntimeChecksOption
 standard option name
static const char *const compatibilityModeOption
 standard option name
Static Public Attributes inherited from mfront::SupportedTypes
static constexpr int ArraySizeLimit = 10u
 limit for small array support
Static Protected Member Functions inherited from mfront::DSLBase
static std::vector< std::string > getDefaultReservedNames ()
static void handleDSLOptions (MaterialKnowledgeDescription &, const DSLOptions &)
 handle DSL options
static DSLOptions buildCommonDSLOptions (const MaterialKnowledgeDescription &)
 extract common options
Static Protected Member Functions inherited from tfel::utilities::CxxTokenizer
static bool isValidFunctionIdentifier (const std::string &, const bool=true)

Detailed Description

this class provides most functionnalities used by mechanical behaviour parsers.

Constructor & Destructor Documentation

◆ BehaviourDSLCommon()

mfront::BehaviourDSLCommon::BehaviourDSLCommon ( const DSLOptions & )
explicitprotected

constructor

Parameters
[in]optsoptions passed to the DSL

Member Function Documentation

◆ addAuxiliaryStateVariables()

void mfront::BehaviourDSLCommon::addAuxiliaryStateVariables ( const VariableDescriptionContainer & )
overridevirtual

add the given auxiliary state variables

Parameters
[in]ivsauxiliary state variables

Implements mfront::AbstractBehaviourDSL.

◆ addCallBack()

virtual void mfront::BehaviourDSLCommon::addCallBack ( const std::string & ,
const CallBack ,
const bool = false )
protectedvirtual

add a new call-back associated with a keyword

Parameters
[in]kkeyword
[in]ccall-back
[in]bif true, allow the given call-back to override an existing call-back, if any.

◆ addExternalMFrontFile()

void mfront::BehaviourDSLCommon::addExternalMFrontFile ( const std::string & ,
const std::vector< std::string > & ,
const tfel::utilities::DataMap &  )
overrideprotectedvirtual

add a dependency to an external MFront file

Parameters
[in]ffile path
[in]interfaceslist of interfaces used to treat the file

Implements mfront::DSLBase.

◆ addExternalStateVariables()

void mfront::BehaviourDSLCommon::addExternalStateVariables ( const VariableDescriptionContainer & )
overridevirtual

add the given external state variables

Parameters
[in]evsexternal state variables

Implements mfront::AbstractBehaviourDSL.

◆ addIntegrationVariables()

void mfront::BehaviourDSLCommon::addIntegrationVariables ( const VariableDescriptionContainer & )
overridevirtual

add the given integration variables

Parameters
[in]lvsintegration variables

Implements mfront::AbstractBehaviourDSL.

◆ addLocalVariables()

void mfront::BehaviourDSLCommon::addLocalVariables ( const VariableDescriptionContainer & )
overridevirtual

add the given local state variables

Parameters
[in]lvslocal state variables

Implements mfront::AbstractBehaviourDSL.

◆ addMaterialLaw()

void mfront::BehaviourDSLCommon::addMaterialLaw ( const std::string & )
overrideprotectedvirtual

add a material law

Parameters
[in]m: added material law name

Implements mfront::DSLBase.

◆ addMaterialProperties()

void mfront::BehaviourDSLCommon::addMaterialProperties ( const VariableDescriptionContainer & )
overridevirtual

add the given material properties

Parameters
[in]mpsmaterial properties

Implements mfront::AbstractBehaviourDSL.

◆ addParameters()

void mfront::BehaviourDSLCommon::addParameters ( const VariableDescriptionContainer & )
overridevirtual

add the given parameters

Parameters
[in]paramsparameters

Implements mfront::AbstractBehaviourDSL.

◆ addStateVariables()

void mfront::BehaviourDSLCommon::addStateVariables ( const VariableDescriptionContainer & )
overridevirtual

add the given state variables

Parameters
[in]ivsstate variables

Implements mfront::AbstractBehaviourDSL.

◆ addStaticVariableDescription()

void mfront::BehaviourDSLCommon::addStaticVariableDescription ( const StaticVariableDescription & )
overrideprotectedvirtual

add a static variable description

Parameters
[in]v: variable description

Implements mfront::DSLBase.

◆ addVariableList()

virtual void mfront::BehaviourDSLCommon::addVariableList ( const std::set< Hypothesis > & ,
const VariableDescriptionContainer & ,
void(BehaviourDescription::*  )(const Hypothesis, const VariableDescriptionContainer &, const BehaviourData::RegistrationStatus) )
protectedvirtual

Assign a list variables to mechanical data associated with the given hypotheses.

Parameters
[out]h: modelling hypothesis on which the variables were declared
[out]v: the declared variables
[in]m: method used to assign the variables

◆ analyseFile()

void mfront::BehaviourDSLCommon::analyseFile ( const std::string & ,
const std::vector< std::string > & ,
const std::map< std::string, std::string > &  )
overridevirtual

analyse a file

Parameters
[in]f: file name
[in]ecmds: additionnal commands inserted treated before the input file commands (those commands are given through the --@?? option of the command line
[in]s: substitutions patterns inserted (those substitutions are given through command-line options such as --@YYY@=XXX)

Implements mfront::AbstractDSL.

◆ analyseString()

void mfront::BehaviourDSLCommon::analyseString ( const std::string & )
overridevirtual

analyse the specified string.

Parameters
[in]s: analysed a string

Implements mfront::AbstractDSL.

◆ appendToHypothesesList()

void mfront::BehaviourDSLCommon::appendToHypothesesList ( std::set< Hypothesis > & ,
const std::string &  ) const
protected

append the given modelling hypothesis to the set of hypothesis

Parameters
[out]h: list of hypotheses
[in]v: hypothesis to be inserted

◆ appendToIncludes()

void mfront::BehaviourDSLCommon::appendToIncludes ( const std::string & )
overrideprotectedvirtual

append the given code to the includes

Implements mfront::DSLBase.

◆ appendToMembers()

void mfront::BehaviourDSLCommon::appendToMembers ( const std::string & )
overrideprotectedvirtual

append the given code to the members

Implements mfront::DSLBase.

◆ appendToPrivateCode()

void mfront::BehaviourDSLCommon::appendToPrivateCode ( const std::string & )
overrideprotectedvirtual

append the given code to the private code

Implements mfront::DSLBase.

◆ appendToSources()

void mfront::BehaviourDSLCommon::appendToSources ( const std::string & )
overrideprotectedvirtual

append the given code to the sources

Implements mfront::DSLBase.

◆ buildDSLOptions()

DSLOptions mfront::BehaviourDSLCommon::buildDSLOptions ( ) const
overrideprotectedvirtual

Implements mfront::DSLBase.

◆ checkTangentOperatorBlock()

void mfront::BehaviourDSLCommon::checkTangentOperatorBlock ( const std::string & ,
const CodeBlock &  ) const
protected

performs common checks on a code block computing the consistent tangent operator or the tangent operator blocks

Parameters
[in]cnamename of the code block
[in]ccode block

◆ completeVariableDeclaration()

virtual void mfront::BehaviourDSLCommon::completeVariableDeclaration ( )
protectedvirtual

method called at the end of the input file processing.

Reimplemented in mfront::DefaultDSLBase, mfront::ImplicitDSLBase, mfront::IsotropicBehaviourDSLBase, and mfront::RungeKuttaDSLBase.

◆ declareExternalStateVariableProbablyUnusableInPurelyImplicitResolution()

virtual void mfront::BehaviourDSLCommon::declareExternalStateVariableProbablyUnusableInPurelyImplicitResolution ( const Hypothesis ,
const std::string &  )
protectedvirtual
Parameters
[in]h: modelling hypothesis
[in]n: variable name

◆ disableQuantitiesUsageIfNotAlreadySet()

void mfront::BehaviourDSLCommon::disableQuantitiesUsageIfNotAlreadySet ( )
overrideprotectedvirtual

disable the usage of quantities if not already set

Implements mfront::DSLBase.

◆ disableVariableDeclaration()

virtual void mfront::BehaviourDSLCommon::disableVariableDeclaration ( )
protectedvirtual

disable the declaration of new variables

Parameters
[in]h: modelling hypothesis

◆ endsInputFileProcessing()

void mfront::BehaviourDSLCommon::endsInputFileProcessing ( )
overridevirtual

◆ extractMaterialProperty()

BehaviourDescription::MaterialProperty mfront::BehaviourDSLCommon::extractMaterialProperty ( const std::string & ,
const tfel::utilities::Token &  )
protected

extract a material property from a token. If the token is a string, it is interpred as a mfront file name. Otherwise, the token is converted to a scalar.

Parameters
[in]mcalling method
[in]ttoken
Returns
a material property

◆ generateOutputFiles()

void mfront::BehaviourDSLCommon::generateOutputFiles ( )
overrideprotectedvirtual

treat the specified file.

Note
This method shall be called after the analyseFile method

Implements mfront::AbstractDSL.

◆ getBehaviourDescription() [1/2]

const BehaviourDescription & mfront::BehaviourDSLCommon::getBehaviourDescription ( ) const
finalvirtual
Returns
the behaviour description

Implements mfront::AbstractBehaviourDSL.

◆ getBehaviourDescription() [2/2]

virtual BehaviourDescription mfront::BehaviourDSLCommon::getBehaviourDescription ( const std::string & )
protectedvirtual

get a behaviour description from an mfront file

Parameters
[in]mfile
Returns
a behaviour description

◆ getBehaviourInterfaces()

std::map< std::string, std::shared_ptr< AbstractBehaviourInterface > > mfront::BehaviourDSLCommon::getBehaviourInterfaces ( ) const
overridevirtual
Returns
the declared behaviour interfaces

Implements mfront::AbstractBehaviourDSL.

◆ getClassName()

std::string mfront::BehaviourDSLCommon::getClassName ( ) const
overrideprotectedvirtual
Returns
the name of the generated class

Implements mfront::DSLBase.

◆ getDefaultModellingHypotheses()

std::set< Hypothesis > mfront::BehaviourDSLCommon::getDefaultModellingHypotheses ( ) const
overrideprotectedvirtual
Returns
the list of hypothesis a priori supported by the parser.

To enable other hypothesis or restrict the hypotheses supported, the user must use the @ModellingHypothesis or @ModellingHypotheses keywords.

Implements mfront::AbstractBehaviourDSL.

◆ getDSLOptions()

std::vector< DSLOptionDescription > mfront::BehaviourDSLCommon::getDSLOptions ( ) const
overrideprotectedvirtual
Returns
the list of options accepted by the DSL

Implements mfront::AbstractDSL.

◆ getDSLOptionsValidator()

tfel::utilities::DataMapValidator mfront::BehaviourDSLCommon::getDSLOptionsValidator ( )
static
Returns
a validator for the options passed to the DSL

◆ getIntegerConstant()

int mfront::BehaviourDSLCommon::getIntegerConstant ( const std::string & ) const
overrideprotectedvirtual
Returns
the value of an integer constant
Parameters
[in]nvariable name

Implements mfront::DSLBase.

◆ getIntegerConstants()

std::map< std::string, int > mfront::BehaviourDSLCommon::getIntegerConstants ( ) const
overrideprotectedvirtual
Returns
all the integer constants (static variables of the integer type)

Implements mfront::DSLBase.

◆ getKeywordsList()

void mfront::BehaviourDSLCommon::getKeywordsList ( std::vector< std::string > & ) const
overridevirtual

return the list of keywords usable with this parser

Parameters
[out]k: the list of keywords registred for this parser

Implements mfront::AbstractDSL.

◆ getMaterialKnowledgeDescription()

const MaterialKnowledgeDescription & mfront::BehaviourDSLCommon::getMaterialKnowledgeDescription ( ) const
overrideprotectedvirtual
Returns
the description of the considered material knowledge

Implements mfront::AbstractDSL.

◆ getMaterialKnowledgeIdentifier()

std::string mfront::BehaviourDSLCommon::getMaterialKnowledgeIdentifier ( ) const
overridevirtual
Returns
the identifier (material property name, behaviour name, model name) of the treated file

Implements mfront::AbstractDSL.

◆ getMaterialName()

std::string mfront::BehaviourDSLCommon::getMaterialName ( ) const
overridevirtual
Returns
the material described by the treated file

Implements mfront::AbstractDSL.

◆ getModelDescription()

virtual ModelDescription mfront::BehaviourDSLCommon::getModelDescription ( const std::string & )
protectedvirtual

get a model description from an mfront file

Parameters
[in]mfile
Returns
a model description
Note
the class name associated with the model is automatically reserved.

◆ getOverridableVariableNameByExternalName()

std::string mfront::BehaviourDSLCommon::getOverridableVariableNameByExternalName ( const std::string & ) const
overridevirtual
Returns
the variable name associated with the given external name
Parameters
[in]nexternal name of the quantity overridable by a parameter

Depending on the DSL's, a parameter may override a parameter, but also a material property for example.

Implements mfront::AbstractDSL.

◆ getOverridenParameters()

std::map< std::string, double > mfront::BehaviourDSLCommon::getOverridenParameters ( ) const
overridevirtual
Returns
the list of overriden parameters

Implements mfront::AbstractDSL.

◆ getSymbols()

virtual void mfront::BehaviourDSLCommon::getSymbols ( std::map< std::string, std::string > & ,
const Hypothesis ,
const std::string &  )
protectedvirtual

get all symbols required to interpret the given code block.

Parameters
[out]symbolssymbols
[in]hmodelling hypothesis
[in]nname of the code block

Reimplemented in mfront::DefaultDSLBase, mfront::ImplicitDSLBase, mfront::IsotropicBehaviourDSLBase, mfront::MultipleIsotropicMisesFlowsDSL, and mfront::RungeKuttaDSLBase.

◆ handleMaterialPropertyDescription()

std::shared_ptr< MaterialPropertyDescription > mfront::BehaviourDSLCommon::handleMaterialPropertyDescription ( const std::string & )
overridevirtual

This function handles a material property treated as a dependency of the current file.

This function:

  • analyse the given file using the MaterialPropertyDSL
  • register the function name generated by the MFront interface
  • add the function name to the list of material laws used by the current file
  • declared the headers generated by the MFront interface for inclusion
  • launch mfront in a sub-process to generate the source files associated with this material property and have them compiled when mandatory (done by the callMFront method).
Parameters
[in]f: file in which the material law is implemented. This must be the full path.

Implements mfront::AbstractBehaviourDSL.

◆ importFile()

void mfront::BehaviourDSLCommon::importFile ( const std::string & ,
const std::vector< std::string > & ,
const std::map< std::string, std::string > &  )
overridevirtual

import a file

Parameters
[in]f: file name
[in]ecmds: additionnal commands inserted treated before the input file commands
[in]s: substitutions patterns inserted (those substitutions are given through command-line options such as --@YYY@=XXX)

Implements mfront::AbstractDSL.

◆ isCallableVariable()

virtual bool mfront::BehaviourDSLCommon::isCallableVariable ( const Hypothesis ,
const std::string &  ) const
protectedvirtual
Returns
true if the the given variable may have methods
Parameters
[in]h: modelling hypothesis
[in]n: name

Reimplemented in mfront::ImplicitDSLBase.

◆ isModellingHypothesisSupported()

bool mfront::BehaviourDSLCommon::isModellingHypothesisSupported ( const Hypothesis ) const
overrideprotectedvirtual
Returns
true if the given modelling hypothesis is handled by the parser

Some parsers have restrictions on the modelling hypotheses supported. For example, the isotropic behaviours were not able to handle plane stress hypotheses when this comment was written(but it was planned, so this comment may be outdated now).

The fact that this method returns true means that the user can provide code to support this modelling hypothesis. For example, to support plane stress in RungeKutta and Implicit parsers, the user must provide some hand-crafted code. He must enable this modelling hypothesis by calling explicitely @ModellingHypothesis or @ModellingHypotheses keywords.

Implements mfront::AbstractBehaviourDSL.

◆ isNameReserved()

bool mfront::BehaviourDSLCommon::isNameReserved ( const std::string & ) const
overrideprotectedvirtual

look if a name is reserved

Parameters
[in]n: name

Implements mfront::DSLBase.

◆ makeConsistencyChecks()

void mfront::BehaviourDSLCommon::makeConsistencyChecks ( ) const
overridevirtual

method called after processing the input file processing.

Note
This method shall be called after the endsInputFileProcessing.

Implements mfront::AbstractDSL.

Reimplemented in mfront::ImplicitDSLBase.

◆ overrideByAParameter()

void mfront::BehaviourDSLCommon::overrideByAParameter ( const std::string & ,
const double  )
overridevirtual

specify that the given variable must be overriden by a parameter.

Parameters
[in]nvariable name
[in]vvariable value

Implements mfront::DSLBase.

◆ readBehaviourVariableDescription()

virtual BehaviourVariableDescription mfront::BehaviourDSLCommon::readBehaviourVariableDescription ( const std::string & ,
const tfel::utilities::Token::size_type ,
const std::optional< std::string > & = {} )
protectedvirtual

read the description of a behaviour variable

Parameters
[in]bnamename of the behaviour variable
[in]lineNumberline number
[in]fileNamefile containing the implementation of the behaviour
[in]allow_external_state_variables_evaluation_using_persistent_variablesboolean stating if using persistent variables to evaluate external state variables.

◆ readCodeBlockOptions()

virtual void mfront::BehaviourDSLCommon::readCodeBlockOptions ( CodeBlockOptions & ,
const bool  )
protectedvirtual
Parameters
[out]o: options to be read
[in]s: allow specialisation

◆ readHypothesesList() [1/2]

virtual std::set< Hypothesis > mfront::BehaviourDSLCommon::readHypothesesList ( )
protectedvirtual
Returns
a list of hypotheses
Note
by default, the returning set contains UNDEFINEDHYPOTHESIS

◆ readHypothesesList() [2/2]

virtual void mfront::BehaviourDSLCommon::readHypothesesList ( std::set< Hypothesis > & )
protectedvirtual

read a list of hypotheses

Parameters
[out]h: list of hypotheses
Note
by default, the returning set contains UNDEFINEDHYPOTHESIS

◆ readMaterialPropertyOrArrayOfMaterialProperties()

virtual std::vector< BehaviourDescription::MaterialProperty > mfront::BehaviourDSLCommon::readMaterialPropertyOrArrayOfMaterialProperties ( const std::string & m)
protectedvirtual

read an an array of material properties. String are interpreted as mfront file name. Other tokens are interpreted as long double.

Parameters
[in]mcalling method
Returns
the array of material properties

◆ readNextBlock() [1/4]

parse the next code block twice.

Parameters
[out]res1: resulting code block with the first option set.
[out]res2: resulting code block with the second option set.
[in]o1: first option set.
[in]o2: second option set.

◆ readNextBlock() [2/4]

Returns
the code block read.
Parameters
[in]o: options

◆ readNextBlock() [3/4]

CodeBlock mfront::BehaviourDSLCommon::readNextBlock ( const Hypothesis ,
const std::string & ,
std::function< std::string(const Hypothesis, const std::string &, const bool)> ,
const bool  )
protected

read the next code block for the given hypothesis

Parameters
[in]hhypothesis
[in]nname of the method read
[in]mmodifier
[in]badd "this->" in front of variables

◆ readNextBlock() [4/4]

CodeBlock mfront::BehaviourDSLCommon::readNextBlock ( const Hypothesis ,
const std::string & ,
std::function< std::string(const Hypothesis, const std::string &, const bool)> ,
std::function< void(CodeBlock &, const Hypothesis, const std::string &)> ,
const bool  )
protected

read the next code block for the given hypothesis

Parameters
[in]hhypothesis
[in]nname of the method read
[in]mmodifier
[in]aword analyser
[in]badd "this->" in front of variables

◆ readStressFreeExpansionHandler() [1/2]

virtual std::vector< BehaviourData::StressFreeExpansionHandler > mfront::BehaviourDSLCommon::readStressFreeExpansionHandler ( )
protectedvirtual

read a swelling description.

An array is expected at the current point of the file. Each token of the array is analysed throw the readStressFreeExpansionHandler method.

◆ readStressFreeExpansionHandler() [2/2]

virtual BehaviourData::StressFreeExpansionHandler mfront::BehaviourDSLCommon::readStressFreeExpansionHandler ( const tfel::utilities::Token & )
protectedvirtual

extract a swelling description from a token

Parameters
[in]ttreated token
  • if the token is a string, a mfront file is treated.
  • if the token is not a string, one expects an external state variable name

◆ readTangentOperatorCodeBlock()

virtual void mfront::BehaviourDSLCommon::readTangentOperatorCodeBlock ( const CodeBlockOptions & ,
const std::string &  )
protectedvirtual

read a code block describing the computation of one of the tangent operator

Parameters
[in]ocode block options
[in]nname of the code block

Reimplemented in mfront::ImplicitDSLBase.

◆ readVariableList()

virtual void mfront::BehaviourDSLCommon::readVariableList ( VariableDescriptionContainer & ,
std::set< Hypothesis > & ,
void(BehaviourDescription::*  )(const Hypothesis, const VariableDescriptionContainer &, const BehaviourData::RegistrationStatus),
const bool  )
protectedvirtual

First read a set of Hypothesis. Then read a list variables and assign them to mechanical data associated with those hypotheses.

Parameters
[out]v: the declared variables
[out]h: modelling hypothesis on which the variables were declared
[in]m: method used to assign the variables
[in]b1: allows variables to be declared as array

◆ reserveName()

void mfront::BehaviourDSLCommon::reserveName ( const std::string & )
finalprotectedvirtual

register a name.

Parameters
[in]n: name

Implements mfront::DSLBase.

◆ setComputeFinalThermodynamicForcesFromComputeFinalThermodynamicForcesCandidateIfNecessary()

virtual void mfront::BehaviourDSLCommon::setComputeFinalThermodynamicForcesFromComputeFinalThermodynamicForcesCandidateIfNecessary ( )
protectedvirtual

if the compte final thermodynamic forces code is not available, create it from the ComputeFinalThermodynamicForcesCandidate code if it is available.

Note
This method is not trivial because one has to take care not to create artifical mechanical data specialisation
This method is meant to be used in the endsInputFileProcessing method.

◆ setInterfaces()

void mfront::BehaviourDSLCommon::setInterfaces ( const std::set< std::string > & )
overrideprotectedvirtual

set list of interfaces

Parameters
[in]inames: list of interfaces

Implements mfront::AbstractDSL.

◆ setMaterial()

void mfront::BehaviourDSLCommon::setMaterial ( const std::string & )
overrideprotectedvirtual

set the material described by the implementation

Parameters
[in]mmaterial name

Implements mfront::DSLBase.

◆ setMaterialKnowledgeIdentifier()

void mfront::BehaviourDSLCommon::setMaterialKnowledgeIdentifier ( const std::string & )
overrideprotectedvirtual

set the name of the implementation, i.e. the material property' name, the behaviour' name or the model' name.

Parameters
[in]iimplementation name

Implements mfront::DSLBase.

◆ setMinimalTangentOperator()

virtual void mfront::BehaviourDSLCommon::setMinimalTangentOperator ( )
protectedvirtual

if no tangent operator was provided, but that the behaviour requires a stiffness matrix, this method creates a minimal tangent operator for elasticity.

Note
This method is not trivial because one has to take care not to create artifical mechanical data specialisation
This method is meant to be used in the endsInputFileProcessing method.

◆ setUnitSystem()

void mfront::BehaviourDSLCommon::setUnitSystem ( const std::string_view )
overrideprotectedvirtual

set the unit system

Parameters
[in]sunit system

Implements mfront::DSLBase.

◆ standardModifier()

virtual std::string mfront::BehaviourDSLCommon::standardModifier ( const Hypothesis ,
const std::string & ,
const bool  )
protectedvirtual

the standard variable modifier

Parameters
[in]h: modelling hypothesis
[in]v: variable name
[in]b: if true, shall add the "this" qualifier

◆ treatCodeBlock() [1/6]

void mfront::BehaviourDSLCommon::treatCodeBlock ( const CodeBlockOptions & ,
const std::string & ,
const std::string & ,
std::function< std::string(const Hypothesis, const std::string &, const bool)> ,
std::function< std::string(const Hypothesis, const std::string &, const bool)> ,
const bool  )
protected

read the next code block and adds it tho the mechanical behaviour

Parameters
[in]n1: name of the first method read
[in]n2: name of the second method read
[in]m1: modifier
[in]m2: modifier
[in]b: add "this->" in front of variables

◆ treatCodeBlock() [2/6]

void mfront::BehaviourDSLCommon::treatCodeBlock ( const CodeBlockOptions & ,
const std::string & ,
std::function< std::string(const Hypothesis, const std::string &, const bool)> ,
const bool  )
protected

read the next code block and adds it tho the mechanical behaviour

Parameters
[in]o: options
[in]n: name of the method read
[in]m: modifier
[in]b: add "this->" in front of variables

◆ treatCodeBlock() [3/6]

void mfront::BehaviourDSLCommon::treatCodeBlock ( const CodeBlockOptions & ,
const std::string & ,
std::function< std::string(const Hypothesis, const std::string &, const bool)> ,
std::function< void(CodeBlock &, const Hypothesis, const std::string &)> ,
const bool  )
protected

read the next code block and adds it tho the mechanical behaviour

Parameters
[in]o: options
[in]n: name of the method read
[in]m: modifier
[in]a: word analyser
[in]b: add "this->" in front of variables

◆ treatCodeBlock() [4/6]

CodeBlockOptions mfront::BehaviourDSLCommon::treatCodeBlock ( const std::string & ,
const std::string & ,
std::function< std::string(const Hypothesis, const std::string &, const bool)> ,
std::function< std::string(const Hypothesis, const std::string &, const bool)> ,
const bool ,
const bool  )
protected

read the next code block and adds it tho the mechanical behaviour

Parameters
[in]n1: name of the first method read
[in]n2: name of the second method read
[in]m1: modifier
[in]m2: modifier
[in]b: add "this->" in front of variables
[in]s: allow specialisation

◆ treatCodeBlock() [5/6]

CodeBlockOptions mfront::BehaviourDSLCommon::treatCodeBlock ( const std::string & ,
std::function< std::string(const Hypothesis, const std::string &, const bool)> ,
const bool ,
const bool  )
protected

read the next code block and adds it tho the mechanical behaviour

Parameters
[in]n: name of the method read
[in]m: modifier
[in]b: add "this->" in front of variables
[in]s: allow specialisation

◆ treatCodeBlock() [6/6]

CodeBlockOptions mfront::BehaviourDSLCommon::treatCodeBlock ( const std::string & ,
std::function< std::string(const Hypothesis, const std::string &, const bool)> ,
std::function< void(CodeBlock &, const Hypothesis, const std::string &)> ,
const bool ,
const bool  )
protected

read the next code block and adds it tho the mechanical behaviour

Parameters
[in]n: name of the method read
[in]m: modifier
[in]a: word analyser
[in]b: add "this->" in front of variables
[in]s: allow specialisation

◆ treatExternalStateVariable()

virtual void mfront::BehaviourDSLCommon::treatExternalStateVariable ( )
protectedvirtual

handle the @ExternalStateVariable keyword

Reimplemented in mfront::IsotropicBehaviourDSLBase.

◆ treatIntegrator()

virtual void mfront::BehaviourDSLCommon::treatIntegrator ( )
protectedvirtual

treat the @Integrator keyword

Reimplemented in mfront::ImplicitDSLBase.

◆ treatMembers()

void mfront::BehaviourDSLCommon::treatMembers ( )
overrideprotectedvirtual

treat the @Members keyword

Reimplemented from mfront::DSLBase.

◆ treatModel()

void mfront::BehaviourDSLCommon::treatModel ( const std::string & ,
void(BehaviourDescription::*  )(const ModelDescription &),
void(BehaviourDescription::*  )(const BehaviourVariableDescription &) )
protected

common implementation used by the treatModel and treatAuxiliaryModel methods

Parameters
[in]methodcalling method name
[in]m1method called if a model is read
[in]m2method called if a behaviour is read

◆ treatModel2()

virtual void mfront::BehaviourDSLCommon::treatModel2 ( )
protectedvirtual

alternative treatment of the @Model keyword

This alternative treatment is meant to be used by simple point-wise models.

◆ treatParameterMethod()

virtual void mfront::BehaviourDSLCommon::treatParameterMethod ( const Hypothesis )
protectedvirtual

treat methods associated with a parameter

Parameters
[in]h: modelling hypothesis

◆ treatPrivate()

void mfront::BehaviourDSLCommon::treatPrivate ( )
overrideprotectedvirtual

treat the @Private keyword

Reimplemented from mfront::DSLBase.

◆ treatStateVariable()

virtual void mfront::BehaviourDSLCommon::treatStateVariable ( )
protectedvirtual

handle the @StateVariable keyword

Reimplemented in mfront::ImplicitDSLBase.

◆ treatTangentOperator()

virtual void mfront::BehaviourDSLCommon::treatTangentOperator ( )
protectedvirtual

treat the @TangentOperator keyword

Note
this method read the code block options and determines which tangent operator is computed (for finite strain behaviours) and then calls the readTangentOperatorCodeBlock method

◆ treatUnknownKeyword()

void mfront::BehaviourDSLCommon::treatUnknownKeyword ( )
overrideprotectedvirtual

method called when an unknown keyword is parsed

Reimplemented from mfront::DSLBase.

Reimplemented in mfront::ImplicitDSLBase.

◆ treatUnknownVariableMethod()

virtual void mfront::BehaviourDSLCommon::treatUnknownVariableMethod ( const Hypothesis ,
const std::string &  )
protectedvirtual
Parameters
[in]h: modelling hypothesis
[in]n: variable name

Reimplemented in mfront::ImplicitDSLBase, and mfront::RungeKuttaDSLBase.

◆ treatUpdateAuxiliaryStateVariables()

virtual void mfront::BehaviourDSLCommon::treatUpdateAuxiliaryStateVariables ( )
protectedvirtual

treat the @UpdateAuxiliaryStateVariables keyword

Reimplemented in mfront::RungeKuttaDSLBase.

◆ treatVariableMethod()

virtual void mfront::BehaviourDSLCommon::treatVariableMethod ( const Hypothesis )
protectedvirtual

treat a method

Parameters
[in]h: modelling hypothesis

◆ useQt()

bool mfront::BehaviourDSLCommon::useQt ( ) const
overrideprotectedvirtual
Returns
if the usage of quantities is alllowed

Implements mfront::DSLBase.

◆ writeMaterialPropertyEvaluation()

void mfront::BehaviourDSLCommon::writeMaterialPropertyEvaluation ( std::ostream & ,
const BehaviourDescription::MaterialProperty & ,
std::function< std::string(const MaterialPropertyInput &)> &  ) const
overrideprotectedvirtual

write the call to a material property

Parameters
[out]outoutput stream
[in]mmaterial property description
[in]ffunction converting input variable name. The function f can be used to specify how evaluate a variable value. For example, if we want to evaluate the variable name 'V' at the end of the time step, we could make f return V+dV

Implements mfront::AbstractBehaviourDSL.


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