FFC

CellSize(mesh) looks wrong in 1D

Bug #1109200 reported by Garth Wells
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
FFC
Fix Released
Critical
Unassigned

Bug Description

I am writing some testing code for stabilisation methods (SU and the like) and need the size of the cells therefore. I thought in 1D the CellSize would be the size of the elements, i.e. 1/N if I have N equally sized elements; the same as the CellVolume. However, there is a factor of 2 between those and I don't know why. The documentation is unfortunately rather "sparse" on this issue. Can you please explain to me what CellSize exactly returns? Also in higher dimensions? Thanks a lot.

Here is some sample code, showing the issue:

In [10]: mesh=UnitInterval(10)
*** -------------------------------------------------------------------------
*** Warning: UnitInterval has been deprecated in DOLFIN version 1.1.0.
*** The class UnitInterval has been replaced by UnitIntervalMesh.
*** -------------------------------------------------------------------------

In [11]: assemble(CellVolume(mesh)*dx, mesh=mesh)
Out[11]: 0.1

In [12]: assemble(CellSize(mesh)*dx, mesh=mesh)
Out[12]: 0.2

Revision history for this message
Garth Wells (garth-wells) wrote :

Looks like a problem in ffc/codesnippets.py - should circumradius be divided by 2?

Changed in dolfin:
status: New → Confirmed
importance: Undecided → Critical
affects: dolfin → ffc
Changed in ffc:
status: Confirmed → Fix Committed
Johannes Ring (johannr)
Changed in ffc:
milestone: none → 1.2.0
Johannes Ring (johannr)
Changed in ffc:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.