Skip to content
Snippets Groups Projects
Commit 316b8d2a authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MatL/S] Explicitly handle MGIS variable types

parent f2f2b21b
No related branches found
No related tags found
No related merge requests found
......@@ -223,9 +223,22 @@ private:
return DisplacementDim;
case VT::TENSOR:
return MaterialPropertyLib::tensorSize(DisplacementDim);
case VT::VECTOR_1D:
case VT::VECTOR_2D:
case VT::VECTOR_3D:
case VT::STENSOR_1D:
case VT::STENSOR_2D:
case VT::STENSOR_3D:
case VT::TENSOR_1D:
case VT::TENSOR_2D:
case VT::TENSOR_3D:
case VT::HIGHER_ORDER_TENSOR:
case VT::ARRAY:
break; // Unsupported variable types
}
OGS_FATAL("Unsupported variable type {}", BaseLib::to_underlying(vt));
OGS_FATAL("Unsupported MGIS variable type {}.",
BaseLib::to_underlying(vt));
}
/// Computes the index of a tangent operator block in the #offsets_ array.
......
......@@ -12,6 +12,7 @@
#include <MGIS/Behaviour/Variable.hxx>
#include "BaseLib/cpp23.h"
#include "MaterialLib/MPL/Utils/Tensor.h"
#include "MaterialLib/MPL/VariableType.h"
#include "MathLib/KelvinVector.h"
......@@ -38,6 +39,7 @@ struct Variable
static constexpr std::size_t rows()
{
using T = mgis::behaviour::Variable::Type;
switch (Derived::type)
{
case T::SCALAR:
......@@ -49,6 +51,19 @@ struct Variable
DisplacementDim);
case T::TENSOR:
return MaterialPropertyLib::tensorSize(DisplacementDim);
case T::VECTOR_1D:
case T::VECTOR_2D:
case T::VECTOR_3D:
case T::STENSOR_1D:
case T::STENSOR_2D:
case T::STENSOR_3D:
case T::TENSOR_1D:
case T::TENSOR_2D:
case T::TENSOR_3D:
case T::HIGHER_ORDER_TENSOR:
case T::ARRAY:
OGS_FATAL("Unsupported MGIS variable type {}.",
BaseLib::to_underlying(Derived::type));
}
}
......@@ -67,6 +82,19 @@ struct Variable
return 1;
case T::TENSOR:
return 1;
case T::VECTOR_1D:
case T::VECTOR_2D:
case T::VECTOR_3D:
case T::STENSOR_1D:
case T::STENSOR_2D:
case T::STENSOR_3D:
case T::TENSOR_1D:
case T::TENSOR_2D:
case T::TENSOR_3D:
case T::HIGHER_ORDER_TENSOR:
case T::ARRAY:
OGS_FATAL("Unsupported MGIS variable type {}.",
BaseLib::to_underlying(Derived::type));
}
}
};
......
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