Skip to content

Commit

Permalink
Incompatibility: SolutionTransfer::interpolate
Browse files Browse the repository at this point in the history
  • Loading branch information
marcfehling committed Aug 19, 2024
1 parent 240c29a commit 42e8901
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ElastoplasticTorsion/ElastoplasticTorsion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,13 @@ namespace nsp
solution_transfer.prepare_for_coarsening_and_refinement(present_solution);
triangulation.execute_coarsening_and_refinement();
dof_handler.distribute_dofs(fe);
# if DEAL_II_VERSION_GTE(9, 7, 0)
solution_transfer.interpolate(present_solution);
# else
Vector<double> tmp(dof_handler.n_dofs());
solution_transfer.interpolate(present_solution, tmp);
present_solution = tmp;
# endif
set_boundary_values ();
hanging_node_constraints.clear();

Expand Down
4 changes: 4 additions & 0 deletions TravelingWaves/TravelingWaveSolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,13 @@ namespace TravelingWave

setup_system(/*initial_step=*/ false);

# if DEAL_II_VERSION_GTE(9, 7, 0)
solution_transfer.interpolate(current_solution);
# else
Vector<double> tmp(dof_handler.n_dofs());
solution_transfer.interpolate(current_solution, tmp);
current_solution = std::move(tmp);
# endif

set_boundary_and_centering_values();

Expand Down
25 changes: 25 additions & 0 deletions goal_oriented_elastoplasticity/elastoplastic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5605,6 +5605,30 @@ namespace ElastoPlastic

// ---------------------------------------------------
history_dof_handler.distribute_dofs (history_fe);

# if DEAL_II_VERSION_GTE(9, 7, 0)
// stress
history_stress_field_transfer0.interpolate(history_stress_field[0]);
if ( dim > 1)
{
history_stress_field_transfer1.interpolate(history_stress_field[1]);
}
if ( dim == 3)
{
history_stress_field_transfer2.interpolate(history_stress_field[2]);
}

// strain
history_strain_field_transfer0.interpolate(history_strain_field[0]);
if ( dim > 1)
{
history_strain_field_transfer1.interpolate(history_strain_field[1]);
}
if ( dim == 3)
{
history_strain_field_transfer2.interpolate(history_strain_field[2]);
}
# else
// stress
std::vector< std::vector< Vector<double> > >
distributed_history_stress_field (dim, std::vector< Vector<double> >(dim));
Expand Down Expand Up @@ -5646,6 +5670,7 @@ namespace ElastoPlastic
}

history_strain_field = distributed_history_strain_field;
# endif

// ---------------------------------------------------------------
// Transfer the history data to the quadrature points of the new mesh
Expand Down

0 comments on commit 42e8901

Please sign in to comment.