41 std::vector<double>
const& mfront_data,
44 mgis::behaviour::Behaviour
const& behaviour)
46 using VT = mgis::behaviour::Variable::Type;
50 std::vector<double> ogs_data(mfront_data.size());
52 std::size_t offset = 0;
53 constexpr auto kv_size =
56 for (
auto const& [var1, var2] : behaviour.to_blocks)
60 auto const*
const d_in = mfront_data.data() + offset;
61 auto*
const d_out = ogs_data.data() + offset;
63 if (var1.type == VT::SCALAR && var2.type == VT::SCALAR)
68 else if (var1.type == VT::SCALAR && var2.type == VT::STENSOR)
70 assert(getVariableSize(var2, behaviour.hypothesis) == kv_size);
76 "Coordinate frame rotation not yet implemented for "
82 else if (var1.type == VT::STENSOR && var2.type == VT::SCALAR)
84 assert(getVariableSize(var1, behaviour.hypothesis) == kv_size);
90 "Coordinate frame rotation not yet implemented for "
96 else if (var1.type == VT::STENSOR && var2.type == VT::STENSOR)
98 assert(getVariableSize(var1, behaviour.hypothesis) == kv_size);
99 assert(getVariableSize(var2, behaviour.hypothesis) == kv_size);
100 size = kv_size * kv_size;
104 Eigen::Map<KM>{d_out} =
110 Eigen::Map<KM>{d_out} =
116 OGS_FATAL(
"unsupported variable type combination");
122 return {std::move(ogs_data)};