triangulation.execute_coarsening_and_refinement ();
dof_handler.distribute_dofs (fe);
+ this->setup_linear_system ();
solution.reinit (dof_handler.n_dofs());
soltrans.interpolate(solution_old, solution);
+ // enforce constraints to make the interpolated solution conforming on
+ // the new mesh:
+ hanging_node_constraints.distribute(solution);
+
solution_old.reinit (dof_handler.n_dofs());
solution_old = solution;
}
std::cout << "Cycle " << cycle << ':' << std::endl;
if (cycle == 0)
- initialize_problem();
+ {
+ initialize_problem();
+ for (unsigned int group=0; group<parameters.n_groups; ++group)
+ energy_groups[group]->setup_linear_system ();
+ }
+
else
{
refine_grid ();
energy_groups[group]->solution *= k_eff;
}
- for (unsigned int group=0; group<parameters.n_groups; ++group)
- energy_groups[group]->setup_linear_system ();
std::cout << " Numbers of active cells: ";
for (unsigned int group=0; group<parameters.n_groups; ++group)
tmp[1] = &(distributed_temp2);
temperature_trans.interpolate(tmp);
+ // enforce constraints to make the interpolated solution conforming on
+ // the new mesh:
+ temperature_constraints.distribute(distributed_temp1);
+ temperature_constraints.distribute(distributed_temp2);
+
temperature_solution = distributed_temp1;
old_temperature_solution = distributed_temp2;
}
stokes_tmp[1] = &(old_distributed_stokes);
stokes_trans.interpolate (stokes_tmp);
+
+ // enforce constraints to make the interpolated solution conforming on
+ // the new mesh:
+ stokes_constraints.distribute(distributed_stokes);
+ stokes_constraints.distribute(old_distributed_stokes);
+
stokes_solution = distributed_stokes;
old_stokes_solution = old_distributed_stokes;
}
{
TrilinosWrappers::MPI::Vector distributed_solution(locally_owned_dofs, mpi_communicator);
solution_transfer.interpolate(distributed_solution);
+
+ // enforce constraints to make the interpolated solution conforming on
+ // the new mesh:
+ constraints_hanging_nodes.distribute(distributed_solution);
+
solution = distributed_solution;
compute_nonlinear_residual(solution);
}