Debian Codegraph @

packages/stk/stk_unit_tests/stk_mesh/face_creation/TwoHexesTwoProcsEGWithPermutations.cpp

raw
1 #include <stk_mesh/base/GetEntities.hpp>
2 #include <stk_unit_test_utils/unittestMeshUtils.hpp>
3 #include <stk_mesh/base/Comm.hpp>
4 #include <stk_mesh/base/FEMHelpers.hpp>
5 #include <stk_unit_test_utils/BulkDataTester.hpp>
6 #include "FaceCreatorFixture.hpp"
7
8 namespace
9 {
10
11 class FaceCreatorVaryingPerumutations : public FaceCreatorFixture
12 {
13 protected:
14
15 void run_test(const std::vector<std::vector<int>> input_permutations)
16 {
17 set_permutations_for_both_procs(input_permutations);
18 setup_mesh("generated:1x1x2", stk::mesh::BulkData::AUTO_AURA);
19 test_that_one_face_exists_after_both_procs_create_face_on_proc_boundary();
20 }
21
22 void set_permutations_for_both_procs(const std::vector<std::vector<int>> input_permutations)
23 {
24 m_permutations_per_proc = input_permutations;
25 }
26
27 virtual unsigned get_permuted_index(unsigned i)
28 {
29 return m_permutations_per_proc[get_bulk().parallel_rank()][i];
30 }
31
32 private:
33 std::vector<std::vector<int> > m_permutations_per_proc;
34 };
35
36
37 TEST_F(FaceCreatorVaryingPerumutations, twoHexesTwoProcsCreateTwoFacesPermutation0)
38 {
39 if(stk::parallel_machine_size(get_comm())==2)
40 {
41 std::vector<std::vector<int>> permutation = {
42 {0, 1, 2, 3},
43 {0, 3, 2, 1}
44 };
45 run_test(permutation);
46 }
47 }
48
49 TEST_F(FaceCreatorVaryingPerumutations, twoHexesTwoProcsCreateTwoFacesPermutation1)
50 {
51 if(stk::parallel_machine_size(get_comm())==2)
52 {
53 std::vector<std::vector<int>> permutation = {
54 {1, 2, 3, 0},
55 {3, 2, 1, 0}
56 };
57 run_test(permutation);
58 }
59 }
60
61 TEST_F(FaceCreatorVaryingPerumutations, twoHexesTwoProcsCreateTwoFacesPermutation2)
62 {
63 if(stk::parallel_machine_size(get_comm())==2)
64 {
65 std::vector<std::vector<int>> permutation = {
66 {2, 3, 0, 1},
67 {2, 1, 0, 3}
68 };
69 run_test(permutation);
70 }
71 }
72
73 TEST_F(FaceCreatorVaryingPerumutations, twoHexesTwoProcsCreateTwoFacesPermutation3)
74 {
75 if(stk::parallel_machine_size(get_comm())==2)
76 {
77 std::vector<std::vector<int>> permutation = {
78 {3, 0, 1, 2},
79 {1, 0, 3, 2}
80 };
81 run_test(permutation);
82 }
83 }
84
85 TEST_F(FaceCreatorVaryingPerumutations, twoHexesTwoProcsCreateTwoFacesPermutation4)
86 {
87 if(stk::parallel_machine_size(get_comm())==2)
88 {
89 std::vector<std::vector<int>> permutation = {
90 {0, 3, 2, 1},
91 {0, 1, 2, 3}
92 };
93 run_test(permutation);
94 }
95 }
96
97 TEST_F(FaceCreatorVaryingPerumutations, twoHexesTwoProcsCreateTwoFacesPermutation5)
98 {
99 if(stk::parallel_machine_size(get_comm())==2)
100 {
101 std::vector<std::vector<int>> permutation = {
102 {3, 2, 1, 0},
103 {1, 2, 3, 0}
104 };
105 run_test(permutation);
106 }
107 }
108
109 TEST_F(FaceCreatorVaryingPerumutations, twoHexesTwoProcsCreateTwoFacesPermutation6)
110 {
111 if(stk::parallel_machine_size(get_comm())==2)
112 {
113 std::vector<std::vector<int>> permutation = {
114 {2, 1, 0, 3},
115 {2, 3, 0, 1}
116 };
117 run_test(permutation);
118 }
119 }
120
121 TEST_F(FaceCreatorVaryingPerumutations, twoHexesTwoProcsCreateTwoFacesPermutation7)
122 {
123 if(stk::parallel_machine_size(get_comm())==2)
124 {
125 std::vector<std::vector<int>> permutation = {
126 {1, 0, 3, 2},
127 {3, 0, 1, 2}
128 };
129 run_test(permutation);
130 }
131 }
132
133 }