]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Fix tutorials with SolutionTransfer. 200/head
authorMarc Fehling <mafehling.git@gmail.com>
Tue, 20 Aug 2024 17:34:28 +0000 (11:34 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Tue, 20 Aug 2024 17:34:28 +0000 (11:34 -0600)
ElastoplasticTorsion/ElastoplasticTorsion.cc
TravelingWaves/TravelingWaveSolver.cc
goal_oriented_elastoplasticity/elastoplastic.cc

index 56477034e38c4f0db9face0005acf250738a1b9a..447ec3b7bfe59bd5ee8ccdd7f5888f63a5d6750d 100644 (file)
@@ -273,8 +273,8 @@ namespace nsp
   ComputeMultiplier<dim>::get_names() const
   {
     std::vector<std::string> solution_names;
-    solution_names.push_back ("Gradient norm");
-    solution_names.push_back ("Lagrange multiplier");
+    solution_names.push_back ("Gradient_norm");
+    solution_names.push_back ("Lagrange_multiplier");
     return solution_names;
   }
 
@@ -779,6 +779,7 @@ namespace nsp
     triangulation.execute_coarsening_and_refinement();
     dof_handler.distribute_dofs(fe);
 #  if DEAL_II_VERSION_GTE(9, 7, 0)
+    present_solution.reinit(dof_handler.n_dofs());
     solution_transfer.interpolate(present_solution);
 #  else
     Vector<double> tmp(dof_handler.n_dofs());
index a682d91c67740061bd4eb22fb202b5a34bd31960..99f757a5c8821f9d30ba65070312e1218c3f72a5 100644 (file)
@@ -292,7 +292,7 @@ namespace TravelingWave
           );
         };
 
-        auto kappa_2 = [=](double T, double lambda){
+        auto kappa_2 = [=](double T, double /*lambda*/){
           return -problem.k * std::exp(-problem.theta / T) * Heaviside_func(T - problem.T_ign);
         };
 
@@ -637,6 +637,7 @@ namespace TravelingWave
     setup_system(/*initial_step=*/ false);
 
 #  if DEAL_II_VERSION_GTE(9, 7, 0)
+    current_solution.reinit(dof_handler.n_dofs());
     solution_transfer.interpolate(current_solution);
 #  else
     Vector<double> tmp(dof_handler.n_dofs());
index 32a50a2227f16b2bc657cbe0da7021eff03a0d60..6294013c48b0e270ad42fc8be82aec7b8670758a 100644 (file)
@@ -5608,6 +5608,12 @@ namespace ElastoPlastic
 
 #  if DEAL_II_VERSION_GTE(9, 7, 0)
     // stress
+    for (unsigned int i=0; i<dim; ++i)
+      for (unsigned int j=0; j<dim; ++j)
+        {
+          history_stress_field[i][j].reinit(history_dof_handler.n_dofs());
+        }
+
     history_stress_field_transfer0.interpolate(history_stress_field[0]);
     if ( dim > 1)
       {
@@ -5619,6 +5625,12 @@ namespace ElastoPlastic
       }
 
     // strain
+    for (unsigned int i=0; i<dim; ++i)
+      for (unsigned int j=0; j<dim; ++j)
+        {
+          history_strain_field[i][j].reinit(history_dof_handler.n_dofs());
+        }
+
     history_strain_field_transfer0.interpolate(history_strain_field[0]);
     if ( dim > 1)
       {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.