Function evaluation fails if the mesh has one element
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Fix Released
|
Undecided
|
Johan Hake |
Bug Description
In trying to debug a code, I wanted to work with a simple mesh.
But when I tried the simplest possible, a mesh consisting of a single
element, I discovered that the evaluation of functions in finite
element spaces doesn't work. For example this code fails:
from dolfin import *
mesh = Mesh("simplemes
Vh = FunctionSpace(mesh, 'CG', 1)
u = Function(Vh)
print u((.3,.6))
if simplemesh.xml is this one element mesh:
<?xml version="1.0"?>
<dolfin xmlns:dolfin="http://
<mesh celltype="triangle" dim="2">
<vertices size="3">
<vertex index="0" x="0" y="0" />
<vertex index="1" x="0" y="1" />
<vertex index="2" x="1" y="1" />
</vertices>
<cells size="1">
<triangle index="0" v0="0" v1="1" v2="2" />
</cells>
</mesh>
</dolfin>
If mesh has two elements, the code succeeds.
A bug? Is there a work around?
Related branches
Changed in dolfin: | |
status: | New → Confirmed |
Changed in dolfin: | |
status: | Confirmed → In Progress |
assignee: | nobody → Johan Hake (johan-hake) |
milestone: | none → trunk |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |
Changed in dolfin: | |
status: | Fix Released → Fix Committed |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |
It looks like a limitation in CGAL. The error I get is:
StandardError: CGAL ERROR: assertion violation! CGAL/AABB_ tree.h
Expr: m_primitives.size() > 1
File: /usr/include/
Line: 302
CGAL is used to check what element is intersected and then use that
element in the restriction. However, we need to check whether the point
is inside the element or not.
Johan
On 08/23/2012 12:07 AM, Doug Arnold wrote: h.xml") www.fenicsproje ct.org">
> Public bug reported:
>
> In trying to debug a code, I wanted to work with a simple mesh.
> But when I tried the simplest possible, a mesh consisting of a single
> element, I discovered that the evaluation of functions in finite
> element spaces doesn't work. For example this code fails:
>
> from dolfin import *
> mesh = Mesh("simplemes
> Vh = FunctionSpace(mesh, 'CG', 1)
> u = Function(Vh)
> print u((.3,.6))
>
> if simplemesh.xml is this one element mesh:
>
> <?xml version="1.0"?>
> <dolfin xmlns:dolfin="http://
> <mesh celltype="triangle" dim="2">
> <vertices size="3">
> <vertex index="0" x="0" y="0" />
> <vertex index="1" x="0" y="1" />
> <vertex index="2" x="1" y="1" />
> </vertices>
> <cells size="1">
> <triangle index="0" v0="0" v1="1" v2="2" />
> </cells>
> </mesh>
> </dolfin>
>
> If mesh has two elements, the code succeeds.
>
> A bug? Is there a work around?
>
> ** Affects: dolfin
> Importance: Undecided
> Status: New
>