Skip to content
Snippets Groups Projects
Commit 573acc18 authored by Tom Fischer's avatar Tom Fischer
Browse files

[MPL] Add Tensor2d as PropertyDataType.

parent ca65401f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
......@@ -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>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment