MGIS/Behaviour library
MGIS/Function library
getVariableOffset terminates the program, thread pool
tasks outlive an exceptionFixedSizeModifier breaks the check chainintegrate_debug crashes from the second integration
pointabort and
terminate functionsconstruct does not work for objects non movable and
non copyableInvalidResult to optional type may be
ambiguous if InvalidType is convertible to the type hold by the
optionalInvokeTest on MacOSErrorBacktrace::assertOrTerminateErrorBacktrace::terminateisInvalid for taking an
InvalidResult as argumentContext object in
construct, make_unique or
make_shared (and siblings) when the constructor takes a
Context as first argument`assign algorithm to work on temporary viewsassign
algorithm to detect if values of the function can be assigned to the
values of the evaluatorMac Os,
Windows/Visual Studio and
Windows/MingGWnvccsave/restore
operations in MaterialDataManagerMaterialStateManagerTFEL/Math’s
quantitiessetMaterialPropertyMGIS/FunctionThis version is meant to be used with TFEL Version
5.2.
MGIS/Function now creates a view from a
temporary view rather than an evaluator. See below for details. In
practice, most views are also evaluators, so this shall not impact
existing user code.material_properties,
mass_density and external_state_variables of
the MaterialStateManager class have changed to allow the
usage of immutable externally allocated memory. See below for
details.MaterialStateManager classIn Version 3.1, MaterialStateManager::FieldHolder was an
alias to
std::variant<real, std::span<real>, std::vector<real>>,
the material properties and the external state variables were stored in
std::map<std::string, FieldHolder> and the mass
density in a std::optional<FieldHolder>.
In Version 3.2:
MaterialStateManager::MutableFieldHolder is a structure
whose member value is a
std::variant<real, std::span<real>, std::vector<real>>,
i.e. the former FieldHolder, and whose member
shall_be_updated states if the values are updated by the
update and revert functions.MaterialStateManager::FieldHolder is a structure
derived from
std::variant<std::monostate, std::span<const real>, MutableFieldHolder>.
The std::span<const real> alternative refers to
immutable externally allocated memory.material_properties and
external_state_variables are of type
std::map<std::string, FieldHolder, std::less<>>.
The transparent comparator std::less<> allows looking
up a variable using a std::string_view.mass_density is of type
std::optional<MutableFieldHolder>.The following code, valid in Version 3.1:
const auto& h = s.material_properties.at("YoungModulus");
if (std::holds_alternative<real>(h)) {
const auto E = std::get<real>(h);
}
const auto rho = std::get<real>(*(s.mass_density));shall be written as follows in Version 3.2:
using MutableFieldHolder = MaterialStateManager::MutableFieldHolder;
const auto& h = s.material_properties.at("YoungModulus");
if (std::holds_alternative<MutableFieldHolder>(h)) {
const auto& v = std::get<MutableFieldHolder>(h).value;
if (std::holds_alternative<real>(v)) {
const auto E = std::get<real>(v);
}
}
const auto rho = std::get<real>(s.mass_density->value);Code naming the former type of the maps, for instance
const std::map<std::string, MaterialStateManager::FieldHolder>&,
shall use the new comparator or auto.
cmake optionsCUDA
in MGIS/FunctionSupport for CUDA in MGIS/Function is enable
by enable-cuda-algorithms.
The following options control the support of the HDF5
library:
enable-hdf5-support: enable HDF5 support for
save/restore operations. Note that if this support is not explicitely
requested, MGIS still tries by default to support
HDF5 but configuration will not fail if the
HDF5 library is not found. See
enable-hdf5-automatic-support for details.enable-hdf5-automatic-support: if set,
MGIS tries by default to support HDF5 even if
enable-hdf5-support` is not set.Doxygen documentationThe doxygen documentation is now online: https://thelfer.github.io/mgis/doxygen/index.html.
MGIS to work
properlyDepending on the system and compilation options, some of following
variables shall be set for MGIS to work properly:
MGISHOME, PATH, LD_LIBRARY_PATH
and PYTHONPATH.
MGIS now installs automatically the following files in
the installation directory (refered to
<install_prefix> in the following):
<install_prefix>/share/mgis/env/env.sh for
UNIX systems and the bash shell. This file
shall be used as follows:
$ source <install_prefix>/share/mgis/env/env.sh<install_prefix>\share\mgis\env\env.ps1 for
PowerShell shell under Windows. This file
shall be used as follows:
$ .\<install_prefix>\share\mgis\env\env.ps1<install_prefix>\share\mgis\env\env.bat for
the historical cmd shell under Windows. This
file shall be used as follows:
$ call <install_prefix>\share\mgis\env\env.batNote
Those variables are not required if
MGISis installed system-wide (for instance in/usr/local) and that theMGIS’s binaries are not relocated (i.e. moved to a different directory than the one specified during the compilation process as the installation directory).
Note
If
MGISis built withTFELsupport, theTFELenvironment shall be properly set.
The Context class can now measure the time spent in the
sections of code instrumented by the CatchTimeSection
macro, declared in the MGIS/Profiling.hxx header. Profiling
is disabled by default and is enabled by the
enableProfiling method. The measured times are stored in a
tree of ProfilingData objects whose root is returned by the
getProfilingResultTree method.
See the profiling page for details.
auto ctx = Context{};
ctx.enableProfiling(true);
{
CatchTimeSection(ctx, "IntegrationStep");
// ... code to be profiled ...
}
const auto& root = ctx.getProfilingResultTree();mgis::terminate and mgis::abort functionsThe mgis::terminate function, declared in the
MGIS/Config.hxx header, terminates the program after
calling the terminate handler of MGIS with the given
message. The default terminate handler prints the message on the
standard error stream and calls std::terminate. The
mgis::abort function is an alias to
mgis::terminate.
The terminate methods of the Context class
call mgis::terminate with the error messages registered in
the context.
if (!isInvariantSatisfied) {
mgis::terminate("internal error: invariant not satisfied");
}MGIS/Behaviour libraryMaterialStateManager and
MaterialDataManagerIf HDF5 support is enabled, two functions
save and restore are available:
save function allows saving the values stored in a
MaterialStateManager or in a
MaterialDataManager to an HDF5 file.restore function allows retrieving the values
stored in a MaterialStateManager or in a
MaterialDataManager from an HDF5 file.Those functions have options allowing to precisely select what is saved or restored.
By default, one expects to restore the maximum amount of information.
The getGreedyMaterialStateManagerRestoreOptions function
creates option that can restore everything that has been saved.
MaterialStateManagerBy default, material properties, mass density and external state
variables are updated by the update and revert
functions.
This can now be controlled by passing a value of the
MaterialStateManager::UpdatePolicy type to the functions
setMaterialProperty, setMassDensity or
setExternalStateVariable.
setExternalStateVariable(m.s1, "Temperature", T1,
MaterialStateManager::UPDATE);MGIS/Function libraryQuantities is features of the TFEL/Math library which allows assigning an unit to a floating point number.
MGIS/Function provides as_qt to turn a
function into a view returning quantities. Tensor modifiers, such as
as_stensor now allows to specify a quantity as an optional
argument.
~~{.c++} // make a view of a scalar function which returns a
stress value auto s = f | as_qt~~
The following classes have been introduced:
StridedCoalescedMemoryAccessTensorViewStridedCoalescedMemoryAccessCompositeTensorsViewStridedCoalescedMemoryAccessTensorViewStridedCoalescedMemoryAccessTensorView is a tensorial
function view which stores its components in non interleaved manner
using the following scheme:
| <------- Component 1 ---------> |....| <----- Component Nc ---------> |
+-------++-------++------++-------+----+-------++------++------++-------+
| Elt 1 || Elt 2 || .... || Elt N |....| Elt 1 ||Elt 2 || .... || Elt N |
+-------++-------++------++-------+----+-------++------++------++-------+
constexpr auto ne = size_type{2};
auto space = BasicLinearSpace{ne};
std::array<const real, 4 * ne> values = {1, 10, 2, 20, 3, 30, 4, 40};
const auto f = StridedCoalescedMemoryAccessTensorView<
BasicLinearSpace, tfel::math::stensor<2, real>, false>{space, values};
const auto e1 = f(0);
// e1 = {1, 2, 3, 4}
const auto e2 = f(1);
// e2 = {10, 20, 30, 40}StridedCoalescedMemoryAccessCompositeTensorsViewStridedCoalescedMemoryAccessCompositeTensorsView allows
retrieving scalar or tensorial objects which are stored in a non
interleaved manner.
using CompositeFunctionView =
StridedCoalescedMemoryAccessCompositeTensorsView<BasicLinearSpace, 4,
false>;
constexpr auto ne = size_type{2};
auto space = BasicLinearSpace{ne};
std::array<const real, 4 * ne> values = {1, 10, 2, 20, 3, 30, 4, 40};
const auto f = CompositeFunctionView{space, values};
const auto e1 = f.get<0, tfel::math::stensor<2, real>>(0);
// e1 = {1, 2, 3, 4}
const auto e2 = f.get<0, tfel::math::stensor<2, real>>(1);
// e2 = {10, 20, 30, 40}In Version 3.1, passing a temporary view to a modifier would create an evaluator. This behaviour was due to the fact that:
rvalue in C++’s precise
wording)EvaluatorConcept, and modifiers were authorized to operate
on temporary evaluatorsIn Version 3.2, modifiers are now allowed to operate on temporary views. This following code now generates a view rather than an evaluator:
// creating an array view from an rvalue.
auto v = f.view() | as_array<2>;By comparison, to achieve the same behaviour in Version 3.1, creation of an intermediate variable was required, as follows:
// creating an array view in Version 3.1: auto f_view = f.view(); auto v = f_view | as_array<2>;
operator| and
assign functionIn Version 3.1, “assignement” operator| and
assign function did not accept temporaries.
This behaviour has been changed in Version 3.2 which allows a more direct code:
f2 | as_scalar | (f | as_scalar); // "assignement" operator|or equivalently:
assign(ctx, f | as_scalar, f2 | as_scalar);By comparison, Version 3.1 would have forced to store the view resulting from
f | as_scalarinto a temporary as follows:auto tmp = f | as_scalar; assign(ctx, tmp, f2 | as_scalar);
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/344
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/342
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/340
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/338
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/336
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/334
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/332
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/330
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/328
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/326
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/324
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/322
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/308
getVariableOffset terminates the program, thread pool
tasks outlive an exceptionFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/307
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/306
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/305
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/304
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/297
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/295
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/293
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/292
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/290
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/289
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/288
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/286
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/285
FixedSizeModifier breaks the check chainFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/284
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/282
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/281
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/280
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/279
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/277
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/275
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/273
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/272
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/271
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/270
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/269
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/268
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/267
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/266
integrate_debug crashes from the second integration
pointFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/265
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/264
abort and
terminate functionsFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/261
construct does not work for objects non movable and
non copyableFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/258
InvalidResult to optional type may be
ambiguous if InvalidType is convertible to the type hold by the
optionalFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/257
InvokeTest on MacOSFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/255
ErrorBacktrace::assertOrTerminateFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/250
ErrorBacktrace::terminateFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/248
isInvalid for taking an
InvalidResult as argumentFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/245
Context object in
construct, make_unique or
make_shared (and siblings) when the constructor takes a
Context as first argument`For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/244
assign algorithm to work on temporary viewsFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/236
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/233
assign
algorithm to detect if values of the function can be assigned to the
values of the evaluatorFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/232
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/227
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/226
Mac Os,
Windows/Visual Studio and Windows/MingGWFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/224
nvccFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/220
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/219
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/210
save/restore
operations in MaterialDataManagerFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/209
MaterialStateManagerFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/202
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/200
TFEL/Math’s
quantitiesFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/199
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/196
setMaterialPropertyFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/195
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/191
MGIS/FunctionFor more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/160
For more details, see https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/158
The authors are grateful to the many contributors to the
TFEL/MFront project. This research was conducted in the
framework of the PLEIADES project, which was supported financially by
the CEA (Commissariat à l’Énergie Atomique et aux Énergies
Alternatives), EDF (Électricité de France) and Framatome. Work on
MGIS/Function was performed as part of the EURATOM OperaHPC
Project co-funded by the European Union.