@@ -160,7 +160,7 @@ def cofunction(self, o):
160160 return Cofunction (W , val = MixedDat (o .dat [i ] for i in indices ))
161161
162162 def matrix (self , o ):
163- from firedrake .bcs import DirichletBC
163+ from firedrake .bcs import DirichletBC , EquationBCSplit
164164 ises = []
165165 args = []
166166 for a in o .arguments ():
@@ -180,6 +180,7 @@ def matrix(self, o):
180180 args .append (asplit )
181181
182182 submat = o .petscmat .createSubMatrix (* ises )
183+
183184 bcs = []
184185 spaces = [a .function_space () for a in o .arguments ()]
185186 for bc in o .bcs :
@@ -191,11 +192,14 @@ def matrix(self, o):
191192 V = args [number ].function_space ()
192193 field = self .blocks [number ]
193194 if isinstance (bc , DirichletBC ):
194- sub_bc = bc .reconstruct (field = field , V = V , g = bc .function_arg )
195- else :
196- raise NotImplementedError (f"Extracting matrix subblocks not supported with { type (bc ).__name__ } . Please get in touch if you need this." )
197- if sub_bc is not None :
198- bcs .append (sub_bc )
195+ bc_temp = bc .reconstruct (field = field , V = V , g = bc .function_arg , use_split = True )
196+ elif isinstance (bc , EquationBCSplit ):
197+ row_field = self .blocks [0 ]
198+ col_field = self .blocks [1 ]
199+ bc_temp = bc .reconstruct (field = field , V = V , row_field = row_field , col_field = col_field , use_split = True )
200+ if bc_temp is not None :
201+ bcs .append (bc_temp )
202+
199203 return AssembledMatrix (tuple (args ), tuple (bcs ), submat )
200204
201205 def zero_base_form (self , o ):
0 commit comments