← Back to team overview

dolfin team mailing list archive

Re: Mesh refinement broken

 

On Mon, Jan 31, 2011 at 09:40:19AM +0100, Anders Logg wrote:
> I'm working on a fix. The problem wasn't visible when DOLFIN_NOPLOT
> was not set.

This should now be fixed. There might still be some minor issues that
the buildbot will pick up.

Here's a short summary of what has changed:

1. The refine() function returns a reference to the refined mesh
instead of return-by-value in C++. The following no longer works:

  mesh = refine(mesh);

Instead, one must do

  Mesh& refined_mesh = refine(mesh);

or equivalently

  refine(mesh);
  Mesh& refined_mesh = mesh.child();

2. The refine() function works as expected in Python:

  mesh = refine(mesh)

should work fine since refine() returns a shared_ptr in Python.

3. A hierarchy of meshes is now stored as part of the mesh, accessed
by the parent() and child() functions. There are also coarse() and
fine() functions for accessing the coarsest and finest meshes in a
hierarchy.

4. Other classes like Function, FunctionSpace, Form, VariationalProblem
can now also been refined. This functionality is untested and will
need some further debugging before it can be used in the
AdaptiveVariationalSolver class.

--
Anders



Follow ups

References