I assume that my old values are correct, after I get a reasonable result
with them. Transferring the mesh is done with
template <int dim> void MinimalSurfaceProblem<dim>::refine_mesh ()
{
Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
KellyErrorEstimator<dim>::estimate (dof_handler,
QGauss<dim-1>(fe.degree+1),
typename FunctionMap<dim>::type(),
present_solution,
estimated_error_per_cell,
ComponentMask(),
nullptr,
0,
triangulation.locally_owned_subdomain());
parallel::distributed::GridRefinement::refine_and_coarsen_fixed_number (
triangulation,
estimated_error_per_cell,
0.3, 0.03);
if (triangulation.n_levels() > max_grid_level)
for (auto cell = triangulation.begin_active(max_grid_level); cell !=
triangulation.end(); ++cell)
cell->clear_refine_flag ();
for (auto cell = triangulation.begin_active(min_grid_level); cell !=
triangulation.end_active(min_grid_level); ++cell)
cell->clear_coarsen_flag ();
triangulation.prepare_coarsening_and_refinement ();
parallel::distributed::SolutionTransfer<dim, LinearAlgebraTrilinos::MPI::
Vector> solution_transfer(dof_handler), old_solution_transfer(dof_handler);
solution_transfer.prepare_for_coarsening_and_refinement(present_solution);
old_solution_transfer.prepare_for_coarsening_and_refinement(old_solution);
triangulation.execute_coarsening_and_refinement();
setup_system(true);
LinearAlgebraTrilinos::MPI::Vector distributed_solution(dof_handler.
locally_owned_dofs(), mpi_communicator);
LinearAlgebraTrilinos::MPI::Vector distributed_old_solution(dof_handler.
locally_owned_dofs(), mpi_communicator);
solution_transfer.interpolate(distributed_solution);
old_solution_transfer.interpolate(distributed_old_solution);
boundary_constraints.distribute(distributed_solution);
boundary_constraints.distribute(distributed_old_solution);
present_solution = distributed_solution;
old_solution = distributed_old_solution;
setup_system(false);
}
and when checking the data before and after the mesh change, they look
similar (not equal due to changed refinements). How should I else check
those values?
Am Mittwoch, 18. Oktober 2017 14:18:01 UTC+2 schrieb Bruno Turcksin:
>
> Hi,
>
> On Wednesday, October 18, 2017 at 3:55:05 AM UTC-4, Maxi Miller wrote:
>
>> Apparently my old values are correct, but my old gradients are not. Thus
>> I am wondering if i getting the gradient values from the old solution in
>> an incorrect way, or is it correct?
>>
> Well did you check the values? Getting the gradient values from the old
> solution is fine but you need to be careful if you change the mesh.
>
> Best,
>
> Bruno
>
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.