static NumberType
psi(const Tensor<2, dim, NumberType> &t, const NumberType &s)
{
- return double_contract(t, t) * std::pow(s, 3);
+ return double_contract<0, 0, 1, 1>(t, t) * std::pow(s, 3);
};
static Tensor<2, dim, NumberType>
static NumberType
dpsi_ds(const Tensor<2, dim, NumberType> &t, const NumberType &s)
{
- return 3.0 * double_contract(t, t) * std::pow(s, 2);
+ return 3.0 * double_contract<0, 0, 1, 1>(t, t) * std::pow(s, 2);
};
static Tensor<4, dim, NumberType>
static NumberType
d2psi_ds_ds(const Tensor<2, dim, NumberType> &t, const NumberType &s)
{
- return 6.0 * double_contract(t, t) * std::pow(s, 1);
+ return 6.0 * double_contract<0, 0, 1, 1>(t, t) * std::pow(s, 1);
};
};
const ADNumberType A_l1_norm = l1_norm(A);
const ADNumberType A_linf_norm = linfty_norm(A);
- const ADNumberType A_ddot_B = double_contract(A, B);
- const Tensor<2, dim, ADNumberType> A_dot_B = contract<1, 0>(A, B);
- const ADNumberType sp_A_B = scalar_product(A, B);
- const Tensor<4, dim, ADNumberType> op_A_B = outer_product(A, B);
+ const ADNumberType A_ddot_B = double_contract<0, 0, 1, 1>(A, B);
+ const Tensor<2, dim, ADNumberType> A_dot_B = contract<1, 0>(A, B);
+ const ADNumberType sp_A_B = scalar_product(A, B);
+ const Tensor<4, dim, ADNumberType> op_A_B = outer_product(A, B);
if (dim == 2)
const Tensor<1, dim, ADNumberType> v3 = cross_product_2d(v1);
// Contractions
const ad_number_t ad_res1 = scalar_product(adt1, adt2);
- const ad_number_t ad_res2 = double_contract(adt1, adt2);
- // ad_res1 = double_contract(adt1,t1); // TODO: Not defined. Conflicting
- // number types ad_res1 = double_contract(t1,adt2); // TODO: Not defined.
- // Conflicting number types
+ const ad_number_t ad_res2 = double_contract<0, 0, 1, 1>(adt1, adt2);
+ // TODO: Not defined. Conflicting number types
+ // ad_res1 = double_contract(adt1,t1);
+ // TODO: Not defined. Conflicting number types
+ // ad_res1 = double_contract(t1,adt2);
AD_Tensor adt7 = adt1 * adt2;
adt7 = t1 * adt2;
adt7 = adt1 * t1;
}
bs[i][j] = tmp_ij;
}
- double_contract(ba, ta, aa);
+ ba = double_contract<2, 0, 3, 1>(ta, aa);
for (unsigned int i = 0; i < dim; ++i)
for (unsigned int j = 0; j < dim; ++j)
n_x_v[0] = (-normal[1] * face_values[q_point][0] +
normal[0] * face_values[q_point][1]);
else if (dim == 3)
- cross_product(*reinterpret_cast<Tensor<1, dim> *>(&n_x_v),
- normal,
- face_values[q_point]);
+ n_x_v = cross_product_3d(normal, face_values[q_point]);
if (cell->at_boundary(face))
boundary_tangentials += face_JxW_values[q_point] * n_x_v;
// boundary curl curl traces
if (dim == 3)
{
- Tensor<1, dim> n_x_curl_u;
- cross_product(n_x_curl_u,
- normal,
- *reinterpret_cast<Tensor<1, dim> *>(
- &face_curls[q_point]));
+ Tensor<1, dim> n_x_curl_u =
+ cross_product_3d(normal,
+ *reinterpret_cast<Tensor<1, dim> *>(
+ &face_curls[q_point]));
if (cell->at_boundary(face))
boundary_curl_curl_traces +=
face_JxW_values[q_point] * n_x_curl_u;
// rank3 * rank1 over all possible indices:
{
- Tensor<2, 3, int> result;
-
deallog << contract<0, 0>(rank3, rank1) << std::endl;
- contract(result, rank3, 1, rank1);
- deallog << result << std::endl << std::endl;
-
deallog << contract<1, 0>(rank3, rank1) << std::endl;
- contract(result, rank3, 2, rank1);
- deallog << result << std::endl << std::endl;
-
deallog << contract<2, 0>(rank3, rank1) << std::endl;
- contract(result, rank3, 3, rank1);
- deallog << result << std::endl << std::endl;
}
// rank2 * rank2 over all possible indices:
{
- Tensor<2, 3, int> result;
-
deallog << contract<0, 0>(rank2, rank2) << std::endl;
- contract(result, rank2, 1, rank2, 1);
- deallog << result << std::endl << std::endl;
-
deallog << contract<1, 0>(rank2, rank2) << std::endl;
- contract(result, rank2, 2, rank2, 1);
- deallog << result << std::endl << std::endl;
-
deallog << contract<0, 1>(rank2, rank2) << std::endl;
- contract(result, rank2, 1, rank2, 2);
- deallog << result << std::endl << std::endl;
-
deallog << contract<1, 1>(rank2, rank2) << std::endl;
- contract(result, rank2, 2, rank2, 2);
- deallog << result << std::endl << std::endl;
}
// rank3 * rank2 over all possible indices:
{
- Tensor<3, 3, int> result;
-
deallog << contract<0, 0>(rank3, rank2) << std::endl;
- contract(result, rank3, 1, rank2, 1);
- deallog << result << std::endl << std::endl;
-
deallog << contract<1, 0>(rank3, rank2) << std::endl;
- contract(result, rank3, 2, rank2, 1);
- deallog << result << std::endl << std::endl;
-
deallog << contract<2, 0>(rank3, rank2) << std::endl;
- contract(result, rank3, 3, rank2, 1);
- deallog << result << std::endl << std::endl;
-
deallog << contract<0, 1>(rank3, rank2) << std::endl;
- contract(result, rank3, 1, rank2, 2);
- deallog << result << std::endl << std::endl;
-
deallog << contract<1, 1>(rank3, rank2) << std::endl;
- contract(result, rank3, 2, rank2, 2);
- deallog << result << std::endl << std::endl;
-
deallog << contract<2, 1>(rank3, rank2) << std::endl;
- contract(result, rank3, 3, rank2, 2);
- deallog << result << std::endl << std::endl;
}
// rank4 ** rank2, double contraction:
{
- Tensor<2, 3, int> result;
-
deallog << double_contract<2, 0, 3, 1>(rank4, rank2) << std::endl;
deallog << double_contract<3, 1, 2, 0>(rank4, rank2) << std::endl;
deallog << double_contract<0, 2, 1, 3>(rank2, rank4) << std::endl;
deallog << double_contract<1, 3, 0, 2>(rank2, rank4) << std::endl;
-
- double_contract(result, rank4, rank2);
- deallog << result << std::endl << std::endl;
}
}
DEAL::220 440 880 110 220 440 55 110 220
-DEAL::220 440 880 110 220 440 55 110 220
-DEAL::
-DEAL::84 168 336 72 144 288 108 216 432
DEAL::84 168 336 72 144 288 108 216 432
-DEAL::
DEAL::588 294 147 504 252 126 756 378 189
-DEAL::588 294 147 504 252 126 756 378 189
-DEAL::
-DEAL::21 42 84 42 84 168 84 168 336
DEAL::21 42 84 42 84 168 84 168 336
-DEAL::
DEAL::48 96 192 24 48 96 12 24 48
-DEAL::48 96 192 24 48 96 12 24 48
-DEAL::
-DEAL::48 24 12 96 48 24 192 96 48
DEAL::48 24 12 96 48 24 192 96 48
-DEAL::
-DEAL::336 168 84 168 84 42 84 42 21
DEAL::336 168 84 168 84 42 84 42 21
-DEAL::
DEAL::196 392 784 392 784 1568 784 1568 3136 98 196 392 196 392 784 392 784 1568 49 98 196 98 196 392 196 392 784
-DEAL::196 392 784 392 784 1568 784 1568 3136 98 196 392 196 392 784 392 784 1568 49 98 196 98 196 392 196 392 784
-DEAL::
-DEAL::147 294 588 294 588 1176 588 1176 2352 126 252 504 252 504 1008 504 1008 2016 189 378 756 378 756 1512 756 1512 3024
DEAL::147 294 588 294 588 1176 588 1176 2352 126 252 504 252 504 1008 504 1008 2016 189 378 756 378 756 1512 756 1512 3024
-DEAL::
DEAL::336 672 1344 168 336 672 84 168 336 288 576 1152 144 288 576 72 144 288 432 864 1728 216 432 864 108 216 432
-DEAL::336 672 1344 168 336 672 84 168 336 288 576 1152 144 288 576 72 144 288 432 864 1728 216 432 864 108 216 432
-DEAL::
-DEAL::880 440 220 1760 880 440 3520 1760 880 440 220 110 880 440 220 1760 880 440 220 110 55 440 220 110 880 440 220
DEAL::880 440 220 1760 880 440 3520 1760 880 440 220 110 880 440 220 1760 880 440 220 110 55 440 220 110 880 440 220
-DEAL::
DEAL::336 168 84 672 336 168 1344 672 336 288 144 72 576 288 144 1152 576 288 432 216 108 864 432 216 1728 864 432
-DEAL::336 168 84 672 336 168 1344 672 336 288 144 72 576 288 144 1152 576 288 432 216 108 864 432 216 1728 864 432
-DEAL::
-DEAL::2352 1176 588 1176 588 294 588 294 147 2016 1008 504 1008 504 252 504 252 126 3024 1512 756 1512 756 378 756 378 189
DEAL::2352 1176 588 1176 588 294 588 294 147 2016 1008 504 1008 504 252 504 252 126 3024 1512 756 1512 756 378 756 378 189
-DEAL::
-DEAL::12348 10584 15876 9261 7938 11907 6174 5292 7938
DEAL::12348 10584 15876 9261 7938 11907 6174 5292 7938
DEAL::12348 10584 15876 9261 7938 11907 6174 5292 7938
DEAL::12348 10584 15876 9261 7938 11907 6174 5292 7938
DEAL::12348 10584 15876 9261 7938 11907 6174 5292 7938
-DEAL::