I have an interest in building of a time-dependent phase-field solver with the possibility of mesh adaptivity. I want to ask if there are some examples in the usage of
Thank you for the answer. If i have right understood, in this solver they use remeshing for mesh coarsening, which is not the best solution. In opposite MeshHierarchy class posses method coarsen().
If you look in the source code, the “coarsen()” method does exactly the same.
// Set up refinement markers to re-refine the parent mesh
MeshFunction edge_markers(parent_mesh, 1, false);
const std::map<std::size_t, std::size_t>& edge_to_vertex
= *(_relation->edge_to_global_vertex);
// Find edges which were previously refined, but now only mark them
// if not a parent of a “coarsening” vertex
for (EdgeIterator e(*parent_mesh); !e.end(); ++e)
{
auto edge_it = edge_to_vertex.find(e->index());
if (edge_it != edge_to_vertex.end())
{
// Previously refined edge: find child vertex
const std::size_t child_vertex_global_index = edge_it->second;
if (coarsening_vertices.find(child_vertex_global_index)
== coarsening_vertices.end())
{
// Not a “coarsening” vertex, so mark edge for refinement
edge_markers[*e] = true;
}
}
}