Skip to content

Commit

Permalink
Fix data_dim > 1 direct interface instantiation for solid participant
Browse files Browse the repository at this point in the history
  • Loading branch information
davidscn committed Apr 10, 2024
1 parent ef14c8d commit 20931f2
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions include/adapter/arbitrary_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,21 @@ namespace Adapter
data_vector,
UpdateFlags::update_gradients,
[this](auto &fe_evaluator, auto &local_values, auto i) {
Assert(data_dim == 1, ExcNotImplemented());
fe_evaluator.evaluate(make_array_view(local_values),
EvaluationFlags::gradients);
const auto val = fe_evaluator.get_gradient(0);
this->precice->writeData(this->mesh_name,
this->write_data_name,
{&interface_nodes_ids[i], 1},
{val.begin_raw(),
static_cast<std::size_t>(data_dim)});
if constexpr (data_dim == 1)
{
fe_evaluator.evaluate(make_array_view(local_values),
EvaluationFlags::gradients);
const auto val = fe_evaluator.get_gradient(0);
this->precice->writeData(
this->mesh_name,
this->write_data_name,
{&interface_nodes_ids[i], 1},
{val.begin_raw(), static_cast<std::size_t>(data_dim)});
}
else
{
Assert(data_dim == 1, ExcNotImplemented());
}
});
break;
default:
Expand Down

0 comments on commit 20931f2

Please sign in to comment.