Skip to content

Commit

Permalink
move most imports to the top
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Feb 9, 2023
1 parent ac722e7 commit e1380de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions firedrake/preconditioners/hiptmair.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

from firedrake.petsc import PETSc
from firedrake.preconditioners.base import PCBase
from firedrake.functionspace import FunctionSpace
from firedrake.ufl_expr import TestFunction, TrialFunction
from firedrake.preconditioners.hypre_ams import chop
from firedrake.parameters import parameters
from firedrake_citations import Citations
from firedrake.interpolation import Interpolator
from ufl.algorithms.ad import expand_derivatives
Expand All @@ -25,7 +29,6 @@ def coarsen(self, pc):

def initialize(self, pc):
from firedrake.assemble import allocate_matrix, TwoFormAssembler
from firedrake import parameters
A, P = pc.getOperators()
appctx = self.get_appctx(pc)
fcp = appctx.get("form_compiler_parameters")
Expand Down Expand Up @@ -137,7 +140,6 @@ class HiptmairPC(TwoLevelPC):
_prefix = "hiptmair_"

def coarsen(self, pc):
from firedrake import FunctionSpace, TestFunction, TrialFunction
Citations().register("Hiptmair1998")
appctx = self.get_appctx(pc)

Expand Down Expand Up @@ -192,7 +194,6 @@ def coarsen(self, pc):
coarse_operator += beta(test, shift*trial, coefficients={})

if G_callback is None:
from firedrake.preconditioners.hypre_ams import chop
interp_petscmat = chop(Interpolator(dminus(test), V, bcs=bcs + coarse_space_bcs).callable().handle)
else:
interp_petscmat = G_callback(V, coarse_space, bcs, coarse_space_bcs)
Expand Down

0 comments on commit e1380de

Please sign in to comment.