@@ -37,6 +37,7 @@ pub struct MixedGridBuilder<T: Scalar> {
3737 cell_ids_to_indices : HashMap < usize , usize > ,
3838 point_indices : HashSet < usize > ,
3939 cell_indices : HashSet < usize > ,
40+ parametric_coords : HashMap < usize , ( usize , Vec < T > ) > ,
4041}
4142
4243impl < T : Scalar > MixedGridBuilder < T > {
@@ -59,6 +60,7 @@ impl<T: Scalar> MixedGridBuilder<T> {
5960 cell_ids_to_indices : HashMap :: new ( ) ,
6061 point_indices : HashSet :: new ( ) ,
6162 cell_indices : HashSet :: new ( ) ,
63+ parametric_coords : HashMap :: new ( ) ,
6264 }
6365 }
6466}
@@ -207,6 +209,19 @@ impl<T: Scalar> Builder for MixedGridBuilder<T> {
207209 fn npts ( & self , cell_type : Self :: EntityDescriptor , degree : usize ) -> usize {
208210 self . points_per_cell [ self . element_indices [ & ( cell_type, degree) ] ]
209211 }
212+
213+ fn add_point_parametric_coords ( & mut self , id : usize , entity_dim : usize , coords : & [ T ] ) {
214+ if let Some ( & index) = self . point_ids_to_indices . get ( & id) {
215+ self . parametric_coords
216+ . insert ( index, ( entity_dim, coords. to_vec ( ) ) ) ;
217+ }
218+ }
219+
220+ fn point_parametric_coords ( & self , index : usize ) -> Option < ( usize , & [ T ] ) > {
221+ self . parametric_coords
222+ . get ( & index)
223+ . map ( |( dim, coords) | ( * dim, coords. as_slice ( ) ) )
224+ }
210225}
211226
212227impl < T : Scalar > GeometryBuilder for MixedGridBuilder < T > {
0 commit comments