@@ -138,6 +138,21 @@ function Quadrature(trian::Grid,::Algoim,phi::LevelSetFunction,degree::Int;kwarg
138
138
CompressedArray (cell_to_quad,1 : length (cell_to_quad))
139
139
end
140
140
141
+ function Quadrature (trian:: Grid ,:: Algoim ,phi:: LevelSetFunction ,
142
+ own_to_local:: AbstractVector ,degree:: Int ;kwargs... )
143
+ ctype_polytope = map (get_polytope,get_reffes (trian))
144
+ @notimplementedif ! all (map (is_n_cube,ctype_polytope))
145
+ cell_to_coords = get_cell_coordinates (trian)
146
+ cell_to_bboxes = collect1d (lazy_map (a-> (a[1 ],a[end ]),cell_to_coords))
147
+ jls = JuliaFunctionLevelSet (phi,Val {num_dims(trian)} ())
148
+ cell_to_quad = map (enumerate (cell_to_bboxes)) do (own_cell_id,bbox)
149
+ bbmin, bbmax = bbox
150
+ cell_id = own_to_local[own_cell_id]
151
+ Quadrature (cell_id,bbmin,bbmax,jls,phi,degree;kwargs... )
152
+ end
153
+ CompressedArray (cell_to_quad,1 : length (cell_to_quad))
154
+ end
155
+
141
156
function Quadrature (trian:: Grid ,:: Algoim ,
142
157
phi1:: LevelSetFunction ,phi2:: LevelSetFunction ,
143
158
degree:: Int ;kwargs... )
@@ -211,7 +226,13 @@ function _cell_quadrature_and_active_mask(trian::DistributedTriangulation,
211
226
phi:: DistributedAlgoimCallLevelSetFunction ,
212
227
args;kwargs)
213
228
ltrians = local_views (trian); lphis = local_views (phi)
214
- cell_quad = map ((t,p)-> Quadrature (t,algoim,p,args... ;kwargs... ),ltrians,lphis)
229
+ phitrian = get_triangulation (phi. values)
230
+ gids = get_cell_gids (get_background_model (phitrian))
231
+ own_to_local = map (local_views (phitrian),local_views (gids)) do t,g
232
+ findall (! iszero,local_to_own (g)[t. tface_to_mface])
233
+ end
234
+ cell_quad = map (
235
+ (t,p,otl)-> Quadrature (t,algoim,p,otl,args... ;kwargs... ),ltrians,lphis,own_to_local)
215
236
cell_to_is_active = map (cq-> is_cell_active (cq),cell_quad)
216
237
cell_quad, cell_to_is_active
217
238
end
@@ -736,7 +757,6 @@ function compute_distance_fe_function(
736
757
_compute_signed_distance (φ,cp,cos)
737
758
end
738
759
dists = PVector (_dists,partition (fespace. gids))
739
- consistent! (dists) |> wait
740
760
FEFunction (fespace,dists)
741
761
end
742
762
@@ -758,7 +778,6 @@ function compute_distance_fe_function(
758
778
_compute_signed_distance (φl,cp,cos)
759
779
end
760
780
dists = PVector (_dists,partition (fespace. gids))
761
- consistent! (dists) |> wait
762
781
FEFunction (fespace,dists)
763
782
end
764
783
0 commit comments