The attached code seems to work fine with DOLFIN 1.6.0dev.

Jan


On Wed, 22 Jul 2015 14:05:43 -0400
Jayanth Jagalur Mohan <[email protected]> wrote:

> Hello FEniCS folks,
> 
> I have been playing around with manual adaptivity using cell markers.
> While things work fine in 2D, I encounter an error in 1D.
> 
> Below is the relevant piece of code which might give people who know
> the routine some direction, and I have also listed subsequently the
> error message. Attached are files with complete codes.
> 
> To emphasize again, the code works fine in 2D.
> 
> Any help will be appreciated.
> 
> ###################
> 
> import numpy as np
> import dolfin as dfa
> 
>  cell_markers = df.CellFunction("bool",mesh)
>  cell_markers.set_all(False)
>  for cell in df.cells(mesh):
>       xc = df.MeshEntity.midpoint(cell).x()
>       urv = np.random.rand(1,1)
>        if xc > urv:
>           cell_markers[cell] = True
> 
> refMesh_nonUniform = df.refine(mesh,cell_markers)
> 
> ###################
> 
> ***
> -------------------------------------------------------------------------
> *** Error:   Unable to add cell using mesh editor.
> *** Reason:  Vertex index (18) out of range [0, 18).
> *** Where:   This error was encountered inside MeshEditor.cpp.
> *** Process: unknown
> ***
> *** DOLFIN version: 1.5.0
> *** Git changeset:  unknown
> ***
> -------------------------------------------------------------------------
> 
> 
> Thanks
> Jayanth
> 

_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to