compute length of a specified edge
Hi all,
Below is the code I tested:
### Beginning of code
from dolfin import *
mesh = UnitSquare(1,1) # Only 2 cells in total
mesh.init() # Compute all the connectivity
c1 = Cell(mesh, 1) # choose cell with index "1"
f0, f1, f2 = c1.entities(1) # Pull out the connectivity information of cell "1"
for f in [f0, f1, f2]:
print "%d-th edge has length %g" % (f, c1.facet_area(f))
### End of code
And the error message reads,
*** Error: Unable to create mesh entity.
*** Reason: Mesh entity index 49 out of range [0, 5] for entity of dimension 1.
*** Where: This error was encountered inside MeshEntity.cpp.
*** -------
However, for this simple example, the facet indices of the 3 facets are (f0=3, f1=1, f2=4). Is this a bug or I did something stupid?
Thank you!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Blechta
- Solved:
- Last query:
- Last reply: