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

a base class for material properties' interfaces such as the cyrano and generic interfaces. More...

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

Inheritance diagram for mfront::GenericMaterialPropertyInterfaceBase:
mfront::AbstractMaterialPropertyInterface mfront::CyranoMaterialPropertyInterface mfront::GenericMaterialPropertyInterface mfront::GenericParallelMaterialPropertyInterface

Classes

struct  BoundCheck
 description of the check of a bound of a variable, in the code evaluating a material property at a point More...
struct  PointEvaluationOptions
 options of the code evaluating a material property at a point More...
struct  TypesDescription
 types used by the generated functions More...
struct  PointwiseFunctionDescription
 names and types of the function evaluating a material property at a point, given explicitly so that a derived interface can write the function of the generic interface More...

Public Member Functions

 GenericMaterialPropertyInterfaceBase ()
 default constructor
virtual void getLibraryDescription (TargetsDescription &d, LibraryDescription &, const MaterialPropertyDescription &) const
 append the generated material property to the given library description. This method allows to choose to which library is attached the material property (which is not the case of the getTargetsDescription method).
virtual std::string getFunctionName (const MaterialPropertyDescription &) const
void setOptions (const DataMap &) override
 give options to the interface
void getTargetsDescription (TargetsDescription &, const MaterialPropertyDescription &) const override
 : fill the target descripton
std::pair< bool, tokens_iterator > treatKeyword (const std::string &, const std::vector< std::string > &, tokens_iterator, const tokens_iterator) override
void writeOutputFiles (const MaterialPropertyDescription &, const FileDescription &) const override
 generate the output files
 ~GenericMaterialPropertyInterfaceBase () override
 destructor
Public Member Functions inherited from mfront::AbstractMaterialPropertyInterface
virtual ~AbstractMaterialPropertyInterface ()
 destructor

Static Public Member Functions

static void writePointEvaluation (std::ostream &, const MaterialPropertyDescription &, const PointEvaluationOptions &)
 write the code evaluating a material property at a point, shared by the generic, cyrano and generic-parallel interfaces: physical bounds of the inputs, bounds of the inputs, body of the material property, physical bounds and bounds of the output. The variables are checked in the order of the inputs, the output being the last one. The physical bounds always make the evaluation fail. The bounds make it fail with the strict policy, and are reported with the warning policy: as with the generic interface, an unknown policy is treated as the None policy. The checks are disabled by the given macro, or not written if the runtime checks are disabled. The variables (inputs, parameters, output) and the out of bounds policy (mfront_out_of_bounds_policy) must be declared by the caller.
static std::size_t getPhysicalBoundCheck (const std::size_t, const bool)
static std::size_t getBoundCheck (const MaterialPropertyDescription &, const std::size_t, const bool)

Static Public Attributes

static constexpr std::size_t invalid_result_check = 0
 identifier of the check of the finiteness of the result

Protected Member Functions

virtual TypesDescription getTypesDescription () const =0
virtual std::vector< std::string > getInterfaceHeaderFiles () const =0
virtual std::string getInterfaceName () const =0
virtual std::string getInterfaceNameInCamelCase () const =0
virtual std::string getInterfaceNameInUpperCase () const =0
virtual std::string getOutOfBoundsPolicyEnumerationPrefix () const =0
virtual std::string getHeaderFileName (const std::string &) const
virtual std::string getSourceFileName (const std::string &) const
virtual void writeHeaderFile (const MaterialPropertyDescription &, const FileDescription &) const
 generate the output files
virtual void writeSrcFile (const MaterialPropertyDescription &, const FileDescription &) const
 generate the output files

Static Protected Member Functions

static void writePointwiseFunction (std::ostream &, const MaterialPropertyDescription &, const FileDescription &, const std::string &, const PointwiseFunctionDescription &)
 write the function evaluating a material property at a point, with the conventions of the generic interface (try block, errno, statuses -2 to -6). The parameters handler and the header declaring the function must have been written.

Additional Inherited Members

Public Types inherited from mfront::AbstractMaterialPropertyInterface
using DataMap = tfel::utilities::DataMap
 a simple alias
using tokens_iterator
 a simple alias

Detailed Description

a base class for material properties' interfaces such as the cyrano and generic interfaces.

Member Function Documentation

◆ getBoundCheck()

std::size_t mfront::GenericMaterialPropertyInterfaceBase::getBoundCheck ( const MaterialPropertyDescription & ,
const std::size_t ,
const bool  )
staticnodiscard
Returns
the identifier of the check of a bound
Parameters
[in]mpdmaterial property description
[in]iindex of the variable (the output is after the inputs)
[in]uppertrue for the upper bound

◆ getFunctionName()

virtual std::string mfront::GenericMaterialPropertyInterfaceBase::getFunctionName ( const MaterialPropertyDescription & ) const
nodiscardvirtual
Returns
the name of the generated function
Parameters
[in]mpd: material property description

Reimplemented in mfront::GenericParallelMaterialPropertyInterface.

◆ getHeaderFileName()

virtual std::string mfront::GenericMaterialPropertyInterfaceBase::getHeaderFileName ( const std::string & ) const
nodiscardprotectedvirtual
Returns
the name of the header file

Reimplemented in mfront::GenericParallelMaterialPropertyInterface.

◆ getLibraryDescription()

virtual void mfront::GenericMaterialPropertyInterfaceBase::getLibraryDescription ( TargetsDescription & d,
LibraryDescription & ,
const MaterialPropertyDescription &  ) const
virtual

append the generated material property to the given library description. This method allows to choose to which library is attached the material property (which is not the case of the getTargetsDescription method).

Parameters
[in]dtargets description
[in]llibrary description
[in]mpdmaterial property description

Reimplemented in mfront::GenericParallelMaterialPropertyInterface.

◆ getPhysicalBoundCheck()

std::size_t mfront::GenericMaterialPropertyInterfaceBase::getPhysicalBoundCheck ( const std::size_t ,
const bool  )
staticnodiscard
Returns
the identifier of the check of a physical bound
Parameters
[in]iindex of the variable (the output is after the inputs)
[in]uppertrue for the upper bound

◆ getSourceFileName()

virtual std::string mfront::GenericMaterialPropertyInterfaceBase::getSourceFileName ( const std::string & ) const
nodiscardprotectedvirtual
Returns
the name of the source file

Reimplemented in mfront::GenericParallelMaterialPropertyInterface.

◆ getTargetsDescription()

void mfront::GenericMaterialPropertyInterfaceBase::getTargetsDescription ( TargetsDescription & ,
const MaterialPropertyDescription &  ) const
overridevirtual

: fill the target descripton

Parameters
[out]dtarget description
[in]mpdmaterial property description

Implements mfront::AbstractMaterialPropertyInterface.

Reimplemented in mfront::GenericParallelMaterialPropertyInterface.

◆ setOptions()

void mfront::GenericMaterialPropertyInterfaceBase::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::AbstractMaterialPropertyInterface.

Reimplemented in mfront::GenericParallelMaterialPropertyInterface.

◆ treatKeyword()

std::pair< bool, tokens_iterator > mfront::GenericMaterialPropertyInterfaceBase::treatKeyword ( const std::string & ,
const std::vector< std::string > & ,
tokens_iterator ,
const tokens_iterator  )
nodiscardoverridevirtual
Parameters
[in]k: keyword to be treated
[in]ilist of interfaces to which the keyword is restricted
[in]p: iterator to the current token
[in]pe: iterator 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::AbstractMaterialPropertyInterface.

Reimplemented in mfront::GenericParallelMaterialPropertyInterface.

◆ writeHeaderFile()

virtual void mfront::GenericMaterialPropertyInterfaceBase::writeHeaderFile ( const MaterialPropertyDescription & ,
const FileDescription &  ) const
protectedvirtual

generate the output files

Parameters
[in]mpdmaterial property description
[in]fdmfront file description

Reimplemented in mfront::GenericParallelMaterialPropertyInterface.

◆ writeOutputFiles()

void mfront::GenericMaterialPropertyInterfaceBase::writeOutputFiles ( const MaterialPropertyDescription & ,
const FileDescription &  ) const
overridevirtual

generate the output files

Parameters
[in]mpdmaterial property description
[in]fdmfront file description

Implements mfront::AbstractMaterialPropertyInterface.

Reimplemented in mfront::GenericParallelMaterialPropertyInterface.

◆ writePointEvaluation()

void mfront::GenericMaterialPropertyInterfaceBase::writePointEvaluation ( std::ostream & ,
const MaterialPropertyDescription & ,
const PointEvaluationOptions &  )
static

write the code evaluating a material property at a point, shared by the generic, cyrano and generic-parallel interfaces: physical bounds of the inputs, bounds of the inputs, body of the material property, physical bounds and bounds of the output. The variables are checked in the order of the inputs, the output being the last one. The physical bounds always make the evaluation fail. The bounds make it fail with the strict policy, and are reported with the warning policy: as with the generic interface, an unknown policy is treated as the None policy. The checks are disabled by the given macro, or not written if the runtime checks are disabled. The variables (inputs, parameters, output) and the out of bounds policy (mfront_out_of_bounds_policy) must be declared by the caller.

Parameters
[out]osoutput stream
[in]mpdmaterial property description
[in]optsoptions

◆ writePointwiseFunction()

void mfront::GenericMaterialPropertyInterfaceBase::writePointwiseFunction ( std::ostream & ,
const MaterialPropertyDescription & ,
const FileDescription & ,
const std::string & ,
const PointwiseFunctionDescription &  )
staticprotected

write the function evaluating a material property at a point, with the conventions of the generic interface (try block, errno, statuses -2 to -6). The parameters handler and the header declaring the function must have been written.

Parameters
[out]osoutput stream
[in]mpdmaterial property description
[in]fdfile description
[in]namename of the function
[in]dnames and types

◆ writeSrcFile()

virtual void mfront::GenericMaterialPropertyInterfaceBase::writeSrcFile ( const MaterialPropertyDescription & ,
const FileDescription &  ) const
protectedvirtual

generate the output files

Parameters
[in]mpdmaterial property description
[in]fdmfront file description

Reimplemented in mfront::GenericParallelMaterialPropertyInterface.


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