Skip to content

Commit 2916572

Browse files
committed
tidy
1 parent 8f404e1 commit 2916572

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

firedrake/mg/netgen.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,25 +241,25 @@ def NetgenHierarchy(mesh, levs, flags, distribution_parameters=None):
241241
comm = mesh.comm
242242
# Parse netgen flags
243243
if not isinstance(flags, dict):
244-
flags = {}
244+
flags = mesh.netgen_flags
245245
order = flags.get("degree", 1)
246-
logger.info(f"\tOrder of the hierarchy: {order}")
247246
if isinstance(order, int):
248247
order = [order]*(levs+1)
248+
permutation_tol = flags.get("permutation_tol", 1e-8)
249249
refType = flags.get("refinement_type", "uniform")
250-
logger.info(f"\tRefinement type: {refType}")
251250
optMoves = flags.get("optimisation_moves", False)
252251
snap = flags.get("snap_to", "geometry")
253252
snap_smoothing = flags.get("snap_smoothing", "hyperelastic")
254-
logger.info(f"\tSnap to {snap} using {snap_smoothing} smoothing (if snapping to coarse)")
255253
cg = flags.get("cg", not mesh.coordinates.function_space().finat_element.is_dg())
256254
nested = flags.get("nested", snap in ["coarse"])
257-
permutation_tol = flags.get("permutation_tol", 1e-8)
255+
logger.info(f"\tOrder of the hierarchy: {order}")
256+
logger.info(f"\tRefinement type: {refType}")
257+
logger.info(f"\tSnap to {snap} using {snap_smoothing} smoothing (if snapping to coarse)")
258258
# Firedrake quantities
259259
meshes = []
260260
lgmaps = []
261261
# Curve the mesh
262-
if mesh.coordinates.function_space().ufl_element().degree() != order[0]:
262+
if order[0] != mesh.coordinates.function_space().ufl_element().degree():
263263
coordinates = mesh.curve_field(
264264
order=order[0],
265265
permutation_tol=permutation_tol,

firedrake/netgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class FiredrakeMesh:
135135
def __init__(self, mesh, netgen_flags=None, user_comm=fd.COMM_WORLD):
136136
self.comm = user_comm
137137
# Parsing netgen flags
138-
if netgen_flags is None:
138+
if not isinstance(netgen_flags, dict):
139139
netgen_flags = {}
140140
split2tets = netgen_flags.get("split_to_tets", False)
141141
split = netgen_flags.get("split", False)

firedrake/pointquery_utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@ def init_X(fiat_cell, parameters):
128128

129129

130130
@PETSc.Log.EventDecorator()
131-
def to_reference_coords_newton_step(ufl_coordinate_element, parameters,
132-
x0_dtype="double",
133-
dX_dtype=ScalarType,
134-
kernel_name="to_reference_coords_newton_step"):
131+
def to_reference_coords_newton_step(ufl_coordinate_element, parameters, x0_dtype="double", dX_dtype=ScalarType):
135132
# Set up UFL form
136133
cell = ufl_coordinate_element.cell
137134
domain = ufl.Mesh(ufl_coordinate_element)
@@ -194,7 +191,7 @@ def predicate(index):
194191
impero_c = impero_utils.compile_gem(assignments, ())
195192
kernel, _ = tsfc.loopy.generate(
196193
impero_c, loopy_args, ScalarType,
197-
kernel_name=kernel_name)
194+
kernel_name="to_reference_coords_newton_step")
198195
return lp.generate_code_v2(kernel).device_code()
199196

200197

0 commit comments

Comments
 (0)