Skip to content

Commit

Permalink
Fixes for Cell.geometric_dimension (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck authored Nov 20, 2024
1 parent 8ede8bd commit a645e06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ngsPETSc/utils/firedrake/hierarchies.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def NetgenHierarchy(mesh, levs, flags):
-degree, either an integer denoting the degree of curvature of all levels of
the mesh or a list of levs+1 integers denoting the degree of curvature of
each level of the mesh.
-tol, geometric tollerance adopted in snapToNetgenDMPlex.
-tol, geometric tolerance adopted in snapToNetgenDMPlex.
-refinement_type, the refinment type to be used: uniform (default), Alfeld
'''
if mesh.geometric_dimension() == 3:
Expand Down Expand Up @@ -238,8 +238,8 @@ def NetgenHierarchy(mesh, levs, flags):
if snap == "geometry":
snapToNetgenDMPlex(ngmesh, rdm)
#We construct a Firedrake mesh from the DMPlex mesh
mesh = fd.Mesh(rdm, dim=meshes[-1].ufl_cell().geometric_dimension(), reorder=False,
distribution_parameters=params, comm=comm)
mesh = fd.Mesh(rdm, dim=meshes[-1].geometric_dimension(), reorder=False,
distribution_parameters=params, comm=comm)
if optMoves:
#Optimises the mesh, for example smoothing
if ngmesh.dim == 2:
Expand Down
3 changes: 1 addition & 2 deletions ngsPETSc/utils/firedrake/meshes.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ def createFromTopology(self, topology, name, comm):
'''
cell = topology.ufl_cell()
geometric_dim = topology.topology_dm.getCoordinateDim()
cell = cell.reconstruct(geometric_dimension=geometric_dim)
element = fd.VectorElement("Lagrange", cell, 1)
element = fd.VectorElement("Lagrange", cell, 1, dim=geometric_dim)
# Create mesh object
self.firedrakeMesh = fd.MeshGeometry.__new__(fd.MeshGeometry, element, comm)
self.firedrakeMesh._init_topology(topology)
Expand Down

0 comments on commit a645e06

Please sign in to comment.