← Back to team overview

dolfin team mailing list archive

Re: Mesh refinement broken

 

On Thu, Feb 03, 2011 at 10:58:43PM +0100, murtazo wrote:
> On 02/03/11 18:45, Anders Logg wrote:
> >On Thu, Feb 03, 2011 at 12:16:29PM +0100, Murtazo Nazarov wrote:
> >>On 02/02/2011 07:57 PM, Anders Logg wrote:
> >>>On Wed, Feb 02, 2011 at 06:56:02PM +0000, Garth N. Wells wrote:
> >>>>On 02/02/11 10:55, Anders Logg wrote:
> >>>>>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);
> >>How can I copy back the refined mesh into mesh? This does not work for me:
> >>
> >>   Mesh&  refined_mesh = refine(mesh1);
> >>   mesh1 = refined_mesh;
> >This is not allowed since you would overwrite the original mesh by its
> >own child (which would mess up the child-parent relationships of the
> >mesh).
> >
> >Either use refined_mesh, or mesh1.child().
>
> Yes, I would like to overwrite. I would like to create a mesh which
> is obtained by locally refining the initial mesh by many times. For
> this I need to overwrite the mesh, instead of defining many meshes
> with different names.

Try again. It should work now.

--
Anders



References