template <int dim>
void
PlasticityContactProblem<dim>::
move_mesh (const TrilinosWrappers::MPI::Vector &displacement) const
{
std::vector<bool> vertex_touched(triangulation.n_vertices(), false);
for (typename DoFHandler<dim>::active_cell_iterator cell =
dof_handler.begin_active();
cell != dof_handler.end(); ++cell)
if (cell->is_locally_owned())
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
if (vertex_touched[cell->vertex_index(v)] == false)
{
vertex_touched[cell->vertex_index(v)] = true;
Point<dim> vertex_displacement;
for (unsigned int d = 0; d < dim; ++d)
vertex_displacement[d] = displacement(cell->vertex_dof_index(v, d));
cell->vertex(v) += vertex_displacement;
}
}
2. To move the ghost cells on the domain as well, is it just sufficient to replace the if condition above with
if (cell->is_locally_owned()) => if (cell->is_ghost()) ?
1. After the p:d:triangulation is created and triangulation.global_refine(2) is used, the locally owned cells on each mesh will divide in 2^dim elements each but does that also mean that the ghost cells or artificial cells on each processor also gets refined ?
2. To move the ghost cells on the domain as well, is it just sufficient to replace the if condition above with
if (cell->is_locally_owned()) => if (cell->is_ghost()) ?and the displacement is a ghosted vector.
in the documentation , it's said in the case of mesh with moved vertices is refined a few step later, should do as follows:1. save the offset applied to every vertex,2. call communicate_locally_moved_vertices function3. apply the opposite offset4. call communicate_local refining or coarsening the meshly_moved_vertices function5. refining or coarsening the meshi don't quite understand the 5 step.1. what's the meaning of offset here? is it the move vector for every vectices in this step, or the whole move vector which will make the mesh return to original mesh?
2. we add the opposite offset , does this means we need apply the offset again after refining or coarsening ?