Skip to content

Commit

Permalink
Solver updates (#219)
Browse files Browse the repository at this point in the history
Removing the obsolete _setup_problem_descrition in generic_solver.pyx
  • Loading branch information
julesghub authored Aug 3, 2024
1 parent cee864b commit d0b6f3b
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions src/underworld3/cython/petsc_generic_snes_solvers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -190,27 +190,6 @@ class SolverBaseClass(uw_object):
return



# Deprecate in favour of properties for solver.F0, solver.F1
#
@timing.routine_timer_decorator
def _setup_problem_description(self):

## Derived classes may over-ride these methods to better match the equation template.

# We might choose to modify the definition of F0 / F1
# by changing this function in a sub-class
# For example, to simplify the user interface by pre-definining
# the form of the input. See the projector class for an example

# f0 residual term (weighted integration) - scalar RHS function
self._f0 = self.F0 # some_expression_F0(self.u.sym, self.Unknowns.L)

# f1 residual term (integration by parts / gradients)
self._f1 = self.F1 # some_expresion_F1(self.u.sym, self.Unknowns.L)

return

@timing.routine_timer_decorator
def add_condition(self, f_id, c_type, conds, label, components=None):
"""
Expand Down Expand Up @@ -710,15 +689,6 @@ class SNES_Scalar(SolverBaseClass):

sympy.core.cache.clear_cache()

## The residual terms describe the problem and
## can be changed by the user in inherited classes

if callable(self._setup_problem_description):
self._setup_problem_description()

## The jacobians are determined from the above (assuming we
## do not concern ourselves with the zeros)

# f0 = sympy.Array(self._f0).reshape(1).as_immutable()
# F1 = sympy.Array(self._f1).reshape(dim).as_immutable()

Expand Down Expand Up @@ -1322,9 +1292,6 @@ class SNES_Vector(SolverBaseClass):

sympy.core.cache.clear_cache()

if callable(self._setup_problem_description):
self._setup_problem_description()

## The jacobians are determined from the above (assuming we
## do not concern ourselves with the zeros)
## Convert to arrays for the moment to allow 1D arrays (size dim, not 1xdim)
Expand Down Expand Up @@ -2100,23 +2067,6 @@ class SNES_Stokes_SaddlePt(SolverBaseClass):

return

@timing.routine_timer_decorator
def _setup_problem_description(self):

# residual terms can be redefined by
# writing your own version of this method

# terms that become part of the weighted integral
self._u_f0 = self.F0 # some_expression_u_f0(_V,_P. L, _G)

# Integration by parts into the stiffness matrix
self._u_f1 = self.F1 # some_expression_u_f1(_V,_P, L, _G)

# rhs in the constraint (pressure) equations
self._p_f0 = self.PF0 # some_expression_p_f0(_V,_P, L, _G)

return

def validate_solver(self):
"""Checks to see if the required properties have been set"""

Expand Down Expand Up @@ -2162,10 +2112,6 @@ class SNES_Stokes_SaddlePt(SolverBaseClass):

# r = self.mesh.CoordinateSystem.N[0]

# residual terms
if callable(self._setup_problem_description):
self._setup_problem_description()

# Array form to work well with what is below
# The basis functions are 3-vectors by default, even for 2D meshes, soooo ...
# F0 = sympy.Array(self._u_f0) #.reshape(dim)
Expand Down

0 comments on commit d0b6f3b

Please sign in to comment.