GMatElastic 0.5.3
|
Linear elastic material model. An overview of the theory can be found in docs/theory/readme.tex
conveniently compiled to this PDF.
This library is free to use under the MIT license. Any additions are very much appreciated, in terms of suggested functionality, code, documentation, testimonials, word-of-mouth advertisement, etc. Bug reports or feature requests can be filed on GitHub. As always, the code comes with no guarantee. None of the developers can be held responsible for possible mistakes.
Download: .zip file | .tar.gz file.
(c - MIT) T.W.J. de Geus (Tom) | tom@g.nosp@m.eus..nosp@m.me | www.geus.me | github.com/tdegeus/GMatElastic
Note that xsimd and hardware optimisations are not enabled. To enable them you have to compile on your system, as is discussed next.
You need xtensor, xtensor-python and optionally xsimd as prerequisites. The easiest is to use conda to get the prerequisites:
conda install -c conda-forge xtensor xsimd xtensor-pythonIf you then compile and install with the same environment you should be good to go. Otherwise, a bit of manual labour might be needed to treat the dependencies.
Your CMakeLists.txt
can be as follows
The following targets are available:
GMatElastic
Includes the library and its dependencies.GMatElastic::assert
Enables IO-assertions by defining GMATELASTIC_ENABLE_ASSERT
.GMatElastic::debug
Enables assertions of all dependencies.GMatElastic::compiler_warings
Enables compiler warnings (generic).It is advised to think about compiler optimisation and enabling xsimd. Using CMake this can be done using the xtensor::optimize
and xtensor::use_xsimd
targets. The above example then becomes:
See the documentation of xtensor.
Presuming that the compiler is c++
, compile using:
Note that you have to take care of the xtensor dependency, the C++ version, optimisation, enabling xsimd, ...
Presuming that the compiler is c++
, compile using:
Note that you have to take care of the xtensor dependency, the C++ version, optimization, enabling xsimd, ...
The individual material point and the array of material points was fully integrated. In addition, the number of copies was reduced.
There is only a single class Elastic
. It's functions where renamed:
.setStrain(...)
-> .set_Eps(...)
.Stress()
-> .Sig()
(now returns a reference)..stress(...)
: deprecated..Tangent()
-> .C()
(now returns a reference)..tangent(...)
: deprecated.There is only a single class Elastic
. It's functions are converted to properties:
.setStrain(...)
-> .Eps = ...
.Stress()
-> .Sig
(now returns a reference)..stress(...)
: deprecated..Tangent()
-> .C
(now returns a reference)..tangent(...)
: deprecated.xtensor_fixed
was completely deprecated in v0.2.0, as were the type aliases Tensor2
and Tensor4
. Please update your code as follows:
Tensor2
-> xt::xtensor<double, 2>
.Tensor4
-> xt::xtensor<double, 4>
.Tip: Used auto
as return type as much as possible. This simplifies implementation, and renders is less subjective to library return type changes.
Compared to v0.1.0, v0.2.0 has some generalisations and efficiency updates. This requires the following changes:
Matrix
has been generalised to Array<rank>
. Practically this requires changing:Matrix
to Array<2>
in C++.Matrix
to Array2d
in Python. Note that Array1d
, Array3d
, are also available.Array<rank>.check
-> ```cpp if (xt::any(xt::equal(array.type(), Type::Unset))) { throw std::runtime_error("Please set all points"); } ``` Note however that it is no longer required to set all points, unset points are filled-up with zeros.stress
now return the state based on the last specified strain, specified using setStrain(Esp)
. This leads to the following changes:stress
: no argument.tangent
: no argument, single return value (no longer returns stress).Complete API overhaul.
Complete API overhaul.
Compared to v0.1.0, v0.2.0 has some generalisations and efficiency updates. This requires the following changes:
Matrix
has been generalised to Array<rank>
. Practically this requires changing:Matrix
to Array<2>
in C++.Matrix
to Array2d
in Python. Note that Array1d
, Array3d
, are also available.Array
now sets zeros for all Type::Unset
points. The function check
is deprecated accordingly.stress
now return the state based on the last specified strain, specified using set_Eps(Esp)
. This leads to the following changes:stress
: no argument.tangent
: no argument, single return value (no longer returns stress).