9#include <kernel/geometry/index_set.hpp>
10#include <kernel/geometry/intern/entity_counter.hpp>
11#include <kernel/geometry/intern/standard_refinement_traits.hpp>
12#include <kernel/geometry/intern/sub_index_mapping.hpp>
25 struct StandardIndexRefiner;
33 struct StandardIndexRefiner<Shape::Simplex<1>, 1, 0>
35 static constexpr int shape_dim = 1;
36 static constexpr int cell_dim = 1;
37 static constexpr int face_dim = 0;
39 typedef Shape::Simplex<shape_dim> ShapeType;
40 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
41 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
42 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
45 IndexSetType& index_set_out,
47 const Index index_offsets[],
48 const IndexSetHolderType& index_set_holder_in)
51 const Index iov = index_offsets[0];
52 const Index ioe = index_offsets[1];
55 typedef IndexSetType::IndexTupleType IndexTupleType;
58 typedef IndexSet<2> IndexSetTypeEV;
61 typedef IndexSetTypeEV::IndexTupleType IndexTupleTypeEV;
64 const IndexSetTypeEV& index_set_e_v = index_set_holder_in.get_index_set<1,0>();
67 const Index num_edges = index_set_e_v.get_num_entities();
70 FEAT_PRAGMA_OMP(parallel
for)
71 for(Index i = 0; i < num_edges; ++i)
74 const IndexTupleTypeEV& e_v = index_set_e_v[i];
77 IndexTupleType& idx0 = index_set_out[offset + 2*i + 0];
78 IndexTupleType& idx1 = index_set_out[offset + 2*i + 1];
81 idx0[0] = iov + e_v[0];
84 idx1[1] = iov + e_v[1];
102 struct StandardIndexRefiner<Shape::Simplex<2>, 1, 0>
104 static constexpr int shape_dim = 2;
105 static constexpr int cell_dim = 1;
106 static constexpr int face_dim = 0;
108 typedef Shape::Simplex<shape_dim> ShapeType;
109 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
110 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
111 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
114 IndexSetType& index_set_out,
116 const Index index_offsets[],
117 const IndexSetHolderType& index_set_holder_in)
120 const Index ioe = index_offsets[1];
123 typedef IndexSetType::IndexTupleType IndexTupleType;
126 typedef IndexSet<3> IndexSetTypeSE;
129 typedef IndexSetTypeSE::IndexTupleType IndexTupleTypeSE;
132 const IndexSetTypeSE& index_set_s_e = index_set_holder_in.get_index_set<2,1>();
135 const Index num_simps = index_set_s_e.get_num_entities();
154 FEAT_PRAGMA_OMP(parallel
for)
155 for(Index i = 0; i < num_simps; ++i)
158 const IndexTupleTypeSE& s_e = index_set_s_e[i];
161 IndexTupleType& e_0 = index_set_out[offset + 3*i + 0];
162 IndexTupleType& e_1 = index_set_out[offset + 3*i + 1];
163 IndexTupleType& e_2 = index_set_out[offset + 3*i + 2];
165 e_0[0] = ioe + s_e[2];
166 e_0[1] = ioe + s_e[1];
168 e_1[0] = ioe + s_e[0];
169 e_1[1] = ioe + s_e[2];
171 e_2[0] = ioe + s_e[1];
172 e_2[1] = ioe + s_e[0];
186 struct StandardIndexRefiner<Shape::Simplex<2>, 2, 0>
188 static constexpr int shape_dim = 2;
189 static constexpr int cell_dim = 2;
190 static constexpr int face_dim = 0;
192 typedef Shape::Simplex<shape_dim> ShapeType;
193 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
194 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
195 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
198 IndexSetType& index_set_out,
200 const Index index_offsets[],
201 const IndexSetHolderType& index_set_holder_in)
204 const Index iov = index_offsets[0];
205 const Index ioe = index_offsets[1];
208 typedef IndexSetType::IndexTupleType IndexTupleType;
211 typedef IndexSet<3> IndexSetTypeSV;
212 typedef IndexSet<3> IndexSetTypeSE;
215 typedef IndexSetTypeSV::IndexTupleType IndexTupleTypeSV;
216 typedef IndexSetTypeSE::IndexTupleType IndexTupleTypeSE;
219 const IndexSetTypeSV& index_set_s_v = index_set_holder_in.get_index_set<2,0>();
220 const IndexSetTypeSE& index_set_s_e = index_set_holder_in.get_index_set<2,1>();
223 const Index num_simps = index_set_s_v.get_num_entities();
242 FEAT_PRAGMA_OMP(parallel
for)
243 for(Index i = 0; i < num_simps; ++i)
246 const IndexTupleTypeSV& s_v = index_set_s_v[i];
247 const IndexTupleTypeSE& s_e = index_set_s_e[i];
250 IndexTupleType& s_0 = index_set_out[offset + 4*i + 0];
251 IndexTupleType& s_1 = index_set_out[offset + 4*i + 1];
252 IndexTupleType& s_2 = index_set_out[offset + 4*i + 2];
253 IndexTupleType& s_3 = index_set_out[offset + 4*i + 3];
256 s_0[0] = iov + s_v[0];
257 s_0[1] = ioe + s_e[2];
258 s_0[2] = ioe + s_e[1];
260 s_1[0] = ioe + s_e[2];
261 s_1[1] = iov + s_v[1];
262 s_1[2] = ioe + s_e[0];
264 s_2[0] = ioe + s_e[1];
265 s_2[1] = ioe + s_e[0];
266 s_2[2] = iov + s_v[2];
268 s_3[0] = ioe + s_e[0];
269 s_3[1] = ioe + s_e[1];
270 s_3[2] = ioe + s_e[2];
283 struct StandardIndexRefiner<Shape::Simplex<2>, 2, 1>
285 static constexpr int shape_dim = 2;
286 static constexpr int cell_dim = 2;
287 static constexpr int face_dim = 1;
289 typedef Shape::Simplex<shape_dim> ShapeType;
290 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
291 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
292 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
295 IndexSetType& index_set_out,
297 const Index index_offsets[],
298 const IndexSetHolderType& index_set_holder_in)
301 const Index ioe = index_offsets[1];
302 const Index ios = index_offsets[2];
305 typedef IndexSetType::IndexTupleType IndexTupleType;
308 typedef IndexSet<2> IndexSetTypeEV;
309 typedef IndexSet<3> IndexSetTypeSV;
310 typedef IndexSet<3> IndexSetTypeSE;
313 typedef IndexSetTypeSV::IndexTupleType IndexTupleTypeSV;
314 typedef IndexSetTypeSE::IndexTupleType IndexTupleTypeSE;
317 const IndexSetTypeEV& index_set_e_v = index_set_holder_in.get_index_set<1,0>();
318 const IndexSetTypeSV& index_set_s_v = index_set_holder_in.get_index_set<2,0>();
319 const IndexSetTypeSE& index_set_s_e = index_set_holder_in.get_index_set<2,1>();
322 const Index num_simps = index_set_s_v.get_num_entities();
325 typedef Intern::SubIndexMapping<ShapeType, face_dim, 0> SubIndexMappingType;
344 FEAT_PRAGMA_OMP(parallel
for)
345 for(Index i = 0; i < num_simps; ++i)
348 const IndexTupleTypeSV& s_v = index_set_s_v[i];
349 const IndexTupleTypeSE& s_e = index_set_s_e[i];
352 SubIndexMappingType sim(s_v, s_e, index_set_e_v);
355 IndexTupleType& s_0 = index_set_out[offset + 4*i + 0];
356 IndexTupleType& s_1 = index_set_out[offset + 4*i + 1];
357 IndexTupleType& s_2 = index_set_out[offset + 4*i + 2];
358 IndexTupleType& s_3 = index_set_out[offset + 4*i + 3];
361 s_0[0] = ios + 3*i + 0;
362 s_0[1] = ioe + 2*s_e[1] + sim.map(1, 1);
363 s_0[2] = ioe + 2*s_e[2] + sim.map(2, 0);
365 s_1[0] = ioe + 2*s_e[0] + sim.map(0, 0);
366 s_1[1] = ios + 3*i + 1;
367 s_1[2] = ioe + 2*s_e[2] + sim.map(2, 1);
369 s_2[0] = ioe + 2*s_e[0] + sim.map(0, 1);
370 s_2[1] = ioe + 2*s_e[1] + sim.map(1, 0);
371 s_2[2] = ios + 3*i + 2;
373 s_3[0] = ios + 3*i + 0;
374 s_3[1] = ios + 3*i + 1;
375 s_3[2] = ios + 3*i + 2;
393 struct StandardIndexRefiner<Shape::Simplex<3>, 1, 0>
395 static constexpr int shape_dim = 3;
396 static constexpr int cell_dim = 1;
397 static constexpr int face_dim = 0;
399 typedef Shape::Simplex<shape_dim> ShapeType;
400 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
401 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
402 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
405 IndexSetType& index_set_out,
407 const Index index_offsets[],
408 const IndexSetHolderType& index_set_holder_in)
411 const Index ioe = index_offsets[1];
412 const Index ios = index_offsets[3];
415 typedef IndexSetType::IndexTupleType IndexTupleType;
418 typedef IndexSet<6> IndexSetTypeSE;
421 typedef IndexSetTypeSE::IndexTupleType IndexTupleTypeSE;
424 const IndexSetTypeSE& index_set_s_e = index_set_holder_in.get_index_set<3,1>();
427 const Index num_simps = index_set_s_e.get_num_entities();
465 FEAT_PRAGMA_OMP(parallel
for)
466 for(Index i = 0; i < num_simps; ++i)
469 const IndexTupleTypeSE& s_e = index_set_s_e[i];
472 IndexTupleType& e_0 = index_set_out[offset + 6*i + 0];
473 IndexTupleType& e_1 = index_set_out[offset + 6*i + 1];
474 IndexTupleType& e_2 = index_set_out[offset + 6*i + 2];
475 IndexTupleType& e_3 = index_set_out[offset + 6*i + 3];
476 IndexTupleType& e_4 = index_set_out[offset + 6*i + 4];
477 IndexTupleType& e_5 = index_set_out[offset + 6*i + 5];
479 e_0[0] = ioe + s_e[0];
482 e_1[0] = ioe + s_e[1];
485 e_2[0] = ioe + s_e[2];
488 e_3[0] = ioe + s_e[3];
491 e_4[0] = ioe + s_e[4];
494 e_5[0] = ioe + s_e[5];
509 struct StandardIndexRefiner<Shape::Simplex<3>, 2, 0>
511 static constexpr int shape_dim = 3;
512 static constexpr int cell_dim = 2;
513 static constexpr int face_dim = 0;
515 typedef Shape::Simplex<shape_dim> ShapeType;
516 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
517 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
518 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
521 IndexSetType& index_set_out,
523 const Index index_offsets[],
524 const IndexSetHolderType& index_set_holder_in)
527 const Index ioe = index_offsets[1];
528 const Index ios = index_offsets[3];
531 typedef IndexSetType::IndexTupleType IndexTupleType;
534 typedef IndexSet<4> IndexSetTypeST;
535 typedef IndexSet<6> IndexSetTypeSE;
538 typedef IndexSetTypeSE::IndexTupleType IndexTupleTypeSE;
541 const IndexSetTypeST& index_set_s_t = index_set_holder_in.get_index_set<3,2>();
542 const IndexSetTypeSE& index_set_s_e = index_set_holder_in.get_index_set<3,1>();
545 const Index num_simps = index_set_s_t.get_num_entities();
582 FEAT_PRAGMA_OMP(parallel
for)
583 for(Index i = 0; i < num_simps; ++i)
586 const IndexTupleTypeSE& s_e = index_set_s_e[i];
589 IndexTupleType& t_0 = index_set_out[offset + 16*i + 0];
590 IndexTupleType& t_1 = index_set_out[offset + 16*i + 1];
591 IndexTupleType& t_2 = index_set_out[offset + 16*i + 2];
592 IndexTupleType& t_3 = index_set_out[offset + 16*i + 3];
593 IndexTupleType& t_4 = index_set_out[offset + 16*i + 4];
594 IndexTupleType& t_5 = index_set_out[offset + 16*i + 5];
595 IndexTupleType& t_6 = index_set_out[offset + 16*i + 6];
596 IndexTupleType& t_7 = index_set_out[offset + 16*i + 7];
597 IndexTupleType& t_8 = index_set_out[offset + 16*i + 8];
598 IndexTupleType& t_9 = index_set_out[offset + 16*i + 9];
599 IndexTupleType& t_10 = index_set_out[offset + 16*i + 10];
600 IndexTupleType& t_11 = index_set_out[offset + 16*i + 11];
601 IndexTupleType& t_12 = index_set_out[offset + 16*i + 12];
602 IndexTupleType& t_13 = index_set_out[offset + 16*i + 13];
603 IndexTupleType& t_14 = index_set_out[offset + 16*i + 14];
604 IndexTupleType& t_15 = index_set_out[offset + 16*i + 15];
609 t_0[0] = ioe + s_e[0];
610 t_0[1] = ioe + s_e[1];
611 t_0[2] = ioe + s_e[2];
613 t_1[0] = ioe + s_e[0];
614 t_1[1] = ioe + s_e[3];
615 t_1[2] = ioe + s_e[4];
617 t_2[0] = ioe + s_e[1];
618 t_2[1] = ioe + s_e[3];
619 t_2[2] = ioe + s_e[5];
621 t_3[0] = ioe + s_e[2];
622 t_3[1] = ioe + s_e[4];
623 t_3[2] = ioe + s_e[5];
626 t_4[0] = ioe + s_e[0];
627 t_4[1] = ioe + s_e[1];
630 t_5[0] = ioe + s_e[0];
631 t_5[1] = ioe + s_e[2];
634 t_6[0] = ioe + s_e[0];
635 t_6[1] = ioe + s_e[3];
638 t_7[0] = ioe + s_e[0];
639 t_7[1] = ioe + s_e[4];
642 t_8[0] = ioe + s_e[1];
643 t_8[1] = ioe + s_e[2];
646 t_9[0] = ioe + s_e[1];
647 t_9[1] = ioe + s_e[3];
650 t_10[0] = ioe + s_e[1];
651 t_10[1] = ioe + s_e[5];
654 t_11[0] = ioe + s_e[2];
655 t_11[1] = ioe + s_e[4];
658 t_12[0] = ioe + s_e[2];
659 t_12[1] = ioe + s_e[5];
662 t_13[0] = ioe + s_e[3];
663 t_13[1] = ioe + s_e[4];
666 t_14[0] = ioe + s_e[3];
667 t_14[1] = ioe + s_e[5];
670 t_15[0] = ioe + s_e[4];
671 t_15[1] = ioe + s_e[5];
686 struct StandardIndexRefiner<Shape::Simplex<3>, 3, 0>
688 static constexpr int shape_dim = 3;
689 static constexpr int cell_dim = 3;
690 static constexpr int face_dim = 0;
692 typedef Shape::Simplex<shape_dim> ShapeType;
693 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
694 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
695 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
698 IndexSetType& index_set_out,
700 const Index index_offsets[],
701 const IndexSetHolderType& index_set_holder_in)
704 const Index iov = index_offsets[0];
705 const Index ioe = index_offsets[1];
706 const Index ios = index_offsets[3];
709 typedef IndexSetType::IndexTupleType IndexTupleType;
712 typedef IndexSet<4> IndexSetTypeST;
713 typedef IndexSet<6> IndexSetTypeSE;
714 typedef IndexSet<4> IndexSetTypeSV;
717 typedef IndexSetTypeSE::IndexTupleType IndexTupleTypeSE;
718 typedef IndexSetTypeSV::IndexTupleType IndexTupleTypeSV;
721 const IndexSetTypeST& index_set_s_t = index_set_holder_in.get_index_set<3,2>();
722 const IndexSetTypeSE& index_set_s_e = index_set_holder_in.get_index_set<3,1>();
723 const IndexSetTypeSV& index_set_s_v = index_set_holder_in.get_index_set<3,0>();
726 const Index num_simps = index_set_s_t.get_num_entities();
763 FEAT_PRAGMA_OMP(parallel
for)
764 for(Index i = 0; i < num_simps; ++i)
767 const IndexTupleTypeSE& s_e = index_set_s_e[i];
768 const IndexTupleTypeSV& s_v = index_set_s_v[i];
771 IndexTupleType& s_0 = index_set_out[offset + 12*i + 0];
772 IndexTupleType& s_1 = index_set_out[offset + 12*i + 1];
773 IndexTupleType& s_2 = index_set_out[offset + 12*i + 2];
774 IndexTupleType& s_3 = index_set_out[offset + 12*i + 3];
775 IndexTupleType& s_4 = index_set_out[offset + 12*i + 4];
776 IndexTupleType& s_5 = index_set_out[offset + 12*i + 5];
777 IndexTupleType& s_6 = index_set_out[offset + 12*i + 6];
778 IndexTupleType& s_7 = index_set_out[offset + 12*i + 7];
779 IndexTupleType& s_8 = index_set_out[offset + 12*i + 8];
780 IndexTupleType& s_9 = index_set_out[offset + 12*i + 9];
781 IndexTupleType& s_10 = index_set_out[offset + 12*i + 10];
782 IndexTupleType& s_11 = index_set_out[offset + 12*i + 11];
789 s_0[0] = ioe + s_e[0];
790 s_0[1] = ioe + s_e[2];
791 s_0[2] = ioe + s_e[1];
792 s_0[3] = iov + s_v[0];
794 s_1[0] = ioe + s_e[0];
795 s_1[1] = ioe + s_e[1];
796 s_1[2] = ioe + s_e[2];
800 s_2[0] = ioe + s_e[0];
801 s_2[1] = ioe + s_e[3];
802 s_2[2] = ioe + s_e[4];
803 s_2[3] = iov + s_v[1];
805 s_3[0] = ioe + s_e[0];
806 s_3[1] = ioe + s_e[4];
807 s_3[2] = ioe + s_e[3];
811 s_4[0] = ioe + s_e[1];
812 s_4[1] = ioe + s_e[5];
813 s_4[2] = ioe + s_e[3];
814 s_4[3] = iov + s_v[2];
816 s_5[0] = ioe + s_e[1];
817 s_5[1] = ioe + s_e[3];
818 s_5[2] = ioe + s_e[5];
822 s_6[0] = ioe + s_e[2];
823 s_6[1] = ioe + s_e[4];
824 s_6[2] = ioe + s_e[5];
825 s_6[3] = iov + s_v[3];
827 s_7[0] = ioe + s_e[2];
828 s_7[1] = ioe + s_e[5];
829 s_7[2] = ioe + s_e[4];
834 s_8[0] = ioe + s_e[3];
835 s_8[1] = ioe + s_e[4];
836 s_8[2] = ioe + s_e[5];
839 s_9[0] = ioe + s_e[1];
840 s_9[1] = ioe + s_e[5];
841 s_9[2] = ioe + s_e[2];
844 s_10[0] = ioe + s_e[0];
845 s_10[1] = ioe + s_e[2];
846 s_10[2] = ioe + s_e[4];
849 s_11[0] = ioe + s_e[0];
850 s_11[1] = ioe + s_e[3];
851 s_11[2] = ioe + s_e[1];
865 struct StandardIndexRefiner<Shape::Simplex<3>, 2, 1>
867 static constexpr int shape_dim = 3;
868 static constexpr int cell_dim = 2;
869 static constexpr int face_dim = 1;
871 typedef Shape::Simplex<shape_dim> ShapeType;
872 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
873 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
874 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
877 IndexSetType& index_set_out,
879 const Index index_offsets[],
880 const IndexSetHolderType& index_set_holder_in)
883 const Index iot = index_offsets[2];
884 const Index ios = index_offsets[3];
887 typedef IndexSetType::IndexTupleType IndexTupleType;
890 typedef IndexSet<3> IndexSetTypeTV;
891 typedef IndexSet<4> IndexSetTypeSV;
892 typedef IndexSet<4> IndexSetTypeST;
895 typedef IndexSetTypeSV::IndexTupleType IndexTupleTypeSV;
896 typedef IndexSetTypeST::IndexTupleType IndexTupleTypeST;
899 const IndexSetTypeSV& index_set_s_v = index_set_holder_in.get_index_set<3,0>();
900 const IndexSetTypeST& index_set_s_t = index_set_holder_in.get_index_set<3,2>();
901 const IndexSetTypeTV& index_set_t_v = index_set_holder_in.get_index_set<2,0>();
904 const Index num_simps = index_set_s_t.get_num_entities();
907 typedef Intern::SubIndexMapping<ShapeType, cell_dim, face_dim> SubIndexMappingType;
910 FEAT_PRAGMA_OMP(parallel
for)
911 for(Index i = 0; i < num_simps; ++i)
914 const IndexTupleTypeSV& s_v = index_set_s_v[i];
915 const IndexTupleTypeST& s_t = index_set_s_t[i];
918 SubIndexMappingType sim(s_v, s_t, index_set_t_v);
921 IndexTupleType& t_0 = index_set_out[offset + 16*i + 0];
922 IndexTupleType& t_1 = index_set_out[offset + 16*i + 1];
923 IndexTupleType& t_2 = index_set_out[offset + 16*i + 2];
924 IndexTupleType& t_3 = index_set_out[offset + 16*i + 3];
925 IndexTupleType& t_4 = index_set_out[offset + 16*i + 4];
926 IndexTupleType& t_5 = index_set_out[offset + 16*i + 5];
927 IndexTupleType& t_6 = index_set_out[offset + 16*i + 6];
928 IndexTupleType& t_7 = index_set_out[offset + 16*i + 7];
929 IndexTupleType& t_8 = index_set_out[offset + 16*i + 8];
930 IndexTupleType& t_9 = index_set_out[offset + 16*i + 9];
931 IndexTupleType& t_10 = index_set_out[offset + 16*i + 10];
932 IndexTupleType& t_11 = index_set_out[offset + 16*i + 11];
933 IndexTupleType& t_12 = index_set_out[offset + 16*i + 12];
934 IndexTupleType& t_13 = index_set_out[offset + 16*i + 13];
935 IndexTupleType& t_14 = index_set_out[offset + 16*i + 14];
936 IndexTupleType& t_15 = index_set_out[offset + 16*i + 15];
941 t_0[0] = iot + 3*s_t[1] + sim.map(1, 0);
942 t_0[1] = iot + 3*s_t[2] + sim.map(2, 0);
943 t_0[2] = iot + 3*s_t[3] + sim.map(3, 0);
945 t_1[0] = iot + 3*s_t[0] + sim.map(0, 0);
946 t_1[1] = iot + 3*s_t[2] + sim.map(2, 1);
947 t_1[2] = iot + 3*s_t[3] + sim.map(3, 1);
949 t_2[0] = iot + 3*s_t[0] + sim.map(0, 1);
950 t_2[1] = iot + 3*s_t[1] + sim.map(1, 1);
951 t_2[2] = iot + 3*s_t[3] + sim.map(3, 2);
953 t_3[0] = iot + 3*s_t[0] + sim.map(0, 2);
954 t_3[1] = iot + 3*s_t[1] + sim.map(1, 2);
955 t_3[2] = iot + 3*s_t[2] + sim.map(2, 2);
960 t_4[0] = ios + 6*i + 1;
961 t_4[1] = ios + 6*i + 0;
962 t_4[2] = iot + 3*s_t[3] + sim.map(3, 0);
964 t_5[0] = ios + 6*i + 2;
965 t_5[1] = ios + 6*i + 0;
966 t_5[2] = iot + 3*s_t[2] + sim.map(2, 0);
968 t_6[0] = ios + 6*i + 3;
969 t_6[1] = ios + 6*i + 0;
970 t_6[2] = iot + 3*s_t[3] + sim.map(3, 1);
972 t_7[0] = ios + 6*i + 4;
973 t_7[1] = ios + 6*i + 0;
974 t_7[2] = iot + 3*s_t[2] + sim.map(2, 1);
977 t_8[0] = ios + 6*i + 2;
978 t_8[1] = ios + 6*i + 1;
979 t_8[2] = iot + 3*s_t[1] + sim.map(1, 0);
981 t_9[0] = ios + 6*i + 3;
982 t_9[1] = ios + 6*i + 1;
983 t_9[2] = iot + 3*s_t[3] + sim.map(3, 2);
985 t_10[0] = ios + 6*i + 5;
986 t_10[1] = ios + 6*i + 1;
987 t_10[2] = iot + 3*s_t[1] + sim.map(1, 1);
990 t_11[0] = ios + 6*i + 4;
991 t_11[1] = ios + 6*i + 2;
992 t_11[2] = iot + 3*s_t[2] + sim.map(2, 2);
994 t_12[0] = ios + 6*i + 5;
995 t_12[1] = ios + 6*i + 2;
996 t_12[2] = iot + 3*s_t[1] + sim.map(1, 2);
999 t_13[0] = ios + 6*i + 4;
1000 t_13[1] = ios + 6*i + 3;
1001 t_13[2] = iot + 3*s_t[0] + sim.map(0, 0);
1003 t_14[0] = ios + 6*i + 5;
1004 t_14[1] = ios + 6*i + 3;
1005 t_14[2] = iot + 3*s_t[0] + sim.map(0, 1);
1008 t_15[0] = ios + 6*i + 5;
1009 t_15[1] = ios + 6*i + 4;
1010 t_15[2] = iot + 3*s_t[0] + sim.map(0, 2);
1014 return 16*num_simps;
1024 struct StandardIndexRefiner<Shape::Simplex<3>, 3, 1>
1026 static constexpr int shape_dim = 3;
1027 static constexpr int cell_dim = 3;
1028 static constexpr int face_dim = 1;
1030 typedef Shape::Simplex<shape_dim> ShapeType;
1031 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
1032 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
1033 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
1035 static Index refine(
1036 IndexSetType& index_set_out,
1038 const Index index_offsets[],
1039 const IndexSetHolderType& index_set_holder_in)
1042 const Index ioe = index_offsets[1];
1043 const Index iot = index_offsets[2];
1044 const Index ios = index_offsets[3];
1047 typedef IndexSetType::IndexTupleType IndexTupleType;
1050 typedef IndexSet<2> IndexSetTypeEV;
1051 typedef IndexSet<3> IndexSetTypeTV;
1052 typedef IndexSet<4> IndexSetTypeSV;
1053 typedef IndexSet<6> IndexSetTypeSE;
1054 typedef IndexSet<4> IndexSetTypeST;
1057 typedef IndexSetTypeSV::IndexTupleType IndexTupleTypeSV;
1058 typedef IndexSetTypeSE::IndexTupleType IndexTupleTypeSE;
1059 typedef IndexSetTypeST::IndexTupleType IndexTupleTypeST;
1062 const IndexSetTypeEV& index_set_e_v = index_set_holder_in.get_index_set<1,0>();
1063 const IndexSetTypeTV& index_set_t_v = index_set_holder_in.get_index_set<2,0>();
1064 const IndexSetTypeSV& index_set_s_v = index_set_holder_in.get_index_set<3,0>();
1065 const IndexSetTypeSE& index_set_s_e = index_set_holder_in.get_index_set<3,1>();
1066 const IndexSetTypeST& index_set_s_t = index_set_holder_in.get_index_set<3,2>();
1069 const Index num_simps = index_set_s_t.get_num_entities();
1072 typedef Intern::SubIndexMapping<ShapeType, 2, 1> SubIndexMappingType;
1073 typedef Intern::SubIndexMapping<ShapeType, face_dim, 0> EdgeIndexMappingType;
1076 FEAT_PRAGMA_OMP(parallel
for)
1077 for(Index i = 0; i < num_simps; ++i)
1080 const IndexTupleTypeSV& s_v = index_set_s_v[i];
1081 const IndexTupleTypeSE& s_e = index_set_s_e[i];
1082 const IndexTupleTypeST& s_t = index_set_s_t[i];
1085 SubIndexMappingType sim(s_v, s_t, index_set_t_v);
1086 EdgeIndexMappingType edgesim(s_v, s_e, index_set_e_v);
1089 IndexTupleType& s_0 = index_set_out[offset + 12*i + 0];
1090 IndexTupleType& s_1 = index_set_out[offset + 12*i + 1];
1091 IndexTupleType& s_2 = index_set_out[offset + 12*i + 2];
1092 IndexTupleType& s_3 = index_set_out[offset + 12*i + 3];
1093 IndexTupleType& s_4 = index_set_out[offset + 12*i + 4];
1094 IndexTupleType& s_5 = index_set_out[offset + 12*i + 5];
1095 IndexTupleType& s_6 = index_set_out[offset + 12*i + 6];
1096 IndexTupleType& s_7 = index_set_out[offset + 12*i + 7];
1097 IndexTupleType& s_8 = index_set_out[offset + 12*i + 8];
1098 IndexTupleType& s_9 = index_set_out[offset + 12*i + 9];
1099 IndexTupleType& s_10 = index_set_out[offset + 12*i + 10];
1100 IndexTupleType& s_11 = index_set_out[offset + 12*i + 11];
1105 s_0[0] = iot + 3*s_t[2] + sim.map(2, 0);
1106 s_0[1] = iot + 3*s_t[3] + sim.map(3, 0);
1107 s_0[2] = ioe + 2*s_e[0] + edgesim.map(0, 0);
1108 s_0[3] = iot + 3*s_t[1] + sim.map(1, 0);
1109 s_0[4] = ioe + 2*s_e[2] + edgesim.map(2, 0);
1110 s_0[5] = ioe + 2*s_e[1] + edgesim.map(1, 0);
1112 s_1[0] = iot + 3*s_t[3] + sim.map(3, 0);
1113 s_1[1] = iot + 3*s_t[2] + sim.map(2, 0);
1114 s_1[2] = ios + 6*i + 0;
1115 s_1[3] = iot + 3*s_t[1] + sim.map(1, 0);
1116 s_1[4] = ios + 6*i + 1;
1117 s_1[5] = ios + 6*i + 2;
1120 s_2[0] = iot + 3*s_t[3] + sim.map(3, 1);
1121 s_2[1] = iot + 3*s_t[2] + sim.map(2, 1);
1122 s_2[2] = ioe + 2*s_e[0] + edgesim.map(0, 1);
1123 s_2[3] = iot + 3*s_t[0] + sim.map(0, 0);
1124 s_2[4] = ioe + 2*s_e[3] + edgesim.map(3, 0);
1125 s_2[5] = ioe + 2*s_e[4] + edgesim.map(4, 0);
1127 s_3[0] = iot + 3*s_t[2] + sim.map(2, 1);
1128 s_3[1] = iot + 3*s_t[3] + sim.map(3, 1);
1129 s_3[2] = ios + 6*i + 0;
1130 s_3[3] = iot + 3*s_t[0] + sim.map(0, 0);
1131 s_3[5] = ios + 6*i + 3;
1132 s_3[4] = ios + 6*i + 4;
1135 s_4[0] = iot + 3*s_t[1] + sim.map(1, 1);
1136 s_4[1] = iot + 3*s_t[3] + sim.map(3, 2);
1137 s_4[2] = ioe + 2*s_e[1] + edgesim.map(1, 1);
1138 s_4[3] = iot + 3*s_t[0] + sim.map(0, 1);
1139 s_4[4] = ioe + 2*s_e[5] + edgesim.map(5, 0);
1140 s_4[5] = ioe + 2*s_e[3] + edgesim.map(3, 1);
1142 s_5[0] = iot + 3*s_t[3] + sim.map(3, 2);
1143 s_5[1] = iot + 3*s_t[1] + sim.map(1, 1);
1144 s_5[2] = ios + 6*i + 1;
1145 s_5[3] = iot + 3*s_t[0] + sim.map(0, 1);
1146 s_5[4] = ios + 6*i + 3;
1147 s_5[5] = ios + 6*i + 5;
1150 s_6[0] = iot + 3*s_t[2] + sim.map(2, 2);
1151 s_6[1] = iot + 3*s_t[1] + sim.map(1, 2);
1152 s_6[2] = ioe + 2*s_e[2] + edgesim.map(2, 1);
1153 s_6[3] = iot + 3*s_t[0] + sim.map(0, 2);
1154 s_6[4] = ioe + 2*s_e[4] + edgesim.map(4, 1);
1155 s_6[5] = ioe + 2*s_e[5] + edgesim.map(5, 1);
1157 s_7[0] = iot + 3*s_t[1] + sim.map(1, 2);
1158 s_7[1] = iot + 3*s_t[2] + sim.map(2, 2);
1159 s_7[2] = ios + 6*i + 2;
1160 s_7[3] = iot + 3*s_t[0] + sim.map(0, 2);
1161 s_7[4] = ios + 6*i + 5;
1162 s_7[5] = ios + 6*i + 4;
1166 s_8[0] = iot + 3*s_t[0] + sim.map(0, 0);
1167 s_8[1] = iot + 3*s_t[0] + sim.map(0, 1);
1168 s_8[2] = ios + 6*i + 3;
1169 s_8[3] = iot + 3*s_t[0] + sim.map(0, 2);
1170 s_8[4] = ios + 6*i + 4;
1171 s_8[5] = ios + 6*i + 5;
1173 s_9[0] = iot + 3*s_t[1] + sim.map(1, 1);
1174 s_9[1] = iot + 3*s_t[1] + sim.map(1, 0);
1175 s_9[2] = ios + 6*i + 1;
1176 s_9[3] = iot + 3*s_t[1] + sim.map(1, 2);
1177 s_9[4] = ios + 6*i + 5;
1178 s_9[5] = ios + 6*i + 2;
1180 s_10[0] = iot + 3*s_t[2] + sim.map(2, 0);
1181 s_10[1] = iot + 3*s_t[2] + sim.map(2, 1);
1182 s_10[2] = ios + 6*i + 0;
1183 s_10[3] = iot + 3*s_t[2] + sim.map(2, 2);
1184 s_10[4] = ios + 6*i + 2;
1185 s_10[5] = ios + 6*i + 4;
1187 s_11[0] = iot + 3*s_t[3] + sim.map(3, 1);
1188 s_11[1] = iot + 3*s_t[3] + sim.map(3, 0);
1189 s_11[2] = ios + 6*i + 0;
1190 s_11[3] = iot + 3*s_t[3] + sim.map(3, 2);
1191 s_11[4] = ios + 6*i + 3;
1192 s_11[5] = ios + 6*i + 1;
1196 return 12*num_simps;
1206 struct StandardIndexRefiner<Shape::Simplex<3>, 3, 2>
1208 static constexpr int shape_dim = 3;
1209 static constexpr int cell_dim = 3;
1210 static constexpr int face_dim = 2;
1212 typedef Shape::Simplex<shape_dim> ShapeType;
1213 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
1214 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
1215 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
1217 static Index refine(
1218 IndexSetType& index_set_out,
1220 const Index index_offsets[],
1221 const IndexSetHolderType& index_set_holder_in)
1224 const Index iot = index_offsets[2];
1225 const Index ios = index_offsets[3];
1228 typedef IndexSetType::IndexTupleType IndexTupleType;
1231 typedef IndexSet<3> IndexSetTypeTV;
1232 typedef IndexSet<4> IndexSetTypeSV;
1233 typedef IndexSet<4> IndexSetTypeST;
1236 typedef IndexSetTypeSV::IndexTupleType IndexTupleTypeSV;
1237 typedef IndexSetTypeST::IndexTupleType IndexTupleTypeST;
1240 const IndexSetTypeTV& index_set_t_v = index_set_holder_in.get_index_set<2,0>();
1241 const IndexSetTypeSV& index_set_s_v = index_set_holder_in.get_index_set<3,0>();
1242 const IndexSetTypeST& index_set_s_t = index_set_holder_in.get_index_set<3,2>();
1245 const Index num_simps = index_set_s_t.get_num_entities();
1248 typedef Intern::SubIndexMapping<ShapeType, face_dim, 0> SubIndexMappingType;
1251 FEAT_PRAGMA_OMP(parallel
for)
1252 for(Index i = 0; i < num_simps; ++i)
1255 const IndexTupleTypeSV& s_v = index_set_s_v[i];
1256 const IndexTupleTypeST& s_t = index_set_s_t[i];
1259 SubIndexMappingType sim(s_v, s_t, index_set_t_v);
1262 IndexTupleType& s_0 = index_set_out[offset + 12*i + 0];
1263 IndexTupleType& s_1 = index_set_out[offset + 12*i + 1];
1264 IndexTupleType& s_2 = index_set_out[offset + 12*i + 2];
1265 IndexTupleType& s_3 = index_set_out[offset + 12*i + 3];
1266 IndexTupleType& s_4 = index_set_out[offset + 12*i + 4];
1267 IndexTupleType& s_5 = index_set_out[offset + 12*i + 5];
1268 IndexTupleType& s_6 = index_set_out[offset + 12*i + 6];
1269 IndexTupleType& s_7 = index_set_out[offset + 12*i + 7];
1270 IndexTupleType& s_8 = index_set_out[offset + 12*i + 8];
1271 IndexTupleType& s_9 = index_set_out[offset + 12*i + 9];
1272 IndexTupleType& s_10 = index_set_out[offset + 12*i + 10];
1273 IndexTupleType& s_11 = index_set_out[offset + 12*i + 11];
1278 s_0[0] = iot + 4*s_t[1] + sim.map(1, 0);
1279 s_0[2] = iot + 4*s_t[2] + sim.map(2, 0);
1280 s_0[1] = iot + 4*s_t[3] + sim.map(3, 0);
1281 s_0[3] = ios + 16*i + 0;
1283 s_1[0] = ios + 16*i + 8;
1284 s_1[1] = ios + 16*i + 5;
1285 s_1[2] = ios + 16*i + 4;
1286 s_1[3] = ios + 16*i + 0;
1289 s_2[0] = iot + 4*s_t[0] + sim.map(0, 0);
1290 s_2[1] = iot + 4*s_t[2] + sim.map(2, 1);
1291 s_2[2] = iot + 4*s_t[3] + sim.map(3, 1);
1292 s_2[3] = ios + 16*i + 1;
1294 s_3[0] = ios + 16*i + 13;
1295 s_3[2] = ios + 16*i + 7;
1296 s_3[1] = ios + 16*i + 6;
1297 s_3[3] = ios + 16*i + 1;
1300 s_4[0] = iot + 4*s_t[0] + sim.map(0, 1);
1301 s_4[2] = iot + 4*s_t[1] + sim.map(1, 1);
1302 s_4[1] = iot + 4*s_t[3] + sim.map(3, 2);
1303 s_4[3] = ios + 16*i + 2;
1305 s_5[0] = ios + 16*i + 14;
1306 s_5[1] = ios + 16*i + 10;
1307 s_5[2] = ios + 16*i + 9;
1308 s_5[3] = ios + 16*i + 2;
1311 s_6[0] = iot + 4*s_t[0] + sim.map(0, 2);
1312 s_6[1] = iot + 4*s_t[1] + sim.map(1, 2);
1313 s_6[2] = iot + 4*s_t[2] + sim.map(2, 2);
1314 s_6[3] = ios + 16*i + 3;
1316 s_7[0] = ios + 16*i + 15;
1317 s_7[2] = ios + 16*i + 12;
1318 s_7[1] = ios + 16*i + 11;
1319 s_7[3] = ios + 16*i + 3;
1323 s_8[0] = ios + 16*i + 15;
1324 s_8[1] = ios + 16*i + 14;
1325 s_8[2] = ios + 16*i + 13;
1326 s_8[3] = iot + 4*s_t[0] + 3;
1328 s_9[0] = ios + 16*i + 12;
1329 s_9[1] = ios + 16*i + 8;
1330 s_9[2] = ios + 16*i + 10;
1331 s_9[3] = iot + 4*s_t[1] + 3;
1333 s_10[0] = ios + 16*i + 11;
1334 s_10[1] = ios + 16*i + 7;
1335 s_10[2] = ios + 16*i + 5;
1336 s_10[3] = iot + 4*s_t[2] + 3;
1338 s_11[0] = ios + 16*i + 9;
1339 s_11[1] = ios + 16*i + 4;
1340 s_11[2] = ios + 16*i + 6;
1341 s_11[3] = iot + 4*s_t[3] + 3;
1345 return 12*num_simps;
1354 struct StandardIndexRefiner<Shape::Hypercube<1>, 1, 0>
1356 static constexpr int shape_dim = 1;
1357 static constexpr int cell_dim = 1;
1358 static constexpr int face_dim = 0;
1360 typedef Shape::Hypercube<shape_dim> ShapeType;
1361 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
1362 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
1363 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
1365 static Index refine(
1366 IndexSetType& index_set_out,
1368 const Index index_offsets[],
1369 const IndexSetHolderType& index_set_holder_in)
1372 const Index iov = index_offsets[0];
1373 const Index ioe = index_offsets[1];
1376 typedef IndexSetType::IndexTupleType IndexTupleType;
1379 typedef IndexSet<2> IndexSetTypeEV;
1382 typedef IndexSetTypeEV::IndexTupleType IndexTupleTypeEV;
1385 const IndexSetTypeEV& index_set_e_v = index_set_holder_in.get_index_set<1,0>();
1388 const Index num_edges = index_set_e_v.get_num_entities();
1391 FEAT_PRAGMA_OMP(parallel
for)
1392 for(Index i = 0; i < num_edges; ++i)
1395 const IndexTupleTypeEV& e_v = index_set_e_v[i];
1398 IndexTupleType& idx0 = index_set_out[offset + 2*i + 0];
1399 IndexTupleType& idx1 = index_set_out[offset + 2*i + 1];
1402 idx0[0] = iov + e_v[0];
1405 idx1[1] = iov + e_v[1];
1423 struct StandardIndexRefiner<Shape::Hypercube<2>, 1, 0>
1425 static constexpr int shape_dim = 2;
1426 static constexpr int cell_dim = 1;
1427 static constexpr int face_dim = 0;
1429 typedef Shape::Hypercube<shape_dim> ShapeType;
1430 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
1431 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
1432 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
1434 static Index refine(
1435 IndexSetType& index_set_out,
1437 const Index index_offsets[],
1438 const IndexSetHolderType& index_set_holder_in)
1441 const Index ioe = index_offsets[1];
1442 const Index ioq = index_offsets[2];
1445 typedef IndexSetType::IndexTupleType IndexTupleType;
1448 typedef IndexSet<4> IndexSetTypeQE;
1451 typedef IndexSetTypeQE::IndexTupleType IndexTupleTypeQE;
1454 const IndexSetTypeQE& index_set_q_e = index_set_holder_in.get_index_set<2,1>();
1457 const Index num_quads = index_set_q_e.get_num_entities();
1479 FEAT_PRAGMA_OMP(parallel
for)
1480 for(Index i = 0; i < num_quads; ++i)
1483 const IndexTupleTypeQE& q_e = index_set_q_e[i];
1486 IndexTupleType& e_0 = index_set_out[offset + 4*i + 0];
1487 IndexTupleType& e_1 = index_set_out[offset + 4*i + 1];
1488 IndexTupleType& e_2 = index_set_out[offset + 4*i + 2];
1489 IndexTupleType& e_3 = index_set_out[offset + 4*i + 3];
1491 e_0[0] = ioe + q_e[0];
1495 e_1[1] = ioe + q_e[1];
1497 e_2[0] = ioe + q_e[2];
1501 e_3[1] = ioe + q_e[3];
1515 struct StandardIndexRefiner<Shape::Hypercube<2>, 2, 0>
1517 static constexpr int shape_dim = 2;
1518 static constexpr int cell_dim = 2;
1519 static constexpr int face_dim = 0;
1521 typedef Shape::Hypercube<shape_dim> ShapeType;
1522 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
1523 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
1524 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
1526 static Index refine(
1527 IndexSetType& index_set_out,
1529 const Index index_offsets[],
1530 const IndexSetHolderType& index_set_holder_in)
1533 const Index iov = index_offsets[0];
1534 const Index ioe = index_offsets[1];
1535 const Index ioq = index_offsets[2];
1538 typedef IndexSetType::IndexTupleType IndexTupleType;
1541 typedef IndexSet<4> IndexSetTypeQV;
1542 typedef IndexSet<4> IndexSetTypeQE;
1545 typedef IndexSetTypeQV::IndexTupleType IndexTupleTypeQV;
1546 typedef IndexSetTypeQE::IndexTupleType IndexTupleTypeQE;
1549 const IndexSetTypeQV& index_set_q_v = index_set_holder_in.get_index_set<2,0>();
1550 const IndexSetTypeQE& index_set_q_e = index_set_holder_in.get_index_set<2,1>();
1553 const Index num_quads = index_set_q_v.get_num_entities();
1575 FEAT_PRAGMA_OMP(parallel
for)
1576 for(Index i = 0; i < num_quads; ++i)
1579 const IndexTupleTypeQV& q_v = index_set_q_v[i];
1580 const IndexTupleTypeQE& q_e = index_set_q_e[i];
1583 IndexTupleType& q_0 = index_set_out[offset + 4*i + 0];
1584 IndexTupleType& q_1 = index_set_out[offset + 4*i + 1];
1585 IndexTupleType& q_2 = index_set_out[offset + 4*i + 2];
1586 IndexTupleType& q_3 = index_set_out[offset + 4*i + 3];
1589 q_0[0] = iov + q_v[0];
1590 q_0[1] = ioe + q_e[0];
1591 q_0[2] = ioe + q_e[2];
1594 q_1[0] = ioe + q_e[0];
1595 q_1[1] = iov + q_v[1];
1597 q_1[3] = ioe + q_e[3];
1599 q_2[0] = ioe + q_e[2];
1601 q_2[2] = iov + q_v[2];
1602 q_2[3] = ioe + q_e[1];
1605 q_3[1] = ioe + q_e[3];
1606 q_3[2] = ioe + q_e[1];
1607 q_3[3] = iov + q_v[3];
1621 struct StandardIndexRefiner<Shape::Hypercube<2>, 2, 1>
1623 static constexpr int shape_dim = 2;
1624 static constexpr int cell_dim = 2;
1625 static constexpr int face_dim = 1;
1627 typedef Shape::Hypercube<shape_dim> ShapeType;
1628 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
1629 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
1630 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
1632 static Index refine(
1633 IndexSetType& index_set_out,
1635 const Index index_offsets[],
1636 const IndexSetHolderType& index_set_holder_in)
1639 const Index ioe = index_offsets[1];
1640 const Index ioq = index_offsets[2];
1643 typedef IndexSetType::IndexTupleType IndexTupleType;
1646 typedef IndexSet<2> IndexSetTypeEV;
1647 typedef IndexSet<4> IndexSetTypeQV;
1648 typedef IndexSet<4> IndexSetTypeQE;
1651 typedef IndexSetTypeQV::IndexTupleType IndexTupleTypeQV;
1652 typedef IndexSetTypeQE::IndexTupleType IndexTupleTypeQE;
1655 const IndexSetTypeEV& index_set_e_v = index_set_holder_in.get_index_set<1,0>();
1656 const IndexSetTypeQV& index_set_q_v = index_set_holder_in.get_index_set<2,0>();
1657 const IndexSetTypeQE& index_set_q_e = index_set_holder_in.get_index_set<2,1>();
1660 const Index num_quads = index_set_q_v.get_num_entities();
1663 typedef Intern::SubIndexMapping<ShapeType, face_dim, 0> SubIndexMappingType;
1682 FEAT_PRAGMA_OMP(parallel
for)
1683 for(Index i = 0; i < num_quads; ++i)
1686 const IndexTupleTypeQV& q_v = index_set_q_v[i];
1687 const IndexTupleTypeQE& q_e = index_set_q_e[i];
1690 SubIndexMappingType sim(q_v, q_e, index_set_e_v);
1693 IndexTupleType& q_0 = index_set_out[offset + 4*i + 0];
1694 IndexTupleType& q_1 = index_set_out[offset + 4*i + 1];
1695 IndexTupleType& q_2 = index_set_out[offset + 4*i + 2];
1696 IndexTupleType& q_3 = index_set_out[offset + 4*i + 3];
1699 q_0[0] = ioe + 2*q_e[0] + sim.map(0, 0);
1700 q_0[1] = ioq + 4*i + 2;
1701 q_0[2] = ioe + 2*q_e[2] + sim.map(2, 0);
1702 q_0[3] = ioq + 4*i + 0;
1704 q_1[0] = ioe + 2*q_e[0] + sim.map(0, 1);
1705 q_1[1] = ioq + 4*i + 3;
1706 q_1[2] = ioq + 4*i + 0;
1707 q_1[3] = ioe + 2*q_e[3] + sim.map(3, 0);
1709 q_2[0] = ioq + 4*i + 2;
1710 q_2[1] = ioe + 2*q_e[1] + sim.map(1, 0);
1711 q_2[2] = ioe + 2*q_e[2] + sim.map(2, 1);
1712 q_2[3] = ioq + 4*i + 1;
1714 q_3[0] = ioq + 4*i + 3;
1715 q_3[1] = ioe + 2*q_e[1] + sim.map(1, 1);
1716 q_3[2] = ioq + 4*i + 1;
1717 q_3[3] = ioe + 2*q_e[3] + sim.map(3, 1);
1735 struct StandardIndexRefiner<Shape::Hypercube<3>, 1, 0>
1737 static constexpr int shape_dim = 3;
1738 static constexpr int cell_dim = 1;
1739 static constexpr int face_dim = 0;
1741 typedef Shape::Hypercube<shape_dim> ShapeType;
1742 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
1743 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
1744 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
1746 static Index refine(
1747 IndexSetType& index_set_out,
1749 const Index index_offsets[],
1750 const IndexSetHolderType& index_set_holder_in)
1753 const Index ioq = index_offsets[2];
1754 const Index ioc = index_offsets[3];
1757 typedef IndexSetType::IndexTupleType IndexTupleType;
1760 typedef IndexSet<6> IndexSetTypeCQ;
1763 typedef IndexSetTypeCQ::IndexTupleType IndexTupleTypeCQ;
1766 const IndexSetTypeCQ& index_set_c_q = index_set_holder_in.get_index_set<3,2>();
1769 const Index num_cubes = index_set_c_q.get_num_entities();
1788 FEAT_PRAGMA_OMP(parallel
for)
1789 for(Index i = 0; i < num_cubes; ++i)
1792 const IndexTupleTypeCQ& c_q = index_set_c_q[i];
1795 IndexTupleType& e_0 = index_set_out[offset + 6*i + 0];
1796 IndexTupleType& e_1 = index_set_out[offset + 6*i + 1];
1797 IndexTupleType& e_2 = index_set_out[offset + 6*i + 2];
1798 IndexTupleType& e_3 = index_set_out[offset + 6*i + 3];
1799 IndexTupleType& e_4 = index_set_out[offset + 6*i + 4];
1800 IndexTupleType& e_5 = index_set_out[offset + 6*i + 5];
1802 e_0[0] = ioq + c_q[0];
1806 e_1[1] = ioq + c_q[1];
1808 e_2[0] = ioq + c_q[2];
1812 e_3[1] = ioq + c_q[3];
1814 e_4[0] = ioq + c_q[4];
1818 e_5[1] = ioq + c_q[5];
1832 struct StandardIndexRefiner<Shape::Hypercube<3>, 2, 0>
1834 static constexpr int shape_dim = 3;
1835 static constexpr int cell_dim = 2;
1836 static constexpr int face_dim = 0;
1838 typedef Shape::Hypercube<shape_dim> ShapeType;
1839 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
1840 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
1841 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
1843 static Index refine(
1844 IndexSetType& index_set_out,
1846 const Index index_offsets[],
1847 const IndexSetHolderType& index_set_holder_in)
1850 const Index ioe = index_offsets[1];
1851 const Index ioq = index_offsets[2];
1852 const Index ioc = index_offsets[3];
1855 typedef IndexSetType::IndexTupleType IndexTupleType;
1858 typedef IndexSet<6> IndexSetTypeCQ;
1859 typedef IndexSet<12> IndexSetTypeCE;
1862 typedef IndexSetTypeCQ::IndexTupleType IndexTupleTypeCQ;
1863 typedef IndexSetTypeCE::IndexTupleType IndexTupleTypeCE;
1866 const IndexSetTypeCQ& index_set_c_q = index_set_holder_in.get_index_set<3,2>();
1867 const IndexSetTypeCE& index_set_c_e = index_set_holder_in.get_index_set<3,1>();
1870 const Index num_cubes = index_set_c_q.get_num_entities();
1928 FEAT_PRAGMA_OMP(parallel
for)
1929 for(Index i = 0; i < num_cubes; ++i)
1932 const IndexTupleTypeCQ& c_q = index_set_c_q[i];
1933 const IndexTupleTypeCE& c_e = index_set_c_e[i];
1936 IndexTupleType& s_0 = index_set_out[offset + 12*i + 0];
1937 IndexTupleType& s_1 = index_set_out[offset + 12*i + 1];
1938 IndexTupleType& s_2 = index_set_out[offset + 12*i + 2];
1939 IndexTupleType& s_3 = index_set_out[offset + 12*i + 3];
1940 IndexTupleType& s_4 = index_set_out[offset + 12*i + 4];
1941 IndexTupleType& s_5 = index_set_out[offset + 12*i + 5];
1942 IndexTupleType& s_6 = index_set_out[offset + 12*i + 6];
1943 IndexTupleType& s_7 = index_set_out[offset + 12*i + 7];
1944 IndexTupleType& s_8 = index_set_out[offset + 12*i + 8];
1945 IndexTupleType& s_9 = index_set_out[offset + 12*i + 9];
1946 IndexTupleType& s_10 = index_set_out[offset + 12*i + 10];
1947 IndexTupleType& s_11 = index_set_out[offset + 12*i + 11];
1952 s_0[0] = ioe + c_e[0];
1953 s_0[1] = ioq + c_q[0];
1954 s_0[2] = ioq + c_q[2];
1957 s_1[0] = ioq + c_q[0];
1958 s_1[1] = ioe + c_e[1];
1960 s_1[3] = ioq + c_q[3];
1962 s_2[0] = ioq + c_q[2];
1964 s_2[2] = ioe + c_e[2];
1965 s_2[3] = ioq + c_q[1];
1968 s_3[1] = ioq + c_q[3];
1969 s_3[2] = ioq + c_q[1];
1970 s_3[3] = ioe + c_e[3];
1973 s_4[0] = ioe + c_e[4];
1974 s_4[1] = ioq + c_q[0];
1975 s_4[2] = ioq + c_q[4];
1978 s_5[0] = ioq + c_q[0];
1979 s_5[1] = ioe + c_e[5];
1981 s_5[3] = ioq + c_q[5];
1983 s_6[0] = ioq + c_q[4];
1985 s_6[2] = ioe + c_e[6];
1986 s_6[3] = ioq + c_q[1];
1989 s_7[1] = ioq + c_q[5];
1990 s_7[2] = ioq + c_q[1];
1991 s_7[3] = ioe + c_e[7];
1994 s_8[0] = ioe + c_e[8];
1995 s_8[1] = ioq + c_q[2];
1996 s_8[2] = ioq + c_q[4];
1999 s_9[0] = ioq + c_q[2];
2000 s_9[1] = ioe + c_e[9];
2002 s_9[3] = ioq + c_q[5];
2004 s_10[0] = ioq + c_q[4];
2006 s_10[2] = ioe + c_e[10];
2007 s_10[3] = ioq + c_q[3];
2010 s_11[1] = ioq + c_q[5];
2011 s_11[2] = ioq + c_q[3];
2012 s_11[3] = ioe + c_e[11];
2015 return 12*num_cubes;
2025 struct StandardIndexRefiner<Shape::Hypercube<3>, 3, 0>
2027 static constexpr int shape_dim = 3;
2028 static constexpr int cell_dim = 3;
2029 static constexpr int face_dim = 0;
2031 typedef Shape::Hypercube<shape_dim> ShapeType;
2032 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
2033 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
2034 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
2036 static Index refine(
2037 IndexSetType& index_set_out,
2039 const Index index_offsets[],
2040 const IndexSetHolderType& index_set_holder_in)
2043 const Index iov = index_offsets[0];
2044 const Index ioe = index_offsets[1];
2045 const Index ioq = index_offsets[2];
2046 const Index ioc = index_offsets[3];
2049 typedef IndexSetType::IndexTupleType IndexTupleType;
2052 typedef IndexSet<6> IndexSetTypeCQ;
2053 typedef IndexSet<12> IndexSetTypeCE;
2054 typedef IndexSet<8> IndexSetTypeCV;
2057 typedef IndexSetTypeCQ::IndexTupleType IndexTupleTypeCQ;
2058 typedef IndexSetTypeCE::IndexTupleType IndexTupleTypeCE;
2059 typedef IndexSetTypeCV::IndexTupleType IndexTupleTypeCV;
2062 const IndexSetTypeCQ& index_set_c_q = index_set_holder_in.get_index_set<3,2>();
2063 const IndexSetTypeCE& index_set_c_e = index_set_holder_in.get_index_set<3,1>();
2064 const IndexSetTypeCV& index_set_c_v = index_set_holder_in.get_index_set<3,0>();
2067 const Index num_cubes = index_set_c_q.get_num_entities();
2094 FEAT_PRAGMA_OMP(parallel
for)
2095 for(Index i = 0; i < num_cubes; ++i)
2098 const IndexTupleTypeCQ& c_q = index_set_c_q[i];
2099 const IndexTupleTypeCE& c_e = index_set_c_e[i];
2100 const IndexTupleTypeCV& c_v = index_set_c_v[i];
2103 IndexTupleType& c_0 = index_set_out[offset + 8*i + 0];
2104 IndexTupleType& c_1 = index_set_out[offset + 8*i + 1];
2105 IndexTupleType& c_2 = index_set_out[offset + 8*i + 2];
2106 IndexTupleType& c_3 = index_set_out[offset + 8*i + 3];
2107 IndexTupleType& c_4 = index_set_out[offset + 8*i + 4];
2108 IndexTupleType& c_5 = index_set_out[offset + 8*i + 5];
2109 IndexTupleType& c_6 = index_set_out[offset + 8*i + 6];
2110 IndexTupleType& c_7 = index_set_out[offset + 8*i + 7];
2114 c_0[0] = iov + c_v[0];
2115 c_0[1] = ioe + c_e[0];
2116 c_0[2] = ioe + c_e[4];
2117 c_0[3] = ioq + c_q[0];
2118 c_0[4] = ioe + c_e[8];
2119 c_0[5] = ioq + c_q[2];
2120 c_0[6] = ioq + c_q[4];
2123 c_1[0] = ioe + c_e[0];
2124 c_1[1] = iov + c_v[1];
2125 c_1[2] = ioq + c_q[0];
2126 c_1[3] = ioe + c_e[5];
2127 c_1[4] = ioq + c_q[2];
2128 c_1[5] = ioe + c_e[9];
2130 c_1[7] = ioq + c_q[5];
2132 c_2[0] = ioe + c_e[4];
2133 c_2[1] = ioq + c_q[0];
2134 c_2[2] = iov + c_v[2];
2135 c_2[3] = ioe + c_e[1];
2136 c_2[4] = ioq + c_q[4];
2138 c_2[6] = ioe + c_e[10];
2139 c_2[7] = ioq + c_q[3];
2141 c_3[0] = ioq + c_q[0];
2142 c_3[1] = ioe + c_e[5];
2143 c_3[2] = ioe + c_e[1];
2144 c_3[3] = iov + c_v[3];
2146 c_3[5] = ioq + c_q[5];
2147 c_3[6] = ioq + c_q[3];
2148 c_3[7] = ioe + c_e[11];
2150 c_4[0] = ioe + c_e[8];
2151 c_4[1] = ioq + c_q[2];
2152 c_4[2] = ioq + c_q[4];
2154 c_4[4] = iov + c_v[4];
2155 c_4[5] = ioe + c_e[2];
2156 c_4[6] = ioe + c_e[6];
2157 c_4[7] = ioq + c_q[1];
2159 c_5[0] = ioq + c_q[2];
2160 c_5[1] = ioe + c_e[9];
2162 c_5[3] = ioq + c_q[5];
2163 c_5[4] = ioe + c_e[2];
2164 c_5[5] = iov + c_v[5];
2165 c_5[6] = ioq + c_q[1];
2166 c_5[7] = ioe + c_e[7];
2168 c_6[0] = ioq + c_q[4];
2170 c_6[2] = ioe + c_e[10];
2171 c_6[3] = ioq + c_q[3];
2172 c_6[4] = ioe + c_e[6];
2173 c_6[5] = ioq + c_q[1];
2174 c_6[6] = iov + c_v[6];
2175 c_6[7] = ioe + c_e[3];
2178 c_7[1] = ioq + c_q[5];
2179 c_7[2] = ioq + c_q[3];
2180 c_7[3] = ioe + c_e[11];
2181 c_7[4] = ioq + c_q[1];
2182 c_7[5] = ioe + c_e[7];
2183 c_7[6] = ioe + c_e[3];
2184 c_7[7] = iov + c_v[7];
2197 struct StandardIndexRefiner<Shape::Hypercube<3>, 2, 1>
2199 static constexpr int shape_dim = 3;
2200 static constexpr int cell_dim = 2;
2201 static constexpr int face_dim = 1;
2203 typedef Shape::Hypercube<shape_dim> ShapeType;
2204 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
2205 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
2206 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
2208 static Index refine(
2209 IndexSetType& index_set_out,
2211 const Index index_offsets[],
2212 const IndexSetHolderType& index_set_holder_in)
2215 const Index ioq = index_offsets[2];
2216 const Index ioc = index_offsets[3];
2219 typedef IndexSetType::IndexTupleType IndexTupleType;
2222 typedef IndexSet<4> IndexSetTypeQV;
2223 typedef IndexSet<8> IndexSetTypeCV;
2224 typedef IndexSet<6> IndexSetTypeCQ;
2227 typedef IndexSetTypeCV::IndexTupleType IndexTupleTypeCV;
2228 typedef IndexSetTypeCQ::IndexTupleType IndexTupleTypeCQ;
2231 const IndexSetTypeQV& index_set_q_v = index_set_holder_in.get_index_set<2,0>();
2232 const IndexSetTypeCV& index_set_c_v = index_set_holder_in.get_index_set<3,0>();
2233 const IndexSetTypeCQ& index_set_c_q = index_set_holder_in.get_index_set<3,2>();
2236 const Index num_cubes = index_set_c_q.get_num_entities();
2239 typedef Intern::SubIndexMapping<ShapeType, cell_dim, face_dim> SubIndexMappingType;
2297 FEAT_PRAGMA_OMP(parallel
for)
2298 for(Index i = 0; i < num_cubes; ++i)
2301 const IndexTupleTypeCV& c_v = index_set_c_v[i];
2302 const IndexTupleTypeCQ& c_q = index_set_c_q[i];
2305 SubIndexMappingType sim(c_v, c_q, index_set_q_v);
2308 IndexTupleType& q_0 = index_set_out[offset + 12*i + 0];
2309 IndexTupleType& q_1 = index_set_out[offset + 12*i + 1];
2310 IndexTupleType& q_2 = index_set_out[offset + 12*i + 2];
2311 IndexTupleType& q_3 = index_set_out[offset + 12*i + 3];
2312 IndexTupleType& q_4 = index_set_out[offset + 12*i + 4];
2313 IndexTupleType& q_5 = index_set_out[offset + 12*i + 5];
2314 IndexTupleType& q_6 = index_set_out[offset + 12*i + 6];
2315 IndexTupleType& q_7 = index_set_out[offset + 12*i + 7];
2316 IndexTupleType& q_8 = index_set_out[offset + 12*i + 8];
2317 IndexTupleType& q_9 = index_set_out[offset + 12*i + 9];
2318 IndexTupleType& q_10 = index_set_out[offset + 12*i + 10];
2319 IndexTupleType& q_11 = index_set_out[offset + 12*i + 11];
2324 q_0[0] = ioq + 4*c_q[0] + sim.map(0, 0);
2325 q_0[1] = ioc + 6*i + 2;
2326 q_0[2] = ioq + 4*c_q[2] + sim.map(2, 0);
2327 q_0[3] = ioc + 6*i + 0;
2329 q_1[0] = ioq + 4*c_q[0] + sim.map(0, 1);
2330 q_1[1] = ioc + 6*i + 3;
2331 q_1[2] = ioc + 6*i + 0;
2332 q_1[3] = ioq + 4*c_q[3] + sim.map(3, 0);
2334 q_2[0] = ioc + 6*i + 2;
2335 q_2[1] = ioq + 4*c_q[1] + sim.map(1, 0);
2336 q_2[2] = ioq + 4*c_q[2] + sim.map(2, 1);
2337 q_2[3] = ioc + 6*i + 1;
2339 q_3[0] = ioc + 6*i + 3;
2340 q_3[1] = ioq + 4*c_q[1] + sim.map(1, 1);
2341 q_3[2] = ioc + 6*i + 1;
2342 q_3[3] = ioq + 4*c_q[3] + sim.map(3, 1);
2345 q_4[0] = ioq + 4*c_q[0] + sim.map(0, 2);
2346 q_4[1] = ioc + 6*i + 4;
2347 q_4[2] = ioq + 4*c_q[4] + sim.map(4, 0);
2348 q_4[3] = ioc + 6*i + 0;
2350 q_5[0] = ioq + 4*c_q[0] + sim.map(0, 3);
2351 q_5[1] = ioc + 6*i + 5;
2352 q_5[2] = ioc + 6*i + 0;
2353 q_5[3] = ioq + 4*c_q[5] + sim.map(5, 0);
2355 q_6[0] = ioc + 6*i + 4;
2356 q_6[1] = ioq + 4*c_q[1] + sim.map(1, 2);
2357 q_6[2] = ioq + 4*c_q[4] + sim.map(4, 1);
2358 q_6[3] = ioc + 6*i + 1;
2360 q_7[0] = ioc + 6*i + 5;
2361 q_7[1] = ioq + 4*c_q[1] + sim.map(1, 3);
2362 q_7[2] = ioc + 6*i + 1;
2363 q_7[3] = ioq + 4*c_q[5] + sim.map(5, 1);
2366 q_8[0] = ioq + 4*c_q[2] + sim.map(2, 2);
2367 q_8[1] = ioc + 6*i + 4;
2368 q_8[2] = ioq + 4*c_q[4] + sim.map(4, 2);
2369 q_8[3] = ioc + 6*i + 2;
2371 q_9[0] = ioq + 4*c_q[2] + sim.map(2, 3);
2372 q_9[1] = ioc + 6*i + 5;
2373 q_9[2] = ioc + 6*i + 2;
2374 q_9[3] = ioq + 4*c_q[5] + sim.map(5, 2);
2376 q_10[0] = ioc + 6*i + 4;
2377 q_10[1] = ioq + 4*c_q[3] + sim.map(3, 2);
2378 q_10[2] = ioq + 4*c_q[4] + sim.map(4, 3);
2379 q_10[3] = ioc + 6*i + 3;
2381 q_11[0] = ioc + 6*i + 5;
2382 q_11[1] = ioq + 4*c_q[3] + sim.map(3, 3);
2383 q_11[2] = ioc + 6*i + 3;
2384 q_11[3] = ioq + 4*c_q[5] + sim.map(5, 3);
2387 return 12*num_cubes;
2397 struct StandardIndexRefiner<Shape::Hypercube<3>, 3, 1>
2399 static constexpr int shape_dim = 3;
2400 static constexpr int cell_dim = 3;
2401 static constexpr int face_dim = 1;
2403 typedef Shape::Hypercube<shape_dim> ShapeType;
2404 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
2405 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
2406 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
2408 static Index refine(
2409 IndexSetType& index_set_out,
2411 const Index index_offsets[],
2412 const IndexSetHolderType& index_set_holder_in)
2415 const Index ioe = index_offsets[1];
2416 const Index ioq = index_offsets[2];
2417 const Index ioc = index_offsets[3];
2420 typedef IndexSetType::IndexTupleType IndexTupleType;
2423 typedef IndexSet<2> IndexSetTypeEV;
2424 typedef IndexSet<4> IndexSetTypeQV;
2425 typedef IndexSet<8> IndexSetTypeCV;
2426 typedef IndexSet<12> IndexSetTypeCE;
2427 typedef IndexSet<6> IndexSetTypeCQ;
2430 typedef IndexSetTypeCV::IndexTupleType IndexTupleTypeCV;
2431 typedef IndexSetTypeCE::IndexTupleType IndexTupleTypeCE;
2432 typedef IndexSetTypeCQ::IndexTupleType IndexTupleTypeCQ;
2435 const IndexSetTypeEV& index_set_e_v = index_set_holder_in.get_index_set<1,0>();
2436 const IndexSetTypeQV& index_set_q_v = index_set_holder_in.get_index_set<2,0>();
2437 const IndexSetTypeCV& index_set_c_v = index_set_holder_in.get_index_set<3,0>();
2438 const IndexSetTypeCE& index_set_c_e = index_set_holder_in.get_index_set<3,1>();
2439 const IndexSetTypeCQ& index_set_c_q = index_set_holder_in.get_index_set<3,2>();
2442 const Index num_cubes = index_set_c_q.get_num_entities();
2445 typedef Intern::SubIndexMapping<ShapeType, 2, 1> SubIndexMappingType;
2446 typedef Intern::SubIndexMapping<ShapeType, face_dim, 0> EdgeIndexMappingType;
2473 FEAT_PRAGMA_OMP(parallel
for)
2474 for(Index i = 0; i < num_cubes; ++i)
2477 const IndexTupleTypeCV& c_v = index_set_c_v[i];
2478 const IndexTupleTypeCE& c_e = index_set_c_e[i];
2479 const IndexTupleTypeCQ& c_q = index_set_c_q[i];
2482 SubIndexMappingType sim(c_v, c_q, index_set_q_v);
2483 EdgeIndexMappingType edgesim(c_v, c_e, index_set_e_v);
2486 IndexTupleType& c_0 = index_set_out[offset + 8*i + 0];
2487 IndexTupleType& c_1 = index_set_out[offset + 8*i + 1];
2488 IndexTupleType& c_2 = index_set_out[offset + 8*i + 2];
2489 IndexTupleType& c_3 = index_set_out[offset + 8*i + 3];
2490 IndexTupleType& c_4 = index_set_out[offset + 8*i + 4];
2491 IndexTupleType& c_5 = index_set_out[offset + 8*i + 5];
2492 IndexTupleType& c_6 = index_set_out[offset + 8*i + 6];
2493 IndexTupleType& c_7 = index_set_out[offset + 8*i + 7];
2498 c_0[0] = ioe + 2*c_e[0] + edgesim.map(0, 0);
2499 c_0[1] = ioq + 4*c_q[0] + sim.map(0, 2);
2500 c_0[2] = ioq + 4*c_q[2] + sim.map(2, 2);
2501 c_0[3] = ioc + 6*i + 4;
2502 c_0[4] = ioe + 2*c_e[4] + edgesim.map(4, 0);
2503 c_0[5] = ioq + 4*c_q[0] + sim.map(0, 0);
2504 c_0[6] = ioq + 4*c_q[4] + sim.map(4, 2);
2505 c_0[7] = ioc + 6*i + 2;
2506 c_0[8] = ioe + 2*c_e[8] + edgesim.map(8, 0);
2507 c_0[9] = ioq + 4*c_q[2] + sim.map(2, 0);
2508 c_0[10] = ioq + 4*c_q[4] + sim.map(4, 0);
2509 c_0[11] = ioc + 6*i + 0;
2512 c_1[0] = ioe + 2*c_e[0] + edgesim.map(0,1);
2513 c_1[1] = ioq + 4*c_q[0] + sim.map(0, 3);
2514 c_1[2] = ioq + 4*c_q[2] + sim.map(2,3);
2515 c_1[3] = ioc + 6*i + 5;
2516 c_1[4] = ioq + 4*c_q[0] + sim.map(0, 0);
2517 c_1[5] = ioe + 2*c_e[5] + edgesim.map(5, 0);
2518 c_1[6] = ioc + 6*i + 2;
2519 c_1[7] = ioq + 4*c_q[5] + sim.map(5, 2);
2520 c_1[8] = ioq + 4*c_q[2] + sim.map(2,0);
2521 c_1[9] = ioe + 2*c_e[9] + edgesim.map(9, 0);
2522 c_1[10] = ioc + 6*i + 0;
2523 c_1[11] = ioq + 4*c_q[5] + sim.map(5, 0);
2526 c_2[0] = ioq + 4*c_q[0] + sim.map(0, 2);
2527 c_2[1] = ioe + 2*c_e[1] + edgesim.map(1, 0);
2528 c_2[2] = ioc + 6*i + 4;
2529 c_2[3] = ioq + 4*c_q[3] + sim.map(3, 2);
2530 c_2[4] = ioe + 2*c_e[4] + edgesim.map(4, 1);
2531 c_2[5] = ioq + 4*c_q[0] + sim.map(0, 1);
2532 c_2[6] = ioq + 4*c_q[4] + sim.map(4, 3);
2533 c_2[7] = ioc + 6*i + 3;
2534 c_2[8] = ioq + 4*c_q[4] + sim.map(4, 0);
2535 c_2[9] = ioc + 6*i + 0;
2536 c_2[10] = ioe + 2*c_e[10] + edgesim.map(10, 0);
2537 c_2[11] = ioq + 4*c_q[3] + sim.map(3, 0);
2540 c_3[0] = ioq + 4*c_q[0] + sim.map(0, 3);
2541 c_3[1] = ioe + 2*c_e[1] + edgesim.map(1, 1);
2542 c_3[2] = ioc + 6*i + 5;
2543 c_3[3] = ioq + 4*c_q[3] + sim.map(3, 3);
2544 c_3[4] = ioq + 4*c_q[0] + sim.map(0, 1);
2545 c_3[5] = ioe + 2*c_e[5] + edgesim.map(5, 1);
2546 c_3[6] = ioc + 6*i + 3;
2547 c_3[7] = ioq + 4*c_q[5] + sim.map(5, 3);
2548 c_3[8] = ioc + 6*i + 0;
2549 c_3[9] = ioq + 4*c_q[5] + sim.map(5, 0);
2550 c_3[10] = ioq + 4*c_q[3] + sim.map(3, 0);
2551 c_3[11] = ioe + 2*c_e[11] + edgesim.map(11, 0);
2554 c_4[0] = ioq + 4*c_q[2] + sim.map(2, 2);
2555 c_4[1] = ioc + 6*i + 4;
2556 c_4[2] = ioe + 2*c_e[2] + edgesim.map(2, 0);
2557 c_4[3] = ioq + 4*c_q[1] + sim.map(1, 2);
2558 c_4[4] = ioq + 4*c_q[4] + sim.map(4, 2);
2559 c_4[5] = ioc + 6*i + 2;
2560 c_4[6] = ioe + 2*c_e[6] + edgesim.map(6, 0);
2561 c_4[7] = ioq + 4*c_q[1] + sim.map(1, 0);
2562 c_4[8] = ioe + 2*c_e[8] + edgesim.map(8, 1);
2563 c_4[9] = ioq + 4*c_q[2] + sim.map(2, 1);
2564 c_4[10] = ioq + 4*c_q[4] + sim.map(4, 1);
2565 c_4[11] = ioc + 6*i + 1;
2568 c_5[0] = ioq + 4*c_q[2] + sim.map(2, 3);
2569 c_5[1] = ioc + 6*i + 5;
2570 c_5[2] = ioe + 2*c_e[2] + edgesim.map(2, 1);
2571 c_5[3] = ioq + 4*c_q[1] + sim.map(1, 3);
2572 c_5[4] = ioc + 6*i + 2;
2573 c_5[5] = ioq + 4*c_q[5] + sim.map(5, 2);
2574 c_5[6] = ioq + 4*c_q[1] + sim.map(1, 0);
2575 c_5[7] = ioe + 2*c_e[7] + edgesim.map(7, 0);
2576 c_5[8] = ioq + 4*c_q[2] + sim.map(2, 1);
2577 c_5[9] = ioe + 2*c_e[9] + edgesim.map(9, 1);
2578 c_5[10] = ioc + 6*i + 1;
2579 c_5[11] = ioq + 4*c_q[5] + sim.map(5, 1);
2582 c_6[0] = ioc + 6*i + 4;
2583 c_6[1] = ioq + 4*c_q[3] + sim.map(3, 2);
2584 c_6[2] = ioq + 4*c_q[1] + sim.map(1, 2);
2585 c_6[3] = ioe + 2*c_e[3] + edgesim.map(3, 0);
2586 c_6[4] = ioq + 4*c_q[4] + sim.map(4, 3);
2587 c_6[5] = ioc + 6*i + 3;
2588 c_6[6] = ioe + 2*c_e[6] + edgesim.map(6, 1);
2589 c_6[7] = ioq + 4*c_q[1] + sim.map(1, 1);
2590 c_6[8] = ioq + 4*c_q[4] + sim.map(4, 1);
2591 c_6[9] = ioc + 6*i + 1;
2592 c_6[10] = ioe + 2*c_e[10] + edgesim.map(10, 1);
2593 c_6[11] = ioq + 4*c_q[3] + sim.map(3, 1);
2596 c_7[0] = ioc + 6*i + 5;
2597 c_7[1] = ioq + 4*c_q[3] + sim.map(3, 3);
2598 c_7[2] = ioq + 4*c_q[1] + sim.map(1, 3);
2599 c_7[3] = ioe + 2*c_e[3] + edgesim.map(3, 1);
2600 c_7[4] = ioc + 6*i + 3;
2601 c_7[5] = ioq + 4*c_q[5] + sim.map(5, 3);
2602 c_7[6] = ioq + 4*c_q[1] + sim.map(1, 1);
2603 c_7[7] = ioe + 2*c_e[7] + edgesim.map(7, 1);
2604 c_7[8] = ioc + 6*i + 1;
2605 c_7[9] = ioq + 4*c_q[5] + sim.map(5, 1);
2606 c_7[10] = ioq + 4*c_q[3] + sim.map(3, 1);
2607 c_7[11] = ioe + 2*c_e[11] + edgesim.map(11, 1);
2620 struct StandardIndexRefiner<Shape::Hypercube<3>, 3, 2>
2622 static constexpr int shape_dim = 3;
2623 static constexpr int cell_dim = 3;
2624 static constexpr int face_dim = 2;
2626 typedef Shape::Hypercube<shape_dim> ShapeType;
2627 typedef Shape::FaceTraits<ShapeType, cell_dim>::ShapeType CellType;
2628 typedef IndexSet<Shape::FaceTraits<CellType, face_dim>::count> IndexSetType;
2629 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
2631 static Index refine(
2632 IndexSetType& index_set_out,
2634 const Index index_offsets[],
2635 const IndexSetHolderType& index_set_holder_in)
2638 const Index ioq = index_offsets[2];
2639 const Index ioc = index_offsets[3];
2642 typedef IndexSetType::IndexTupleType IndexTupleType;
2645 typedef IndexSet<4> IndexSetTypeQV;
2646 typedef IndexSet<8> IndexSetTypeCV;
2647 typedef IndexSet<6> IndexSetTypeCQ;
2650 typedef IndexSetTypeCV::IndexTupleType IndexTupleTypeCV;
2651 typedef IndexSetTypeCQ::IndexTupleType IndexTupleTypeCQ;
2654 const IndexSetTypeQV& index_set_q_v = index_set_holder_in.get_index_set<2,0>();
2655 const IndexSetTypeCV& index_set_c_v = index_set_holder_in.get_index_set<3,0>();
2656 const IndexSetTypeCQ& index_set_c_q = index_set_holder_in.get_index_set<3,2>();
2659 const Index num_cubes = index_set_c_q.get_num_entities();
2662 typedef Intern::SubIndexMapping<ShapeType, face_dim, 0> SubIndexMappingType;
2689 FEAT_PRAGMA_OMP(parallel
for)
2690 for(Index i = 0; i < num_cubes; ++i)
2693 const IndexTupleTypeCV& c_v = index_set_c_v[i];
2694 const IndexTupleTypeCQ& c_q = index_set_c_q[i];
2697 SubIndexMappingType sim(c_v, c_q, index_set_q_v);
2700 IndexTupleType& c_0 = index_set_out[offset + 8*i + 0];
2701 IndexTupleType& c_1 = index_set_out[offset + 8*i + 1];
2702 IndexTupleType& c_2 = index_set_out[offset + 8*i + 2];
2703 IndexTupleType& c_3 = index_set_out[offset + 8*i + 3];
2704 IndexTupleType& c_4 = index_set_out[offset + 8*i + 4];
2705 IndexTupleType& c_5 = index_set_out[offset + 8*i + 5];
2706 IndexTupleType& c_6 = index_set_out[offset + 8*i + 6];
2707 IndexTupleType& c_7 = index_set_out[offset + 8*i + 7];
2712 c_0[0] = ioq + 4*c_q[0] + sim.map(0, 0);
2713 c_0[1] = ioc + 12*i + 8;
2714 c_0[2] = ioq + 4*c_q[2] + sim.map(2, 0);
2715 c_0[3] = ioc + 12*i + 4;
2716 c_0[4] = ioq + 4*c_q[4] + sim.map(4, 0);
2717 c_0[5] = ioc + 12*i + 0;
2721 c_1[0] = ioq + 4*c_q[0] + sim.map(0, 1);
2722 c_1[1] = ioc + 12*i + 9;
2723 c_1[2] = ioq + 4*c_q[2] + sim.map(2, 1);
2724 c_1[3] = ioc + 12*i + 5;
2725 c_1[4] = ioc + 12*i + 0;
2726 c_1[5] = ioq + 4*c_q[5] + sim.map(5, 0);
2729 c_2[0] = ioq + 4*c_q[0] + sim.map(0, 2);
2730 c_2[1] = ioc + 12*i + 10;
2731 c_2[2] = ioc + 12*i + 4;
2732 c_2[3] = ioq + 4*c_q[3] + sim.map(3, 0);
2733 c_2[4] = ioq + 4*c_q[4] + sim.map(4, 1);
2734 c_2[5] = ioc + 12*i + 1;
2737 c_3[0] = ioq + 4*c_q[0] + sim.map(0, 3);
2738 c_3[1] = ioc + 12*i + 11;
2739 c_3[2] = ioc + 12*i + 5;
2740 c_3[3] = ioq + 4*c_q[3] + sim.map(3, 1);
2741 c_3[4] = ioc + 12*i + 1;
2742 c_3[5] = ioq + 4*c_q[5] + sim.map(5, 1);
2745 c_4[0] = ioc + 12*i + 8;
2746 c_4[1] = ioq + 4*c_q[1] + sim.map(1, 0);
2747 c_4[2] = ioq + 4*c_q[2] + sim.map(2, 2);
2748 c_4[3] = ioc + 12*i + 6;
2749 c_4[4] = ioq + 4*c_q[4] + sim.map(4, 2);
2750 c_4[5] = ioc + 12*i + 2;
2753 c_5[0] = ioc + 12*i + 9;
2754 c_5[1] = ioq + 4*c_q[1] + sim.map(1, 1);
2755 c_5[2] = ioq + 4*c_q[2] + sim.map(2, 3);
2756 c_5[3] = ioc + 12*i + 7;
2757 c_5[4] = ioc + 12*i + 2;
2758 c_5[5] = ioq + 4*c_q[5] + sim.map(5, 2);
2761 c_6[0] = ioc + 12*i + 10;
2762 c_6[1] = ioq + 4*c_q[1] + sim.map(1, 2);
2763 c_6[2] = ioc + 12*i + 6;
2764 c_6[3] = ioq + 4*c_q[3] + sim.map(3, 2);
2765 c_6[4] = ioq + 4*c_q[4] + sim.map(4, 3);
2766 c_6[5] = ioc + 12*i + 3;
2769 c_7[0] = ioc + 12*i + 11;
2770 c_7[1] = ioq + 4*c_q[1] + sim.map(1, 3);
2771 c_7[2] = ioc + 12*i + 7;
2772 c_7[3] = ioq + 4*c_q[3] + sim.map(3, 3);
2773 c_7[4] = ioc + 12*i + 3;
2774 c_7[5] = ioq + 4*c_q[5] + sim.map(5, 3);
2793 int shape_dim_ = Shape_::dimension>
2794 struct IndexRefineShapeWrapper
2796 static_assert(shape_dim_ == Shape_::dimension,
"invalid shape dimension");
2798 static_assert(shape_dim_ > cell_dim_,
"invalid cell dimension");
2799 static_assert(cell_dim_ > face_dim_,
"invalid face dimension");
2800 static_assert(face_dim_ >= 0,
"invalid face_dimension");
2802 typedef Shape_ ShapeType;
2803 typedef typename Shape::FaceTraits<ShapeType, cell_dim_>::ShapeType CellType;
2804 typedef IndexSet<Shape::FaceTraits<CellType, face_dim_>::count> IndexSetType;
2805 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
2807 static String name()
2809 return "IndexRefineShapeWrapper<" + Shape_::name() +
"," +
stringify(cell_dim_) +
","
2813 static Index refine(
2814 IndexSetType& index_set_out,
2815 const Index index_offsets[],
2816 const IndexSetHolderType& index_set_holder_in)
2818 typedef typename Shape::FaceTraits<ShapeType, shape_dim_ - 1>::ShapeType FacetType;
2821 Index offset = IndexRefineShapeWrapper<FacetType, cell_dim_, face_dim_>
2822 ::refine(index_set_out, index_offsets, index_set_holder_in);
2825 Index num_faces = StandardIndexRefiner<Shape_, cell_dim_, face_dim_>
2826 ::refine(index_set_out, offset, index_offsets, index_set_holder_in);
2829 Index num_shapes = index_set_holder_in.template get_index_set<shape_dim_, 0>().get_num_entities();
2830 XASSERTM(num_faces == (StandardRefinementTraits<ShapeType, cell_dim_>::count * num_shapes),
2831 "IndexRefiner output does not match StdRefTraits prediction");
2834 return offset + num_faces;
2842 struct IndexRefineShapeWrapper<Shape_, cell_dim_, face_dim_, cell_dim_>
2844 static_assert(cell_dim_ == Shape_::dimension,
"invalid shape dimension");
2845 static_assert(cell_dim_ > face_dim_,
"invalid face dimension");
2846 static_assert(face_dim_ >= 0,
"invalid face_dimension");
2848 typedef Shape_ ShapeType;
2849 typedef typename Shape::FaceTraits<ShapeType, cell_dim_>::ShapeType CellType;
2850 typedef IndexSet<Shape::FaceTraits<CellType, face_dim_>::count> IndexSetType;
2851 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
2853 static String name()
2855 return "IndexRefineShapeWrapper<" + Shape_::name() +
"," +
stringify(cell_dim_) +
","
2859 static Index refine(
2860 IndexSetType& index_set_out,
2861 const Index index_offsets[],
2862 const IndexSetHolderType& index_set_holder_in)
2865 Index num_faces = StandardIndexRefiner<Shape_, cell_dim_, face_dim_>
2866 ::refine(index_set_out, 0, index_offsets, index_set_holder_in);
2869 Index num_shapes = index_set_holder_in.template get_index_set<cell_dim_, 0>().get_num_entities();
2870 XASSERTM(num_faces == (StandardRefinementTraits<ShapeType, cell_dim_>::count * num_shapes),
2871 "IndexRefiner output does not match StdRefTraits prediction");
2883 int face_dim_ = cell_dim_ - 1>
2884 struct IndexRefineFaceWrapper
2887 static_assert(face_dim_ > 0,
"invalid face dimension");
2888 static_assert(cell_dim_ > face_dim_,
"invalid cell dimension");
2889 static_assert(cell_dim_ <= Shape_::dimension,
"invalid cell dimension");
2891 typedef Shape_ ShapeType;
2892 typedef typename Shape::FaceTraits<ShapeType, cell_dim_>::ShapeType CellType;
2893 typedef IndexSet<Shape::FaceTraits<CellType, face_dim_>::count> IndexSetType;
2894 typedef IndexSetWrapper<CellType, face_dim_> IndexSetWrapperType;
2895 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
2897 static String name()
2899 return "IndexRefineFaceWrapper<" + Shape_::name() +
"," +
stringify(cell_dim_) +
","
2904 IndexSetWrapperType& index_set_wrapper_out,
2905 const Index num_entities[],
2906 const IndexSetHolderType& index_set_holder_in)
2909 IndexRefineFaceWrapper<Shape_, cell_dim_, face_dim_ - 1>
2910 ::refine(index_set_wrapper_out, num_entities, index_set_holder_in);
2913 IndexSetType& index_set_out = index_set_wrapper_out.template get_index_set<face_dim_>();
2916 Index index_offsets[Shape_::dimension+1];
2917 EntityCounter<StandardRefinementTraits, Shape_, face_dim_>::offset(index_offsets, num_entities);
2920 IndexRefineShapeWrapper<Shape_, cell_dim_, face_dim_>
2921 ::refine(index_set_out, index_offsets, index_set_holder_in);
2928 struct IndexRefineFaceWrapper<Shape_, cell_dim_, 0>
2930 static_assert(cell_dim_ > 0,
"invalid cell dimension");
2931 static_assert(cell_dim_ <= Shape_::dimension,
"invalid cell dimension");
2933 typedef Shape_ ShapeType;
2934 typedef typename Shape::FaceTraits<ShapeType, cell_dim_>::ShapeType CellType;
2935 typedef IndexSet<Shape::FaceTraits<CellType, 0>::count> IndexSetType;
2936 typedef IndexSetWrapper<CellType, 0> IndexSetWrapperType;
2937 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
2939 static String name()
2941 return "IndexRefineFaceWrapper<" + Shape_::name() +
"," +
stringify(cell_dim_) +
",0>";
2945 IndexSetWrapperType& index_set_wrapper_out,
2946 const Index num_entities[],
2947 const IndexSetHolderType& index_set_holder_in)
2950 IndexSetType& index_set_out = index_set_wrapper_out.template get_index_set<0>();
2953 Index index_offsets[Shape_::dimension+1];
2954 EntityCounter<StandardRefinementTraits, Shape_, 0>::offset(index_offsets, num_entities);
2957 IndexRefineShapeWrapper<Shape_, cell_dim_, 0>
2958 ::refine(index_set_out, index_offsets, index_set_holder_in);
2966 int cell_dim_ = Shape_::dimension>
2967 struct IndexRefineWrapper
2970 static_assert(cell_dim_ > 1,
"invalid cell dimension");
2971 static_assert(cell_dim_ <= Shape_::dimension,
"invalid cell dimension");
2973 typedef Shape_ ShapeType;
2974 typedef typename Shape::FaceTraits<ShapeType, cell_dim_>::ShapeType CellType;
2975 typedef IndexSetWrapper<CellType> IndexSetWrapperType;
2976 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
2978 static String name()
2980 return "IndexRefineWrapper<" + Shape_::name() +
"," +
stringify(cell_dim_) +
">";
2984 IndexSetHolderType& index_set_holder_out,
2985 const Index num_entities[],
2986 const IndexSetHolderType& index_set_holder_in)
2989 IndexRefineWrapper<Shape_, cell_dim_ - 1>
2990 ::refine(index_set_holder_out, num_entities, index_set_holder_in);
2993 IndexSetWrapperType& index_set_wrapper_out = index_set_holder_out
2994 .template get_index_set_wrapper<cell_dim_>();
2997 IndexRefineFaceWrapper<Shape_, cell_dim_>
2998 ::refine(index_set_wrapper_out, num_entities, index_set_holder_in);
3002 template<
typename Shape_>
3003 struct IndexRefineWrapper<Shape_, 1>
3005 static_assert(1 <= Shape_::dimension,
"invalid shape dimension");
3007 typedef Shape_ ShapeType;
3008 typedef typename Shape::FaceTraits<ShapeType, 1>::ShapeType CellType;
3009 typedef IndexSetWrapper<CellType> IndexSetWrapperType;
3010 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
3012 static String name()
3014 return "IndexRefineWrapper<" + Shape_::name() +
",1>";
3018 IndexSetHolderType& index_set_holder_out,
3019 const Index num_entities[],
3020 const IndexSetHolderType& index_set_holder_in)
3023 IndexSetWrapperType& index_set_wrapper_out = index_set_holder_out.template get_index_set_wrapper<1>();
3026 IndexRefineFaceWrapper<Shape_, 1>::refine(index_set_wrapper_out, num_entities, index_set_holder_in);
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
String stringify(const T_ &item)
Converts an item into a String.
std::uint64_t Index
Index data type.