This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

refine command

+1 vote

Hello,

I have a simple question. Which refinement algorithm is used under "refine" command? Red-green or bisection?

Best regards,

asked Nov 15, 2016 by masur FEniCS Novice (320 points)

1 Answer

+1 vote

According to dolfin/refinement/refine.cpp it's either Bisection for 1D problems or Plaza and Carey's algorithm ("Local refinement of simplicial grids based on the skeleton") for 2D and 3D:

void dolfin::refine(Mesh& refined_mesh, const Mesh& mesh, bool redistribute)
{
  // Topological dimension
  const std::size_t D = mesh.topology().dim();

  const std::string refinement_algorithm = parameters["refinement_algorithm"];
  bool parent_facets = (refinement_algorithm == "plaza_with_parent_facets");

  // Dispatch to appropriate refinement function
  if (D == 1)
    BisectionRefinement1D::refine(refined_mesh, mesh, redistribute);
  else if(D == 2 or D == 3)
    PlazaRefinementND::refine(refined_mesh, mesh, redistribute, parent_facets);
  else
  (...)
answered Nov 16, 2016 by mdbenito FEniCS User (4,530 points)
...