Model
keywords;
keyword@Author
keyword@Bounds
keyword@Coef
keyword@ConstantMaterialProperty
keyword@DSL
keyword@Date
keyword@Description
keyword@Domain
keyword@Domains
keyword@ExternalStateVariable
keyword@Function
keyword@Import
keyword@Includes
keyword@Input
keyword@LocalParameter
keyword@Material
keyword@MaterialLaw
keyword@MaterialProperty
keyword@Model
keyword@Output
keyword@Parameter
keyword@Parser
keyword@PhysicalBounds
keyword@StateVariable
keyword@StaticVar
keyword@StaticVariable
keyword@UnitSystem
keyword@UseQt
keyword;
keywordThe keyword ;
is not documented yet
@Author
keywordThe @Author
keyword is used to give the name of the
person who wrote the mfront
file.
All the following words are appended to the author’s name up to a final semi-colon.
Note: The name of the person who formulated the material property,
behaviour or model shall be given in the description section (see the
@Description
keyword).
@Author Éric Brunon;
@Bounds
keywordThe @Bounds
keyword let the user define the domain of
validity of the law.
The @Bounds
keyword is followed by a variable name, the
keyword in and an interval. The interval may contain the infinity,
represented by the ’*’ character.
What happens if a variable if found to be out of its bounds depends on the interface used. Most interfaces let the user choose one of three following policies:
None
, which means that nothing is done.Warning
, which means that a message is displayed, but
computations are not stopped.Strict
, which means that computations are stopped with
an error message.@Bounds T in [293.15:873.15];
@Coef
keywordThe @Coef
keyword is a deprecated synonymous of
@MaterialProperty
.
@ConstantMaterialProperty
keywordThe @ConstantMaterialPropery
let the user define a
specific kind of input to a model which is meant to be constant and
uniform during the computations. This allows the interfaces to optimize
the generated code. This keyword is followed by the names of the
material properties. Those names must be valid C++
identifiers.
The following characters are legal as the first character of an identifier, or any subsequent character:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
The following characters are legal as any character in an identifier except the first:
0
1
2
3
4
5
6
7
8
9
It is recommended to associate to a constant material property a
glossary or an entry name through the methods
setGlossaryName
or setEntryName
respectively.
@ConstantMaterialProperty E;
.setEntryName("EnergyReleasedByFission"); E
@DSL
keywordThe @DSL
keyword specify the domain specific language
(dsl) used.
The list of available dsl’s is returned by the
--list-dsl
option of mfront
:
$ mfront --list-dsl
As the time of writting this notice, the following dsl’s are available:
DefaultDSL
: this parser is the most generic one as it
does not make any restriction on the behaviour or the integration method
that may be used.DefaultCZMDSL
: this parser is the most generic one as
it does not make any restriction on the behaviour or the integration
method that may be used.DefaultFiniteStrainDSL
: this parser is the most generic
one as it does not make any restriction on the behaviour or the
integration method that may be used.Implicit
: this parser provides a generic integrator
based on an implicit scheme. The elastic strain is automatically defined
as a state variableImplicitII
: this parser provides a generic integrator
based on a theta method. Unlike Implicit
, the elastic
strain is not automatically defined as a state variable.ImplicitFiniteStrain
: this parser provides a generic
integrator based on a theta method..IsotropicMisesCreep
: this parser is used for standard
creep behaviours of the form \(\dot{p}=f(s)\) where \(p\) is the equivalent creep strain and
\(s\) the equivalent mises stress.IsotropicPlasticMisesFlow
: this parser is used for
standard plastics behaviours with yield surface of the form \(f(s,p)=0\) where \(p\) is the equivalent creep strain and
\(s\) the equivalent mises stress.IsotropicStrainHardeningMisesCreep
: this parser is used
for standard strain hardening creep behaviours of the form \(\dot{p}=f(s,p)\) where \(p\) is the equivalent creep strain and
\(s\) the equivalent mises stress.MaterialLaw
: this parser is used to define material
properties.Model
: this parser is used to define simple material
models.MultipleIsotropicMisesFlows
: this parser is used to
define behaviours combining several isotropic flows. Supported flow type
are ‘Creep’ (\(\dot{p}=f(s)\))
‘StrainHardeningCreep’ (\(\dot{p}=f(s,p)\)) and ‘Plasticity’ (\(f(p,s)=0\)) where \(p\) is the equivalent plastic strain and
\(s\) the equivalent mises stress.RungeKutta
: this parser provides a generic integrator
based on one of the many Runge-Kutta algorithm.A DSL’ behaviour may be changed using options defined either in the
MFront
file using a JSON-like syntax or as a command line
argument.
The options related to a specific DSL
can be retrieved
using the --list-dsl-options
command line argument, as
follows:
$ mfront --list-dsl-options=Model
- parameters_as_static_variables: boolean stating if the parameter shall be treated as static variables.
- build_identifier : string specifying a build identifier. This option shall only be specified on the command line.
DSL
options in the MFront fileOptions can be passed to a DSL as follows:
@DSL Default{
: true
parameters_as_static_variables };
DSL
options on the command line:MFront
have various command line arguments to define
options passed to DSLs:
--dsl-option
, which allows to define options passed to
domain specific languages.--behaviour-dsl-option
, which allows to define options
passed to domain specific languages related to behaviours.--material-property-dsl-option
, which allows to define
options passed to domain specific languages related to material
properties.--model-dsl-option
, which allows to define options
passed to domain specific languages related to models.For example, the --dsl-option
can be used as
follows:
$ mfront --obuild --interface=cyrano --dsl-option=build_identifier:\"Cyrano-3.2\" Elasticity.mfront
This example illustrates that special care must be taken when defining an option expecting a string value.
The following options are available for all DSLs:
build_identifier
(string), which must be associated to
a string value. However, the build_identifier
is not meant
to be directly specified in the MFront
source file. It
shall rather be defined on the command line.parameters_as_static_variables
(boolean), which states
if parameters shall be treated as static variables.parameters_initialization_from_file
(boolean), which
states if parameters can be modified from a external state file. This
feature is only implemented by a few interfaces and is enabled by
default.default_out_of_bounds_policy
(string), which selects
the default out of bounds policy. Allowed values ar None
(the default), Warning
or Strict
.out_of_bounds_policy_runtime_modification
(boolean),
which states if the out of bounds policy can be changed at runtime. By
default, this option is true
.automatic_declaration_of_the_temperature_as_first_external_state_variable
(boolean), which states if the temperature shall be automatically
declared as an external state variable.overriding_parameters
, which allows to specify
overriding parameters. This parameters must be a map associating
variables names and default values of the overriding parameters.@DSL Implicit;
@Date
keywordThe @Date
keyword allows the user to precise when the
mfront file was written.
All the following words are appended to the date up to a final semi-colon.
@Date 2008-11-17;
@Description
keywordThe @Description
describes the material property,
behaviour or model which is implemented in a mfront file.
This keyword is followed by a block containing all the relevant piece of information including:
@Description
{
-4Cr-4Ti.
Corrélation établie sur la nuance V
:
Propriétés extraites du document
Propriétés et comportement mécanique d alliages, après et sous irradiation
de Vanadium avant
, Jean-Luc Bechade, Annick Bougault,
Marion Le Flem, Lionel Gosmain, Jean-Louis Seran
Aurore Michaux/SRMA/LA2M/NT/2008-2967/A
DMN}
@Domain
keywordThe @Domain
let the user define the default domain on
which a model shall be applied. This keyword is followed by the name of
the domain.
This keyword is deprecated as domains shall be explicitely specified by specialisation.
@Domain "Fuel";
@Domains
keywordThe @Domains
let the user define the default domains on
which a model shall be applied. This keyword is followed by an array of
strings.
This keyword is deprecated as domains shall be explicitely specified by specialisation.
@Domains {"MATRIX","CLADDING"};
@ExternalStateVariable
keywordThe ExternalStateVariable
keyword introduces one or
several new external state variables. It is followed by a type name and
the name(s) of the variable(s) declared, separated by commas.
The external state variables names must be valid C++
identifiers.
The following characters are legal as the first character of an identifier, or any subsequent character:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
The following characters are legal as any character in an identifier except the first:
0
1
2
3
4
5
6
7
8
9
One may declare an array of external state variables by specifying the array size after the external state variable name.
It is recommended to associate to a external state variable a
glossary or an entry name through the methods
setGlossaryName
or setEntryName
respectively.
// scalar external state variable
@ExternalStateVariable strain s;
@Function
keywordThe @Function
keyword defines a computational part of
the model. This keyword is followed by a string defining the name of
this part of the computation.
@Function compute
{
const real coef1 = 8.e-3;
const real coef2 = 4.e-2;
const real p_ = 0.5*(p+p_1);
= s_1 + coef1*exp(coef2-p_)*(Bu-Bu_1);
s } // end of function compute
@Import
keywordThe @Import
keyword allows the inclusion of one or
several (external) mfront files. This keyword is followed by a string or
an array of strings. Each string stands for a mfront file name that is
meant to be imported.
This instruction interrupts the treatment of the current file and starts the sequential treatment of each file to be imported.
Files to be imported are searched, in that order:
--search-path
or the --include
(-I
) mfront
’ command line options.MFRONT_INCLUDE_PATH
environment variable.@Import "SlidingSystemsCC.mfront";
@Includes
keywordThe @Includes
introduces a block were the user may
define some preprocessor directives, typically #include directives
(hence the name).
@Includes{
#include<fstream>
}
@Input
keywordThe @Input
keyword specifies one or several inputs of a
material law. This keyword is followed by the names of the inputs,
separated by commas.
The following characters are legal as the first character of an identifier, or any subsequent character:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
The following characters are legal as any character in an identifier except the first:
0
1
2
3
4
5
6
7
8
9
The depth of a variable is the number of preceedings values of this variable needed to perform the computations. A depth of \(0\) means that only the value at the end of the time step is required. A depth of \(1\) means that we need the value of the variable a the end of the time step and the value at the beginning of the time step.
The depth of a variable is set using the setDepth
method.
If p
is the variable of interest, p
is its
value at the end of the time step, p_1
is the value at the
beginning of the time step.
It is recommended to associate to an input a glossary or an entry
name through the methods setGlossaryName
or
setEntryName
respectively.
@Input T,p;
.setGlossaryName("Temperature");
T.setGlossaryName("Porosity");
p// we need the value at the end of the time step and the value at the
// beginning at the time step
.setGlossaryName("Porosity"); p
@LocalParameter
keywordThe @LocalParameter
keyword let the user defines
specialisation parameters. This keyword is followed by the type and the
names of the parameters, separated by commas. The names of the variables
must be valid C++
identifiers.
The following characters are legal as the first character of an identifier, or any subsequent character:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
The following characters are legal as any character in an identifier except the first:
0
1
2
3
4
5
6
7
8
9
The user may attribute a default value to a local parameter through
the setDefaultValue
method.
@LocalParameter real a;
.setDefaultValue(1.23); a
@Material
keywordThe @Material
keyword let the user specify which
material is treated by the current file. This keyword is followed by the
name of the material.
This name must be a valid C++
identifier. The following
characters are legal as the first character of an identifier, or any
subsequent character:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
The following characters are legal as any character in an identifier except the first:
0
1
2
3
4
5
6
7
8
9
@Material UO2;
@MaterialLaw
keywordThe @MaterialLaw
keyword imports the definition of a
material law defined in a mfront file and compiles, as part of the
current library, an function using the mfront
interface.
This function is available in every standard code blocks.
The @MaterialLaw
keyword is followed by a string or an
array of string identifying mfront
files.
Files to be imported are searched, in that order:
--search-path
or the --include
(-I
) mfront
’ command line options.MFRONT_INCLUDE_PATH
environment variable.The mfront
interface has been created to avoid names
conflict.
For internal reasons, mfront
reports the creation of an
auxiliary library which is of no use.
@MaterialLaw "UO2_YoungModulus.mfront";
@MaterialProperty
keywordThe @MaterialProperty
keyword let the user define one or
several material properties. This keyword is followed by the type of the
material property and a list of material properties names separated by
commas.
The material properties names must be valid C++
identifiers.
The following characters are legal as the first character of an identifier, or any subsequent character:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
The following characters are legal as any character in an identifier except the first:
0
1
2
3
4
5
6
7
8
9
One may declare an array of material properties by specifying the array size after the material property name.
It is recommended to associate to a material property a glossary or
an entry name through the methods setGlossaryName
or
setEntryName
respectively.
// scalar material property
@MaterialProperty stress young;
.setGlossaryName("YoungModulus"); young
@Model
keywordThe @Model
defines the name of the model. The name must
be a valid C++
class name.
The following characters are legal as the first character of an identifier, or any subsequent character:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
The following characters are legal as any character in an identifier except the first:
0
1
2
3
4
5
6
7
8
9
@Model SolidSwelling;
@Output
keywordThe @Output
keyword specifies one or several outputs of
a material law. This keyword is followed by the names of the outputs,
separated by commas.
The following characters are legal as the first character of an identifier, or any subsequent character:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
The following characters are legal as any character in an identifier except the first:
0
1
2
3
4
5
6
7
8
9
The depth of a variable is the number of preceedings values of this variable needed to perform the computations. A depth of \(0\) means that only the value at the end of the time step is required. A depth of \(1\) means that we need the value of the variable a the end of the time step and the value at the beginning of the time step.
The depth of a variable is set using the setDepth
method.
If p
is the variable of interest, p
is its
value at the end of the time step, p_1
is the value at the
beginning of the time step.
It is recommended to associate to an output a glossary or an entry
name through the methods setGlossaryName
or
setEntryName
respectively.
@Output T,p;
.setGlossaryName("Temperature");
T.setGlossaryName("Porosity"); p
@Parameter
keywordThe @Parameter
keyword declares a new parameter or a
list of new parameters. Optionally, the default value of the declared
parameters may also be given following various C++ standard assignment
syntaxes.
The default value of a parameter can also be declared after its
declaration using the setDefaultValue
method.
@Parameter R0 = 500;
@Parameter Q1{1000000000},b1{0.000001};
@Parameter Q2(0),b2(0);
@Parameter fc;
.setDefaultValue(1.e-2); fc
@Parser
keywordThe @Paser
keyword is a deprecated synonymous of
@DSL
.
@PhysicalBounds
keywordThe @PhysicalBounds
keyword let the use define the
physical domain of a variable.
The @PhysicalBounds
keyword is followed by a variable
name, the keyword in and an interval. The interval may contain the
infinity, represented by the ’*’ character.
In implicit schemes, if physical bounds are set on a integration variable, this variable is bounded to satisfy them during the internal iterations.
If a variable is found to be out of its physical bounds, the computations are stopped. The tests are performed at different stages of the integration depending on the nature of the variable.
// a temperature (in Kelvin) can't be negative
@PhysicalBounds T in [0:*[;
@StateVariable
keywordThe StateVariable
keyword introduces one or several new
state variables. It is followed by a type name and the name(s) of the
variable(s) declared, separated by commas.
The state variables names must be valid C++
identifiers.
The following characters are legal as the first character of an identifier, or any subsequent character:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
The following characters are legal as any character in an identifier except the first:
0
1
2
3
4
5
6
7
8
9
One may declare an array of state variables by specifying the array size after the state variable name.
It is recommended to associate to a state variable a glossary or an
entry name through the methods setGlossaryName
or
setEntryName
respectively.
// scalar state variable
@StateVariables strain p;
// symmetric tensors state variable
@StateVariables StrainStensor evp,evp2;
@StaticVar
keywordThe @StaticVar
keyword is a deprecated synonymous of
@StaticVariable
.
@StaticVariable
keywordThe @StaticVariable
keyword let the user define a
constant value. Unlike parameters (see the @Parameter
keyword), static variables’ values can’t be changed after
compilation.
This keyword must be followed by the type of the constant, its name, an equal sign and its value.
@StaticVariable real A = 1.234e56;
@UnitSystem
keywordThe @UnitSystem
keyword declares that the state
variables, external state variables an parameters are expressed in a
given unit system. In the current version of MFront
, the
only supported unit system is the international system of units, denoted
SI
.
One advantage of declaring an unit system is that physical bounds of
variables associated with a glossary entry can automatically be declared
by MFront
.
For instance the declaration of the physical bounds for the
temperature and the porosity is automatic if the SI
unit
system is used.
@UnitSystem SI;
@UseQt
keywordThe UseQt
keyword (use quantities) specify if the
behaviour compilation should perform compile-time units checks. It is
followed by a boolean.
This feature is still experimental and is disabled in most cases.
@UseQt true;