I cant find 'FacetFunction' anywhere

Asked by Rymoon

1.
from __future__ import print_function
from fenics import *
from boxfield import *
import numpy as np
...
 boundary_markers = FacetFunction('size_t', mesh)
...

Then it failed with message below:

from boxfield import *
ModuleNotFoundError: No module named 'boxfield'

I dont know what is "boxfield".So I just remove the line.

2.
from __future__ import print_function
from fenics import *
#from boxfield import *
import numpy as np
...
 boundary_markers = FacetFunction('size_t', mesh)
...

Then it failed with message below:

 boundary_markers = FacetFunction('size_t', mesh)
NameError: name 'FacetFunction' is not defined

3.
In documentation of Fenics/Dolfin, i found that there is a'FacetFunction' at ' dolfin.cpp.mesh.FaceFunction' .
But when I try to import it,it failed .

>>> import dolfin.cpp.mesh as ms
>>> ms.FacetFunction
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'dolfin.cpp.mesh' has no attribute 'FacetFunction'

Then I look into the reault of "dir(dolfin.cpp.mesh)".

>>> dir(dolfin.cpp.mesh)
['BoundaryMesh', 'Cell', 'CellIterator', 'CellType', 'DomainBoundary', 'Edge', 'EdgeIterator', 'Face', 'FaceIterator', 'Facet', 'FacetIterator', 'Mesh', 'MeshColoring', 'MeshConnectivity', 'MeshData', 'MeshDomains', 'MeshEditor', 'MeshEntity', 'MeshEntityIterator', 'MeshFunctionBool', 'MeshFunctionDouble', 'MeshFunctionInt', 'MeshFunctionSizet', 'MeshGeometry', 'MeshQuality', 'MeshTopology', 'MeshTransformation', 'MeshValueCollection_bool', 'MeshValueCollection_double', 'MeshValueCollection_int', 'MeshValueCollection_sizet', 'MultiMesh', 'PeriodicBoundaryComputation', 'SubDomain', 'SubMesh', 'SubsetIterator', 'Vertex', 'VertexIterator', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'cells', 'edges', 'entities', 'faces', 'facets', 'make_dolfin_subdomain', 'vertices']

Many Functions and classes are missing. For example,"dolfin.cpp.mesh.CellFunction","dolfin.cpp.FacetFunction".
But they are descripted in documentation and used in Demos of Fenics Tutorials.

What should I do?

Question information

Language:
English Edit question
Status:
Expired
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.