diff --git a/MaterialLib/MPL/CreateProperty.cpp b/MaterialLib/MPL/CreateProperty.cpp index 4d456d88049938ce1e3920503472f70efaec52bf..24d700ddd4c155fef81561f0b48aa6123c1c8c8d 100644 --- a/MaterialLib/MPL/CreateProperty.cpp +++ b/MaterialLib/MPL/CreateProperty.cpp @@ -62,6 +62,13 @@ std::unique_ptr<MaterialPropertyLib::Property> createProperty( Vector{values[0], values[1], values[2]}; return std::make_unique<Constant>(property_value); } + case 4: + { + // Tensor + PropertyDataType property_value = + Tensor2d{values[0], values[1], values[2], values[3]}; + return std::make_unique<Constant>(property_value); + } case 6: { // Symmetric Tensor - xx, yy, zz, xy, xz, yz diff --git a/MaterialLib/MPL/Property.h b/MaterialLib/MPL/Property.h index a086887db94e31532cf2653504c9b04d9e838e2b..efb75801a429cc6444b74db5e67b6060a48b9c9c 100644 --- a/MaterialLib/MPL/Property.h +++ b/MaterialLib/MPL/Property.h @@ -33,8 +33,8 @@ enum PropertyDataTypeName nTensor }; -using PropertyDataType = - boost::variant<double, Pair, Vector, SymmTensor, Tensor, std::string>; +using PropertyDataType = boost:: + variant<double, Pair, Vector, Tensor2d, SymmTensor, Tensor, std::string>; /// This class is the base class for any material property of any /// scale (i.e. components, phases, media, ...). The single value of diff --git a/MaterialLib/MPL/VariableType.h b/MaterialLib/MPL/VariableType.h index 7ac721108cc6776bf5305eefe2f8b508c74aaa7e..e634d54a32937bd751024ce92bbe8adf9d68046e 100644 --- a/MaterialLib/MPL/VariableType.h +++ b/MaterialLib/MPL/VariableType.h @@ -30,6 +30,9 @@ using Vector = std::array<double, 3>; /// xx, yy, zz, xy, xz, yz tensor components. using SymmTensor = std::array<double, 6>; +/// Very simple 2d tensor data type for holding tensor components. +using Tensor2d = std::array<double, 4>; + /// Very simple tensor data type for holding /// tensor components. using Tensor = std::array<double, 9>;