1% `Model` keywords 2 3 4# The `@Author` keyword 5 6The `@Author` keyword is used give the name of the person who wrote 7the `mfront` file. 8 9All the following words are appended to the author's name up to a 10final semi-colon. 11 12Note: The name of the person who formulated the material property, 13behaviour or model shall be given in the description section (see the 14`@Description` keyword). 15 16## Example 17 18~~~~ {#Author .cpp} 19@Author Éric Brunon; 20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 22 23 24# The `@Bounds` keyword 25 26The `@Bounds` keyword let the user define the domain of validity of 27the law. 28 29The `@Bounds` keyword is followed by a variable name, the keyword in 30and an interval. The interval may contain the infinity, represented by 31the '*' character. 32 33## Effect 34 35What happens if a variable if found to be out of its bounds depends on 36the interface used. Most interfaces let the user choose one of three 37following policies: 38 39- `None`, which means that nothing is done. 40- `Warning`, which means that a message is displayed, but computations 41 are not stopped. 42- `Strict`, which means that computations are stopped with an error 43 message. 44 45## Example 46 47~~~~{.cpp} 48@Bounds T in [293.15:873.15]; 49~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 50 51 52# The `@ConstantMaterialProperty` keyword 53 54The `@ConstantMaterialPropery` let the user define a specific kind of 55input to a model which is meant to be constant and uniform during the 56computations. This allows the interfaces to optimize the generated 57code. This keyword is followed by the names of the material 58properties. Those names must be valid `C++` identifiers. 59 60The following characters are legal as the first character of an 61identifier, or any subsequent character: 62 63`_` `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` 64`n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` 65`A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` 66`N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` 67 68The following characters are legal as any character in an identifier 69except the first: 70 71`0` `1` `2` `3` `4` `5` `6` `7` `8` `9` 72 73## External name 74 75It is recommended to associate to a constant material property a 76glossary or an entry name through the methods `setGlossaryName` or 77`setEntryName` respectively. 78 79## Example 80 81~~~~{.cpp} 82@ConstantMaterialProperty E; 83E.setEntryName("EnergyReleasedByFission"); 84~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 85 86# The `@Date` keyword 87 88The `@Date` keyword allows the user to precise when the mfront file 89was written. 90 91All the following words are appended to the date up to a final 92semi-colon. 93 94## Example 95 96~~~~{.cpp} 97@Date 2008-11-17; 98~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 99 100 101# The `@Description` keyword 102 103The `@Description` describes the material property, behaviour or model 104which is implemented in a mfront file. 105 106This keyword is followed by a block containing all the relevant piece 107of information including: 108 109- the references of the article or technical report from which the 110 material property, behaviour or model is extracted 111- the name of the authors 112- the modifications made 113 114## Example 115 116~~~~{.cpp} 117@Description 118{ 119 Corrélation établie sur la nuance V-4Cr-4Ti. 120 121 Propriétés extraites du document : 122 123 Propriétés et comportement mécanique d alliages 124 de Vanadium avant, après et sous irradiation 125 126 Marion Le Flem, Jean-Luc Bechade, Annick Bougault, 127 Aurore Michaux, Lionel Gosmain, Jean-Louis Seran 128 DMN/SRMA/LA2M/NT/2008-2967/A 129} 130~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 131 132# The `@Domain` keyword 133 134The `@Domain` let the user define the default domain on which a model 135shall be applied. This keyword is followed by the name of the domain. 136 137This keyword is deprecated as domains shall be explicitely specified 138by specialisation. 139 140## Example 141 142~~~~{.cpp} 143@Domain "Fuel"; 144~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 146# The `@Domains` keyword 147 148The `@Domains` let the user define the default domains on which a model 149shall be applied. This keyword is followed by an array of strings. 150 151This keyword is deprecated as domains shall be explicitely specified 152by specialisation. 153 154## Example 155 156~~~~{.cpp} 157@Domains {"MATRIX","CLADDING"}; 158~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 159 160# The `@Function` keyword 161 162The `@Function` keyword defines a computational part of the 163model. This keyword is followed by a string defining the name of this 164part of the computation. 165 166## Example 167 168~~~~{.cpp} 169@Function compute 170{ 171 const real coef1 = 8.e-3; 172 const real coef2 = 4.e-2; 173 const real p_ = 0.5*(p+p_1); 174 s = s_1 + coef1*exp(coef2-p_)*(Bu-Bu_1); 175} // end of function compute 176~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 177 178# The `@GlobalParameter` keyword 179 180The `@GlobalParameter` keyword let the user defines model 181parameters. This keyword is followed by the type and the names of the 182parameters, separated by commas. The names of the variables must be 183valid `C++` identifiers. 184 185The following characters are legal as the first character of an 186identifier, or any subsequent character: 187 188`_` `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` 189`n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` 190`A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` 191`N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` 192 193The following characters are legal as any character in an identifier 194except the first: 195 196`0` `1` `2` `3` `4` `5` `6` `7` `8` `9` 197 198## Default values 199 200The user may attribute a default value to a global parameter through 201the `setDefaultValue` method. 202 203## Example 204 205~~~~{.cpp} 206@GlobalParameter real a; 207a.setDefaultValue(1.23); 208~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 209 210 211# The `@Import` keyword 212 213The `@Import` keyword allows the inclusion of one or several 214(external) mfront files. This keyword is followed by a string or an 215array of strings. Each string stands for a mfront file name that is 216meant to be imported. 217 218This instruction interrupts the treatment of the current file and 219starts the sequential treatment of each file to be imported. 220 221## Search paths 222 223Files to be imported are searched, in that order: 224 225- starting from the current directory. 226- starting from directories specified with one of the `--search-path` 227 or the `--include` (`-I`) `mfront`' command line options. 228- staring from directories specified through the `MFRONT_INCLUDE_PATH` 229 environment variable. 230 231## Example 232 233~~~~{.cpp} 234@Import "SlidingSystemsCC.mfront"; 235~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 236 237# The `@Includes` keyword 238 239The `@Includes` introduces a block were the user may define some 240preprocessor directives, typically #include directives (hence the 241name). 242 243## Example 244 245~~~~{.cpp} 246@Includes{ 247#include<fstream> 248} 249~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 250 251# The `@Input` keyword 252 253The `@Input` keyword specifies one or several inputs of a material 254law. This keyword is followed by the names of the inputs, separated 255by commas. 256 257The following characters are legal as the first character of an 258identifier, or any subsequent character: 259 260`_` `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` 261`n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` 262`A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` 263`N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` 264 265The following characters are legal as any character in an identifier 266except the first: 267 268`0` `1` `2` `3` `4` `5` `6` `7` `8` `9` 269 270## Variable depth 271 272The depth of a variable is the number of preceedings values of this 273variable needed to perform the computations. A depth of \(0\) means 274that only the value at the end of the time step is required. A depth 275of \(1\) means that we need the value of the variable a the end of the 276time step and the value at the beginning of the time step. 277 278The depth of a variable is set using the `setDepth` method. 279 280If `p` is the variable of interest, `p` is its value at the end of the 281time step, `p_1` is the value at the beginning of the time step. 282 283## External name 284 285It is recommended to associate to an input a glossary or an entry name 286through the methods `setGlossaryName` or `setEntryName` respectively. 287 288## Example 289 290~~~~{.cpp} 291@Input T,p; 292T.setGlossaryName("Temperature"); 293p.setGlossaryName("Porosity"); 294// we need the value at the end of the time step and the value at the 295// beginning at the time step 296p.setGlossaryName("Porosity"); 297~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 298 299# The `@LocalParameter` keyword 300 301The `@LocalParameter` keyword let the user defines specialisation 302parameters. This keyword is followed by the type and the names of the 303parameters, separated by commas. The names of the variables must be 304valid `C++` identifiers. 305 306The following characters are legal as the first character of an 307identifier, or any subsequent character: 308 309`_` `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` 310`n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` 311`A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` 312`N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` 313 314The following characters are legal as any character in an identifier 315except the first: 316 317`0` `1` `2` `3` `4` `5` `6` `7` `8` `9` 318 319## Default values 320 321The user may attribute a default value to a local parameter through 322the `setDefaultValue` method. 323 324## Example 325 326~~~~{.cpp} 327@LocalParameter real a; 328a.setDefaultValue(1.23); 329~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 330 331 332# The `@Material` keyword 333 334The `@Material` keyword let the user specify which material is treated 335by the current file. This keyword is followed by the name of the 336material. 337 338This name must be a valid `C++` identifier. The following characters 339are legal as the first character of an identifier, or any subsequent 340character: 341 342`_` `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` 343`n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` 344`A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` 345`N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` 346 347The following characters are legal as any character in an identifier 348except the first: 349 350`0` `1` `2` `3` `4` `5` `6` `7` `8` `9` 351 352## Example 353 354~~~~{.cpp} 355@Material UO2; 356~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 357 358# The `@MaterialLaw` keyword 359 360The `@MaterialLaw` keyword imports the definition of a material law 361defined in a mfront file and compiles, as part of the current library, 362an function using the `mfront` interface. This function is available 363in every standard code blocks. 364 365The `@MaterialLaw` keyword is followed by a string or an array of 366string identifying `mfront` files. 367 368## Search paths 369 370Files to be imported are searched, in that order: 371 372- starting from the current directory. 373- starting from directories specified with one of the `--search-path` 374 or the `--include` (`-I`) `mfront`' command line options. 375- staring from directories specified through the `MFRONT_INCLUDE_PATH` 376 environment variable. 377 378## Note 379 380The `mfront` interface has been created to avoid names conflict. 381 382For internal reasons, `mfront` reports the creation of an auxiliary 383library which is of no use. 384 385## Example 386 387~~~~{.cpp} 388@MaterialLaw "UO2_YoungModulus.mfront"; 389~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 390 391# The `@Model` keyword 392 393The `@Model` defines the name of the model. The name must be a 394valid `C++` class name. 395 396The following characters are legal as the first character of an 397identifier, or any subsequent character: 398 399`_` `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` 400`n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` 401`A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` 402`N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` 403 404The following characters are legal as any character in an identifier 405except the first: 406 407`0` `1` `2` `3` `4` `5` `6` `7` `8` `9` 408 409## Example 410 411~~~~{.cpp} 412@Model SolidSwelling; 413~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 414 415# The `@Output` keyword 416 417The `@Output` keyword specifies one or several outputs of a material 418law. This keyword is followed by the names of the outputs, separated 419by commas. 420 421The following characters are legal as the first character of an 422identifier, or any subsequent character: 423 424`_` `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` 425`n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` 426`A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` 427`N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` 428 429The following characters are legal as any character in an identifier 430except the first: 431 432`0` `1` `2` `3` `4` `5` `6` `7` `8` `9` 433 434## Variable depth 435 436The depth of a variable is the number of preceedings values of this 437variable needed to perform the computations. A depth of \(0\) means 438that only the value at the end of the time step is required. A depth 439of \(1\) means that we need the value of the variable a the end of the 440time step and the value at the beginning of the time step. 441 442The depth of a variable is set using the `setDepth` method. 443 444If `p` is the variable of interest, `p` is its value at the end of the 445time step, `p_1` is the value at the beginning of the time step. 446 447## External name 448 449It is recommended to associate to an output a glossary or an entry 450name through the methods `setGlossaryName` or `setEntryName` 451respectively. 452 453## Example 454 455~~~~{.cpp} 456@Output T,p; 457T.setGlossaryName("Temperature"); 458p.setGlossaryName("Porosity"); 459~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 460 461# The `@Parser` keyword 462 463The `@Paser` keyword is a deprecated synonymous of `@DSL`. 464 465# The `@PhysicalBounds` keyword 466 467The `@PhysicalBounds` keyword let the use define the physical domain 468of a variable. 469 470The `@PhysicalBounds` keyword is followed by a variable name, the 471keyword in and an interval. The interval may contain the infinity, 472represented by the '*' character. 473 474## Effect 475 476In implicit schemes, if physical bounds are set on a integration 477variable, this variable is bounded to satisfy them during the internal 478iterations. 479 480If a variable is found to be out of its physical bounds, the 481computations are stopped. The tests are performed at different stages 482of the integration depending on the nature of the variable. 483 484## Example 485 486~~~~{.cpp} 487// a temperature (in Kelvin) can't be negative 488@Bounds T in [0:*[; 489~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 490 491 492# The `@StaticVar` keyword 493 494The `@StaticVar` keyword is a deprecated synonymous of 495`@StaticVariable`. 496 497# The `@StaticVariable` keyword 498 499The `@StaticVariable` keyword let the user define a constant 500value. Unlike parameters (see the `@Parameter` keyword), static 501variables' values can't be changed after compilation. 502 503This keyword must be followed by the type of the constant, its name, 504an equal sign and its value. 505 506## Example 507 508~~~~{.cpp} 509@StaticVariable real A = 1.234e56; 510~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 511