@@ -37,7 +37,7 @@ def __call__(self, kernel, v, cell):
3737 def convert_to_fiat (self , ref_el , dof , interpolant_deg ):
3838 pt = dof .eval (MyTestFunction (lambda * x : x ))
3939 return PointEvaluation (ref_el , pt )
40-
40+
4141 def get_pts (self , ref_el , total_degree ):
4242 entity = ref_el .construct_subelement (self .entity .dim ())
4343 return [(0 ,) * entity .get_spatial_dimension ()], [1 ], 1
@@ -272,24 +272,20 @@ def add_context(self, dof_gen, cell, space, g, overall_id=None, generator_id=Non
272272 self .sub_id = generator_id
273273
274274 def convert_to_fiat (self , ref_el , interpolant_degree ):
275- return self .pairing .convert_to_fiat (ref_el , self , interpolant_degree )
276-
277- def convert_to_fiat_new (self , ref_el , interpolant_degree ):
278275 total_degree = self .kernel .degree () + interpolant_degree
279276 pts , wts , jdet = self .pairing .get_pts (ref_el , total_degree )
280277 f_pts = self .kernel .tabulate (pts ).T / jdet
281278 # TODO need to work out how i can discover the shape in a better way
282279 if isinstance (self .pairing , DeltaPairing ):
283280 shp = tuple ()
284- pt_dict = {tuple (p ) : [(w , tuple ())] for (p , w ) in zip (f_pts .T , wts )}
281+ pt_dict = {tuple (p ): [(w , tuple ())] for (p , w ) in zip (f_pts .T , wts )}
285282 else :
286283 shp = tuple (f_pts .shape [:- 1 ])
287284 weights = np .transpose (np .multiply (f_pts , wts ), (- 1 ,) + tuple (range (len (shp ))))
288285 alphas = list (np .ndindex (shp ))
289286 pt_dict = {tuple (pt ): [(wt [alpha ], alpha ) for alpha in alphas ] for pt , wt in zip (pts , weights )}
290287
291- return Functional (ref_el , shp , pt_dict , {}, self .__repr__ ())
292-
288+ return [Functional (ref_el , shp , pt_dict , {}, self .__repr__ ())]
293289
294290 def __repr__ (self , fn = "v" ):
295291 return str (self .pairing ).format (fn = fn , kernel = self .kernel )
@@ -329,24 +325,24 @@ def tabulate(self, Qpts):
329325 immersion = self .target_space .tabulate (Qpts , self .trace_entity , self .g )
330326 res = self .kernel .tabulate (Qpts )
331327 return immersion * res
332-
333- def convert_to_fiat_new (self , ref_el , interpolant_degree ):
328+
329+ def convert_to_fiat (self , ref_el , interpolant_degree ):
334330 total_degree = self .kernel .degree () + interpolant_degree
335331 pts , wts , jdet = self .pairing .get_pts (ref_el , total_degree )
336332 f_pts = self .kernel .tabulate (pts , self .attachment )
337333 attached_pts = [self .attachment (* p ) for p in pts ]
338334 immersion = self .target_space .tabulate (f_pts , self .trace_entity , self .g )
339-
335+
340336 f_pts = (f_pts * immersion ).T / jdet
341- pt_dict , deriv_dict = self .target_space .convert_to_fiat (attached_pts , f_pts , wts )
337+ dict_list = self .target_space .convert_to_fiat (attached_pts , f_pts , wts )
342338
343339 # breakpoint()
344340 # TODO need to work out how i can discover the shape in a better way
345341 if isinstance (self .pairing , DeltaPairing ):
346342 shp = tuple ()
347343 else :
348344 shp = tuple (f_pts .shape [:- 1 ])
349- return Functional (ref_el , shp , pt_dict , deriv_dict , self .__repr__ ())
345+ return [ Functional (ref_el , shp , pt_dict , deriv_dict , self .__repr__ ()) for ( pt_dict , deriv_dict ) in dict_list ]
350346
351347 def __call__ (self , g ):
352348 permuted = self .cell .permute_entities (g , self .trace_entity .dim ())
0 commit comments