@@ -688,15 +688,11 @@ def zero_memory(self):
688688 return False
689689
690690 def _make_core (self ):
691- injectsolve = self .injectsolve
692- all_fielddata = injectsolve .expr .rhs .fielddata
693-
694- for sm in all_fielddata .jacobian .nonzero_submatrices :
695- # arrays = all_fielddata.arrays[sm.row_target]
691+ for sm in self .fielddata .jacobian .nonzero_submatrices :
696692 self ._make_matvec (sm , prefix = f'{ sm .name } _MatMult' )
697693
698694 self ._make_whole_matvec ()
699- self ._make_whole_formfunc (all_fielddata )
695+ self ._make_whole_formfunc ()
700696 self ._make_user_struct_callback ()
701697 self ._create_submatrices ()
702698 self ._efuncs ['PopulateMatContext' ] = self .objs ['dummyefunc' ]
@@ -764,15 +760,15 @@ def _whole_matvec_body(self):
764760 retstmt = (Call ('PetscFunctionReturn' , arguments = [0 ]),)
765761 )
766762
767- def _make_whole_formfunc (self , fielddata ):
768- formfuncs = fielddata .residual .formfuncs
763+ def _make_whole_formfunc (self ):
764+ formfuncs = self . fielddata .residual .formfuncs
769765 # Compile formfunc `eqns` into an IET via recursive compilation
770766 irs_formfunc , _ = self .rcompile (
771767 formfuncs , options = {'mpi' : False }, sregistry = self .sregistry ,
772768 concretize_mapper = self .concretize_mapper
773769 )
774- body_formfunc = self ._whole_formfunc_body (List (body = irs_formfunc .uiet .body ),
775- fielddata )
770+ body_formfunc = self ._whole_formfunc_body (List (body = irs_formfunc .uiet .body ))
771+
776772 objs = self .objs
777773 cb = PETScCallable (
778774 self .sregistry .make_name (prefix = 'WholeFormFunc' ),
@@ -783,7 +779,7 @@ def _make_whole_formfunc(self, fielddata):
783779 self ._main_formfunc_callback = cb
784780 self ._efuncs [cb .name ] = cb
785781
786- def _whole_formfunc_body (self , body , fielddata ):
782+ def _whole_formfunc_body (self , body ):
787783 linsolve_expr = self .injectsolve .expr .rhs
788784 objs = self .objs
789785 sobjs = self .solver_objs
@@ -796,7 +792,7 @@ def _whole_formfunc_body(self, body, fielddata):
796792 fields = self ._dummy_fields (body )
797793 self ._struct_params .extend (fields )
798794
799- # Process body for residual callback, including generating bundles etc
795+ # Process body with bundles for residual callback
800796 bundles = sobjs ['bundles' ]
801797 fbundle = bundles ['f' ]
802798 xbundle = bundles ['x' ]
@@ -1143,7 +1139,6 @@ def _extend_build(self, base_dict):
11431139
11441140class CoupledObjectBuilder (BaseObjectBuilder ):
11451141 def _extend_build (self , base_dict ):
1146- injectsolve = self .injectsolve
11471142 sreg = self .sregistry
11481143 objs = self .objs
11491144 targets = self .fielddata .targets
@@ -1164,8 +1159,7 @@ def _extend_build(self, base_dict):
11641159 dim_labels [i ]: PetscInt (dim_labels [i ]) for i in range (space_dims )
11651160 })
11661161
1167- jacobian = injectsolve .expr .rhs .fielddata .jacobian
1168- submatrices = jacobian .nonzero_submatrices
1162+ submatrices = self .fielddata .jacobian .nonzero_submatrices
11691163
11701164 base_dict ['jacctx' ] = JacobianStruct (
11711165 name = sreg .make_name (prefix = objs ['ljacctx' ].name ),
0 commit comments