@@ -32,7 +32,7 @@ class GetArgs(MetaData):
3232 pass
3333
3434
35- class SolveExpr (MetaData ):
35+ class SolverMetaData (MetaData ):
3636 """
3737 A symbolic expression passed through the Operator, containing the metadata
3838 needed to execute the PETSc solver.
@@ -59,7 +59,7 @@ def __new__(cls, expr, solver_parameters=None,
5959 obj .localinfo = localinfo
6060 obj .user_prefix = user_prefix
6161 obj .formatted_prefix = formatted_prefix
62- obj .get_info = get_info
62+ obj .get_info = get_info if get_info is not None else []
6363 return obj
6464
6565 def __repr__ (self ):
@@ -76,7 +76,7 @@ def _hashable_content(self):
7676 return (self .expr , self .formatted_prefix , self .solver_parameters )
7777
7878 def __eq__ (self , other ):
79- return (isinstance (other , SolveExpr ) and
79+ return (isinstance (other , SolverMetaData ) and
8080 self .expr == other .expr and
8181 self .formatted_prefix == other .formatted_prefix
8282 and self .solver_parameters == other .solver_parameters )
@@ -92,15 +92,15 @@ def eval(cls, *args):
9292 func = Reconstructable ._rebuild
9393
9494
95- class LinearSolveExpr ( SolveExpr ):
95+ class LinearSolverMetaData ( SolverMetaData ):
9696 """
9797 Linear problems are handled by setting the SNESType to 'ksponly',
9898 enabling a unified interface for both linear and nonlinear solvers.
9999 """
100100 pass
101101
102102
103- class NonLinearSolveExpr ( SolveExpr ):
103+ class NonLinearSolverMetaData ( SolverMetaData ):
104104 """
105105 TODO: Non linear solvers are not yet supported.
106106 """
@@ -109,7 +109,7 @@ class NonLinearSolveExpr(SolveExpr):
109109
110110class FieldData :
111111 """
112- Metadata for a single `target` field passed to `SolveExpr `.
112+ Metadata for a single `target` field passed to `SolverMetaData `.
113113 Used to interface with PETSc SNES solvers at the IET level.
114114
115115 Parameters
@@ -134,8 +134,8 @@ def __init__(self, target=None, jacobian=None, residual=None,
134134 petsc_precision = dtype_mapper [petsc_variables ['PETSC_PRECISION' ]]
135135 if self ._target .dtype != petsc_precision :
136136 raise TypeError (
137- f "Your target dtype must match the precision of your "
138- f "PETSc configuration. "
137+ "Your target dtype must match the precision of your "
138+ "PETSc configuration. "
139139 f"Expected { petsc_precision } , but got { self ._target .dtype } ."
140140 )
141141 self ._jacobian = jacobian
@@ -182,7 +182,7 @@ def targets(self):
182182
183183class MultipleFieldData (FieldData ):
184184 """
185- Metadata class passed to `SolveExpr `, for mixed-field problems,
185+ Metadata class passed to `SolverMetaData `, for mixed-field problems,
186186 where the solution vector spans multiple `targets`. Used to interface
187187 with PETSc SNES solvers at the IET level.
188188
0 commit comments