mfm-test-generator
provides a way to generate input files for various targets (finite element solvers, fuel performance code, etc.) for specific test cases.
mfm-test-generator
is based on two main concepts:
AbstractTestCase
class. Those class are meant to interpret the input file.This utility thus proceeds by following those three steps:
A standard invocation of mfm-test-generator
is:
$ mfm-test-generator --target=mtest pipe.mfmtg \
@library@="'src/libUmatBehaviour.so'"\
--@behaviour@="'umatnorton'" --
The main command line options are:
--target
which allows specifying one target--targets
which allows specifying a list of target, separated by commas.--targets
which allows specifying a list of shared libraries containing user defined " "test cases or generators, separated by a commas.--verbose
which allows specifying the verbosity level. Possible choices are: quiet
, level0
, level1
, level2
, level3
, debug
and full
.The input file has a JSON
-like interface.
It associates the name to a value as follows:
"ssna303" name:
A value can be a string, a floatting-point value, a integer, a boolean, an evolution and a list of times. Values are separated by a comma ,
.
Times can be specified using:
0., 1.} times : {
times : {"data.txt",
file: 1} values:
The file
field gives the name of the external file. The values
field can be: - a positive integer specifying in which column the times values are read. - a string giving a formula allowing to interpret the external files. For example, the formula $1*60
multiplies the first column by \(60\).
Evolutions may be specified using:
0: 0, 1:1.e-2} outer_pressure: {
This means that the value of the outer pressure evolution is 0
at time \(0\) and \(10^{-2}\) at time \(1\).
inner_pressure: {'pressure.txt',
file : 1,
times: 2} values:
The file
field specifies the external file name, the times
field specifies the column specification for extracting the times (can be a positive integer or a formula), the values
field specifies the column specification for extracting the values of the evolution (can be a positive integer or a formula).
Test cases shall inherit from the TestCaseBase
class which expects the follwing variables to be defined:
name
(type string
, mandatory): name associated with the test case.times
(type Times
, mandatory): list of times.author
(type string
, optional): author of the test case.date
(type string
, optional): date at which the test case has been written.description
(type string
, optional): description of the test case.The MFM_TEST_GENERATOR_ADDITIONAL_LIBRARIES
environment variable allows specifying a list of shared libraries separated by commas. Those shared libraries may contain new test cases and/or new generators.
This test case describes a simple uniaxial tensile test in small or finite strain.
"UniaxialTensileTest",
test_case: "ssna303",
name: "Thomas Helfer",
author: "30/09/2019",
date: "A first test case",
description:
behaviour: {@library@,
library: @behaviour@,
function : 150e9,
material_properties: { YoungModulus: 0.3},
PoissonRatio: 293.15 }
external_state_variables : { Temperature:
},0., 1.},
times : {
imposed_strain : {0, 1},
times:{0,1.e-2}}, values: {
"ClosedPipeTest",
test_case: "pipe",
name: "Thomas Helfer",
author: "30/09/2019",
date: "A first test case",
description:
behaviour: {@library@,
library: @behaviour@,
function : 150e9,
material_properties: { YoungModulus: 0.3},
PoissonRatio: 293.15 }
external_state_variables : { Temperature:
},//
4.e-3,
inner_radius : 4.2e-3,
outer_radius : 5,
number_of_elements : //
0., 1.},
times : {
inner_pressure: {'pressure.txt',
file : 1,
times: 2},
values: 0: 0, 1:1.e-2} outer_pressure: {