From: Marc Fehling Date: Mon, 19 Aug 2024 23:53:51 +0000 (-0600) Subject: Incompatibility: SolutionTransfer::interpolate X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42e8901f6b7954ecb043cce7f8a54c6f57acbda7;p=code-gallery.git Incompatibility: SolutionTransfer::interpolate --- diff --git a/ElastoplasticTorsion/ElastoplasticTorsion.cc b/ElastoplasticTorsion/ElastoplasticTorsion.cc index 9879af5..5647703 100644 --- a/ElastoplasticTorsion/ElastoplasticTorsion.cc +++ b/ElastoplasticTorsion/ElastoplasticTorsion.cc @@ -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 tmp(dof_handler.n_dofs()); solution_transfer.interpolate(present_solution, tmp); present_solution = tmp; +# endif set_boundary_values (); hanging_node_constraints.clear(); diff --git a/TravelingWaves/TravelingWaveSolver.cc b/TravelingWaves/TravelingWaveSolver.cc index cb1edfd..a682d91 100644 --- a/TravelingWaves/TravelingWaveSolver.cc +++ b/TravelingWaves/TravelingWaveSolver.cc @@ -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 tmp(dof_handler.n_dofs()); solution_transfer.interpolate(current_solution, tmp); current_solution = std::move(tmp); +# endif set_boundary_and_centering_values(); diff --git a/goal_oriented_elastoplasticity/elastoplastic.cc b/goal_oriented_elastoplasticity/elastoplastic.cc index a8dda19..32a50a2 100644 --- a/goal_oriented_elastoplasticity/elastoplastic.cc +++ b/goal_oriented_elastoplasticity/elastoplastic.cc @@ -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 > > distributed_history_stress_field (dim, std::vector< Vector >(dim)); @@ -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