2 template <
int dim,
typename T>
4 dealii::TableIndices<2> new_size;
5 new_size[0] = 2*dim-1+dim/3;
6 new_size[1] = 2*dim-1+dim/3;
10 template <
int dim,
typename T>
15 template <
int dim,
typename T>
19 std::cout <<
"Testing 'computeStress' in " << dim <<
" dimension(s)..." << std::endl;
24 this->assignCIJSize(CIJ);
47 CIJ[0][1]=CIJ[1][0] = 9.5;
48 CIJ[0][2]=CIJ[2][0] = 2.1;
49 CIJ[0][3]=CIJ[3][0] = 1.5;
50 CIJ[0][4]=CIJ[4][0] = 9.2;
51 CIJ[0][5]=CIJ[5][0] = 18.6;
52 CIJ[1][2]=CIJ[2][1] = 5.6;
53 CIJ[1][3]=CIJ[3][1] = 4.7;
54 CIJ[1][4]=CIJ[4][1] = 6.4;
55 CIJ[1][5]=CIJ[5][1] = 5.9;
56 CIJ[2][3]=CIJ[3][2] = 15.5;
57 CIJ[2][4]=CIJ[4][2] = 63.1;
58 CIJ[2][5]=CIJ[5][2] = 50.0;
59 CIJ[3][4]=CIJ[4][3] = 92.5;
60 CIJ[3][5]=CIJ[5][3] = 1.3;
61 CIJ[4][5]=CIJ[5][4] = 23.2;
65 dealii::VectorizedArray<double> R[dim][dim], ux[dim][dim];
88 std::cerr <<
"Error: Number of dimensions must be between 1 and 3" << std::endl;
91 computeStress<dim>(CIJ,ux,R);
94 if (abs(R[0][0][0] - 2.5) < 1.0e-10) {pass =
true;}
98 if (abs(R[0][0][0] - 58.1) < 1.0e-10) {pass_counter++;}
99 if (abs(R[1][1][0] - 56.4) < 1.0e-10) {pass_counter++;}
100 if (abs(R[0][1][0] - 62.8) < 1.0e-10) {pass_counter++;}
101 if (abs(R[1][0][0] - 62.8) < 1.0e-10) {pass_counter++;}
102 if (pass_counter == 4){pass =
true;}
105 int pass_counter = 0;
106 if (abs(R[0][0][0] - 292.1) < 1.0e-10) {pass_counter++;}
107 if (abs(R[1][1][0] - 263.6) < 1.0e-10) {pass_counter++;}
108 if (abs(R[2][2][0] - 1237.5) < 1.0e-10) {pass_counter++;}
109 if (abs(R[1][2][0] - 1143.5) < 1.0e-10) {pass_counter++;}
110 if (abs(R[2][1][0] - 1143.5) < 1.0e-10) {pass_counter++;}
111 if (abs(R[0][2][0] - 2159.3) < 1.0e-10) {pass_counter++;}
112 if (abs(R[2][0][0] - 2159.3) < 1.0e-10) {pass_counter++;}
113 if (abs(R[0][1][0] - 865.3) < 1.0e-10) {pass_counter++;}
114 if (abs(R[1][0][0] - 865.3) < 1.0e-10) {pass_counter++;}
115 if (pass_counter == 9){pass =
true;}
118 std::cout <<
"Test result for 'computeStress' in " << dim <<
" dimension(s): " << pass << std::endl;
bool test_computeStress()
void assignCIJSize(dealii::VectorizedArray< double > CIJ[2 *dim-1+dim/3][2 *dim-1+dim/3])