GMatTensor 0.10.6
Loading...
Searching...
No Matches
Cartesian2d.h
Go to the documentation of this file.
1
7#ifndef GMATTENSOR_CARTESIAN2D_H
8#define GMATTENSOR_CARTESIAN2D_H
9
10#include <xtensor/xadapt.hpp>
11#include <xtensor/xnoalias.hpp>
12#include <xtensor/xrandom.hpp>
13#include <xtensor/xtensor.hpp>
14#include <xtensor/xview.hpp>
15
16#include "config.h"
17#include "detail.hpp"
18#include "version.h"
19
20namespace GMatTensor {
21
26namespace Cartesian2d {
27
37namespace pointer {
38
44template <class T>
45inline void O2(T* ret)
46{
47 std::fill(ret, ret + 4, T(0));
48}
49
55template <class T>
56inline void O4(T* ret)
57{
58 std::fill(ret, ret + 16, T(0));
59}
60
66template <class T>
67inline void I2(T* ret)
68{
69 ret[0] = 1.0;
70 ret[1] = 0.0;
71 ret[2] = 0.0;
72 ret[3] = 1.0;
73}
74
80template <class T>
81inline void II(T* ret)
82{
83 std::fill(ret, ret + 16, T(0));
84
85 for (size_t i = 0; i < 2; ++i) {
86 for (size_t j = 0; j < 2; ++j) {
87 for (size_t k = 0; k < 2; ++k) {
88 for (size_t l = 0; l < 2; ++l) {
89 if (i == j && k == l) {
90 ret[i * 8 + j * 4 + k * 2 + l] = 1.0;
91 }
92 }
93 }
94 }
95 }
96}
97
103template <class T>
104inline void I4(T* ret)
105{
106 std::fill(ret, ret + 16, T(0));
107
108 for (size_t i = 0; i < 2; ++i) {
109 for (size_t j = 0; j < 2; ++j) {
110 for (size_t k = 0; k < 2; ++k) {
111 for (size_t l = 0; l < 2; ++l) {
112 if (i == l && j == k) {
113 ret[i * 8 + j * 4 + k * 2 + l] = 1.0;
114 }
115 }
116 }
117 }
118 }
119}
120
126template <class T>
127inline void I4rt(T* ret)
128{
129 std::fill(ret, ret + 16, T(0));
130
131 for (size_t i = 0; i < 2; ++i) {
132 for (size_t j = 0; j < 2; ++j) {
133 for (size_t k = 0; k < 2; ++k) {
134 for (size_t l = 0; l < 2; ++l) {
135 if (i == k && j == l) {
136 ret[i * 8 + j * 4 + k * 2 + l] = 1.0;
137 }
138 }
139 }
140 }
141 }
142}
143
149template <class T>
150inline void I4s(T* ret)
151{
152 I4(ret);
153
154 std::array<double, 16> i4rt;
155 I4rt(&i4rt[0]);
156
157 std::transform(ret, ret + 16, &i4rt[0], ret, std::plus<T>());
158
159 std::transform(ret, ret + 16, ret, std::bind(std::multiplies<T>(), std::placeholders::_1, 0.5));
160}
161
167template <class T>
168inline void I4d(T* ret)
169{
170 I4s(ret);
171
172 std::array<double, 16> ii;
173 II(&ii[0]);
174
175 std::transform(
176 &ii[0], &ii[0] + 16, &ii[0], std::bind(std::multiplies<T>(), std::placeholders::_1, 0.5));
177
178 std::transform(ret, ret + 16, &ii[0], ret, std::minus<T>());
179}
180
187template <class T>
188inline T Trace(const T* A)
189{
190 return A[0] + A[3];
191}
192
199template <class T>
200inline T Hydrostatic(const T* A)
201{
202 return T(0.5) * Trace(A);
203}
204
211template <class T>
212inline void sym(const T* A, T* ret)
213{
214 ret[0] = A[0];
215 ret[1] = 0.5 * (A[1] + A[2]);
216 ret[2] = ret[1];
217 ret[3] = A[3];
218}
219
227template <class T>
228inline T Hydrostatic_deviatoric(const T* A, T* ret)
229{
230 T m = Hydrostatic(A);
231 ret[0] = A[0] - m;
232 ret[1] = A[1];
233 ret[2] = A[2];
234 ret[3] = A[3] - m;
235 return m;
236}
237
246template <class T>
247inline T Deviatoric_ddot_deviatoric(const T* A)
248{
249 T m = Hydrostatic(A);
250 return (A[0] - m) * (A[0] - m) + (A[3] - m) * (A[3] - m) + T(2) * A[1] * A[2];
251}
252
259template <class T>
260inline T Norm_deviatoric(const T* A)
261{
262 return std::sqrt(Deviatoric_ddot_deviatoric(A));
263}
264
272template <class T>
273inline T A2_ddot_B2(const T* A, const T* B)
274{
275 return A[0] * B[0] + A[3] * B[3] + A[1] * B[2] + A[2] * B[1];
276}
277
285template <class T>
286inline T A2s_ddot_B2s(const T* A, const T* B)
287{
288 return A[0] * B[0] + A[3] * B[3] + T(2) * A[1] * B[1];
289}
290
298template <class T>
299inline void A2_dyadic_B2(const T* A, const T* B, T* ret)
300{
301 for (size_t i = 0; i < 2; ++i) {
302 for (size_t j = 0; j < 2; ++j) {
303 for (size_t k = 0; k < 2; ++k) {
304 for (size_t l = 0; l < 2; ++l) {
305 ret[i * 8 + j * 4 + k * 2 + l] = A[i * 2 + j] * B[k * 2 + l];
306 }
307 }
308 }
309 }
310}
311
319template <class T>
320inline void A2_dot_B2(const T* A, const T* B, T* ret)
321{
322 ret[0] = A[1] * B[2] + A[0] * B[0];
323 ret[1] = A[0] * B[1] + A[1] * B[3];
324 ret[2] = A[2] * B[0] + A[3] * B[2];
325 ret[3] = A[2] * B[1] + A[3] * B[3];
326}
327
335template <class T>
336inline void A4_ddot_B2(const T* A, const T* B, T* ret)
337{
338 std::fill(ret, ret + 4, T(0));
339
340 for (size_t i = 0; i < 2; i++) {
341 for (size_t j = 0; j < 2; j++) {
342 for (size_t k = 0; k < 2; k++) {
343 for (size_t l = 0; l < 2; l++) {
344 ret[i * 2 + j] += A[i * 8 + j * 4 + k * 2 + l] * B[l * 2 + k];
345 }
346 }
347 }
348 }
349}
350
351} // namespace pointer
352
359{
360 array_type::tensor<double, 2> ret = xt::random::randn<double>({2, 2});
361 return ret;
362}
363
370{
371 array_type::tensor<double, 4> ret = xt::random::randn<double>({2, 2, 2, 2});
372 return ret;
373}
374
381{
382 return xt::zeros<double>({2, 2});
383}
384
391{
392 return xt::zeros<double>({2, 2, 2, 2});
393}
394
414{
415 array_type::tensor<double, 2> ret = xt::empty<double>({2, 2});
416 pointer::I2(ret.data());
417 return ret;
418}
419
439{
440 array_type::tensor<double, 4> ret = xt::empty<double>({2, 2, 2, 2});
441 pointer::II(ret.data());
442 return ret;
443}
444
464{
465 array_type::tensor<double, 4> ret = xt::empty<double>({2, 2, 2, 2});
466 pointer::I4(ret.data());
467 return ret;
468}
469
489{
490 array_type::tensor<double, 4> ret = xt::empty<double>({2, 2, 2, 2});
491 pointer::I4rt(ret.data());
492 return ret;
493}
494
514{
515 array_type::tensor<double, 4> ret = xt::empty<double>({2, 2, 2, 2});
516 pointer::I4s(ret.data());
517 return ret;
518}
519
535{
536 array_type::tensor<double, 4> ret = xt::empty<double>({2, 2, 2, 2});
537 pointer::I4d(ret.data());
538 return ret;
539}
540
551template <class T>
552inline auto Trace(const T& A)
553{
554 return detail::impl_A2<T, 2>::ret0(A, [](const auto& a) { return pointer::Trace(a); });
555}
556
563template <class T, class R>
564inline void trace(const T& A, R& ret)
565{
566 detail::impl_A2<T, 2>::ret0(A, ret, [](const auto& a) { return pointer::Trace(a); });
567}
568
580template <class T>
581inline auto Hydrostatic(const T& A)
582{
583 return detail::impl_A2<T, 2>::ret0(A, [](const auto& a) { return pointer::Hydrostatic(a); });
584}
585
592template <class T, class R>
593inline void hydrostatic(const T& A, R& ret)
594{
595 detail::impl_A2<T, 2>::ret0(A, ret, [](const auto& a) { return pointer::Hydrostatic(a); });
596}
597
613template <class T>
614inline auto A2_ddot_B2(const T& A, const T& B)
615{
616 return detail::impl_A2<T, 2>::B2_ret0(
617 A, B, [](const auto& a, const auto& b) { return pointer::A2_ddot_B2(a, b); });
618}
619
627template <class T, class R>
628inline void A2_ddot_B2(const T& A, const T& B, R& ret)
629{
630 detail::impl_A2<T, 2>::B2_ret0(
631 A, B, ret, [](const auto& a, const auto& b) { return pointer::A2_ddot_B2(a, b); });
632}
633
644template <class T>
645inline auto A2s_ddot_B2s(const T& A, const T& B)
646{
647 return detail::impl_A2<T, 2>::B2_ret0(
648 A, B, [](const auto& a, const auto& b) { return pointer::A2s_ddot_B2s(a, b); });
649}
650
658template <class T, class R>
659inline void A2s_ddot_B2s(const T& A, const T& B, R& ret)
660{
661 detail::impl_A2<T, 2>::B2_ret0(
662 A, B, ret, [](const auto& a, const auto& b) { return pointer::A2s_ddot_B2s(a, b); });
663}
664
675template <class T>
676inline auto Norm_deviatoric(const T& A)
677{
678 return detail::impl_A2<T, 2>::ret0(
679 A, [](const auto& a) { return pointer::Norm_deviatoric(a); });
680}
681
688template <class T, class R>
689inline void norm_deviatoric(const T& A, R& ret)
690{
691 detail::impl_A2<T, 2>::ret0(A, ret, [](const auto& a) { return pointer::Norm_deviatoric(a); });
692}
693
705template <class T>
706inline auto Deviatoric(const T& A)
707{
708 return detail::impl_A2<T, 2>::ret2(
709 A, [](const auto& a, const auto& r) { return pointer::Hydrostatic_deviatoric(a, r); });
710}
711
718template <class T, class R>
719inline void deviatoric(const T& A, R& ret)
720{
721 detail::impl_A2<T, 2>::ret2(
722 A, ret, [](const auto& a, const auto& r) { return pointer::Hydrostatic_deviatoric(a, r); });
723}
724
739template <class T>
740inline auto Sym(const T& A)
741{
742 return detail::impl_A2<T, 2>::ret2(
743 A, [](const auto& a, const auto& r) { return pointer::sym(a, r); });
744}
745
752template <class T, class R>
753inline void sym(const T& A, R& ret)
754{
755 detail::impl_A2<T, 2>::ret2(
756 A, ret, [](const auto& a, const auto& r) { return pointer::sym(a, r); });
757}
758
774template <class T>
775inline auto A2_dot_B2(const T& A, const T& B)
776{
777 return detail::impl_A2<T, 2>::B2_ret2(A, B, [](const auto& a, const auto& b, const auto& r) {
778 return pointer::A2_dot_B2(a, b, r);
779 });
780}
781
789template <class T, class R>
790inline void A2_dot_B2(const T& A, const T& B, R& ret)
791{
792 detail::impl_A2<T, 2>::B2_ret2(A, B, ret, [](const auto& a, const auto& b, const auto& r) {
793 return pointer::A2_dot_B2(a, b, r);
794 });
795}
796
812template <class T>
813inline auto A2_dyadic_B2(const T& A, const T& B)
814{
815 return detail::impl_A2<T, 2>::B2_ret4(A, B, [](const auto& a, const auto& b, const auto& r) {
816 return pointer::A2_dyadic_B2(a, b, r);
817 });
818}
819
827template <class T, class R>
828inline void A2_dyadic_B2(const T& A, const T& B, R& ret)
829{
830 detail::impl_A2<T, 2>::B2_ret4(A, B, ret, [](const auto& a, const auto& b, const auto& r) {
831 return pointer::A2_dyadic_B2(a, b, r);
832 });
833}
834
850template <class T, class U>
851inline auto A4_ddot_B2(const T& A, const U& B)
852{
853 return detail::impl_A4<T, 2>::B2_ret2(A, B, [](const auto& a, const auto& b, const auto& r) {
854 return pointer::A4_ddot_B2(a, b, r);
855 });
856}
857
865template <class T, class U, class R>
866inline void A4_ddot_B2(const T& A, const U& B, R& ret)
867{
868 detail::impl_A4<T, 2>::B2_ret2(A, B, ret, [](const auto& a, const auto& b, const auto& r) {
869 return pointer::A4_ddot_B2(a, b, r);
870 });
871}
872
879template <class T>
880inline size_t underlying_size_A2(const T& A)
881{
882 return detail::impl_A2<T, 2>::toSizeT0(A.shape());
883}
884
891template <class T>
892inline size_t underlying_size_A4(const T& A)
893{
894 return detail::impl_A4<T, 2>::toSizeT0(A.shape());
895}
896
903template <class T>
904inline auto underlying_shape_A2(const T& A) -> std::array<size_t, detail::impl_A2<T, 2>::rank>
905{
906 return detail::impl_A2<T, 2>::toShapeT0(A.shape());
907}
908
915template <class T>
916inline auto underlying_shape_A4(const T& A) -> std::array<size_t, detail::impl_A4<T, 2>::rank>
917{
918 return detail::impl_A4<T, 2>::toShapeT0(A.shape());
919}
920
929template <size_t N>
930class Array {
931public:
935 constexpr static std::size_t rank = N;
936
937 Array() = default;
938
939 virtual ~Array() = default;
940
946 Array(const std::array<size_t, N>& shape)
947 {
948 this->init(shape);
949 }
950
956 const std::array<size_t, N>& shape() const
957 {
958 return m_shape;
959 }
960
966 const std::array<size_t, N + 2>& shape_tensor2() const
967 {
968 return m_shape_tensor2;
969 }
970
976 const std::array<size_t, N + 4>& shape_tensor4() const
977 {
978 return m_shape_tensor4;
979 }
980
987 {
988 return xt::zeros<double>(m_shape_tensor2);
989 }
990
997 {
998 return xt::zeros<double>(m_shape_tensor4);
999 }
1000
1007 {
1008 array_type::tensor<double, N + 2> ret = xt::empty<double>(m_shape_tensor2);
1009
1010#pragma omp parallel for
1011 for (size_t i = 0; i < m_size; ++i) {
1013 }
1014
1015 return ret;
1016 }
1017
1024 {
1025 array_type::tensor<double, N + 4> ret = xt::empty<double>(m_shape_tensor4);
1026
1027#pragma omp parallel for
1028 for (size_t i = 0; i < m_size; ++i) {
1030 }
1031
1032 return ret;
1033 }
1034
1041 {
1042 array_type::tensor<double, N + 4> ret = xt::empty<double>(m_shape_tensor4);
1043
1044#pragma omp parallel for
1045 for (size_t i = 0; i < m_size; ++i) {
1047 }
1048
1049 return ret;
1050 }
1051
1058 {
1059 array_type::tensor<double, N + 4> ret = xt::empty<double>(m_shape_tensor4);
1060
1061#pragma omp parallel for
1062 for (size_t i = 0; i < m_size; ++i) {
1064 }
1065
1066 return ret;
1067 }
1068
1075 {
1076 array_type::tensor<double, N + 4> ret = xt::empty<double>(m_shape_tensor4);
1077
1078#pragma omp parallel for
1079 for (size_t i = 0; i < m_size; ++i) {
1081 }
1082
1083 return ret;
1084 }
1085
1092 {
1093 array_type::tensor<double, N + 4> ret = xt::empty<double>(m_shape_tensor4);
1094
1095#pragma omp parallel for
1096 for (size_t i = 0; i < m_size; ++i) {
1098 }
1099
1100 return ret;
1101 }
1102
1103protected:
1109 void init(const std::array<size_t, N>& shape)
1110 {
1111 m_shape = shape;
1112 size_t nd = m_ndim;
1113 std::copy(m_shape.begin(), m_shape.end(), m_shape_tensor2.begin());
1114 std::copy(m_shape.begin(), m_shape.end(), m_shape_tensor4.begin());
1115 std::fill(m_shape_tensor2.begin() + N, m_shape_tensor2.end(), nd);
1116 std::fill(m_shape_tensor4.begin() + N, m_shape_tensor4.end(), nd);
1117 m_size = std::accumulate(m_shape.begin(), m_shape.end(), 1, std::multiplies<size_t>());
1118 }
1119
1121 static constexpr size_t m_ndim = 2;
1122
1124 static constexpr size_t m_stride_tensor2 = 4;
1125
1127 static constexpr size_t m_stride_tensor4 = 16;
1128
1130 size_t m_size;
1131
1133 std::array<size_t, N> m_shape;
1134
1136 std::array<size_t, N + 2> m_shape_tensor2;
1137
1139 std::array<size_t, N + 4> m_shape_tensor4;
1140};
1141
1142} // namespace Cartesian2d
1143} // namespace GMatTensor
1144
1145#endif
array_type::tensor< double, N+4 > I4d() const
Array of Cartesian2d::I4d()
Definition: Cartesian2d.h:1091
std::array< size_t, N+4 > m_shape_tensor4
Shape of an array of 4th-order tensors == [m_shape, 2, 2, 2, 2].
Definition: Cartesian2d.h:1139
Array(const std::array< size_t, N > &shape)
Constructor.
Definition: Cartesian2d.h:946
array_type::tensor< double, N+4 > O4() const
Array of Cartesian2d::O4()
Definition: Cartesian2d.h:996
const std::array< size_t, N+2 > & shape_tensor2() const
Shape of the array of second-order tensors.
Definition: Cartesian2d.h:966
static constexpr size_t m_stride_tensor2
Storage stride for 2nd-order tensors ( ).
Definition: Cartesian2d.h:1124
size_t m_size
Size of the array (of scalars) == prod(m_shape).
Definition: Cartesian2d.h:1130
const std::array< size_t, N+4 > & shape_tensor4() const
Shape of the array of fourth-order tensors.
Definition: Cartesian2d.h:976
array_type::tensor< double, N+4 > II() const
Array of Cartesian2d::II()
Definition: Cartesian2d.h:1023
static constexpr size_t m_stride_tensor4
Storage stride for 4th-order tensors ( ).
Definition: Cartesian2d.h:1127
array_type::tensor< double, N+4 > I4s() const
Array of Cartesian2d::I4s()
Definition: Cartesian2d.h:1074
std::array< size_t, N+2 > m_shape_tensor2
Shape of an array of 2nd-order tensors == [m_shape, 2, 2].
Definition: Cartesian2d.h:1136
static constexpr size_t m_ndim
Number of dimensions of tensors.
Definition: Cartesian2d.h:1121
array_type::tensor< double, N+4 > I4() const
Array of Cartesian2d::I4()
Definition: Cartesian2d.h:1040
array_type::tensor< double, N+2 > I2() const
Array of Cartesian2d::I2()
Definition: Cartesian2d.h:1006
void init(const std::array< size_t, N > &shape)
Constructor 'alias'.
Definition: Cartesian2d.h:1109
array_type::tensor< double, N+4 > I4rt() const
Array of Cartesian2d::I4rt()
Definition: Cartesian2d.h:1057
const std::array< size_t, N > & shape() const
Shape of the array (of scalars).
Definition: Cartesian2d.h:956
std::array< size_t, N > m_shape
Shape of the array (of scalars).
Definition: Cartesian2d.h:1133
static constexpr std::size_t rank
Rank of the array (the actual rank is increased with the tensor-rank).
Definition: Cartesian2d.h:935
array_type::tensor< double, N+2 > O2() const
Array of Cartesian2d::O2()
Definition: Cartesian2d.h:986
Macros used in the library.
void I4d(T *ret)
See Cartesian2d::I4d()
Definition: Cartesian2d.h:168
void I4(T *ret)
See Cartesian2d::I4()
Definition: Cartesian2d.h:104
T Deviatoric_ddot_deviatoric(const T *A)
Double tensor contraction of the tensor's deviator.
Definition: Cartesian2d.h:247
void I2(T *ret)
See Cartesian2d::I2()
Definition: Cartesian2d.h:67
T A2_ddot_B2(const T *A, const T *B)
See Cartesian2d::A2_ddot_B2()
Definition: Cartesian2d.h:273
void I4rt(T *ret)
See Cartesian2d::I4rt()
Definition: Cartesian2d.h:127
T Trace(const T *A)
See Cartesian2d::Trace()
Definition: Cartesian2d.h:188
void A4_ddot_B2(const T *A, const T *B, T *ret)
See Cartesian2d::A4_ddot_B2()
Definition: Cartesian2d.h:336
void A2_dot_B2(const T *A, const T *B, T *ret)
See Cartesian2d::A2_dot_B2()
Definition: Cartesian2d.h:320
void A2_dyadic_B2(const T *A, const T *B, T *ret)
See Cartesian2d::A2_dyadic_B2()
Definition: Cartesian2d.h:299
void I4s(T *ret)
See Cartesian2d::I4s()
Definition: Cartesian2d.h:150
T A2s_ddot_B2s(const T *A, const T *B)
See Cartesian2d::A2s_ddot_B2s()
Definition: Cartesian2d.h:286
T Norm_deviatoric(const T *A)
See Cartesian2d::Norm_deviatoric()
Definition: Cartesian2d.h:260
void sym(const T *A, T *ret)
See Cartesian2d::Sym()
Definition: Cartesian2d.h:212
void II(T *ret)
See Cartesian2d::II()
Definition: Cartesian2d.h:81
T Hydrostatic_deviatoric(const T *A, T *ret)
Returns Cartesian2d::Hydrostatic() and computes Cartesian2d::Deviatoric()
Definition: Cartesian2d.h:228
T Hydrostatic(const T *A)
See Cartesian2d::Hydrostatic()
Definition: Cartesian2d.h:200
array_type::tensor< double, 4 > Random4()
Random 4th-order tensor (for example for use in testing).
Definition: Cartesian2d.h:369
array_type::tensor< double, 2 > O2()
2nd-order null tensor (all components equal to zero).
Definition: Cartesian2d.h:380
array_type::tensor< double, 2 > I2()
2nd-order identity tensor.
Definition: Cartesian2d.h:413
auto Deviatoric(const T &A)
Deviatoric part of a tensor:
Definition: Cartesian2d.h:706
auto Norm_deviatoric(const T &A)
Norm of the tensor's deviator:
Definition: Cartesian2d.h:676
auto Hydrostatic(const T &A)
Hydrostatic part of a tensor.
Definition: Cartesian2d.h:581
void hydrostatic(const T &A, R &ret)
Same as Hydrostatic() but writes to externally allocated output.
Definition: Cartesian2d.h:593
auto Sym(const T &A)
Symmetric part of a tensor:
Definition: Cartesian2d.h:740
size_t underlying_size_A2(const T &A)
Size of the underlying array.
Definition: Cartesian2d.h:880
array_type::tensor< double, 4 > II()
Result of the dyadic product of two 2nd-order identity tensors (see I2()).
Definition: Cartesian2d.h:438
void deviatoric(const T &A, R &ret)
Same as Deviatoric() but writes to externally allocated output.
Definition: Cartesian2d.h:719
array_type::tensor< double, 4 > I4()
Fourth order unit tensor.
Definition: Cartesian2d.h:463
auto A2_ddot_B2(const T &A, const T &B)
Double tensor contraction.
Definition: Cartesian2d.h:614
void sym(const T &A, R &ret)
Same as Sym() but writes to externally allocated output.
Definition: Cartesian2d.h:753
auto A4_ddot_B2(const T &A, const U &B)
Double tensor contraction.
Definition: Cartesian2d.h:851
void norm_deviatoric(const T &A, R &ret)
Same as Norm_deviatoric() but writes to externally allocated output.
Definition: Cartesian2d.h:689
void trace(const T &A, R &ret)
Same as Trace() but writes to externally allocated output.
Definition: Cartesian2d.h:564
array_type::tensor< double, 4 > I4s()
Fourth order symmetric projection.
Definition: Cartesian2d.h:513
auto Trace(const T &A)
Trace or 2nd-order tensor.
Definition: Cartesian2d.h:552
array_type::tensor< double, 2 > Random2()
Random 2nd-order tensor (for example for use in testing).
Definition: Cartesian2d.h:358
auto A2_dot_B2(const T &A, const T &B)
Dot-product (single tensor contraction)
Definition: Cartesian2d.h:775
array_type::tensor< double, 4 > O4()
4th-order null tensor (all components equal to zero).
Definition: Cartesian2d.h:390
array_type::tensor< double, 4 > I4rt()
Right-transposed fourth order unit tensor.
Definition: Cartesian2d.h:488
array_type::tensor< double, 4 > I4d()
Fourth order deviatoric projection.
Definition: Cartesian2d.h:534
size_t underlying_size_A4(const T &A)
Size of the underlying array.
Definition: Cartesian2d.h:892
auto underlying_shape_A2(const T &A) -> std::array< size_t, detail::impl_A2< T, 2 >::rank >
Shape of the underlying array.
Definition: Cartesian2d.h:904
auto underlying_shape_A4(const T &A) -> std::array< size_t, detail::impl_A4< T, 2 >::rank >
Shape of the underlying array.
Definition: Cartesian2d.h:916
auto A2s_ddot_B2s(const T &A, const T &B)
Same as A2_ddot_B2(const T& A, const T& B, R& ret) but for symmetric tensors.
Definition: Cartesian2d.h:645
auto A2_dyadic_B2(const T &A, const T &B)
Dyadic product.
Definition: Cartesian2d.h:813
xt::xtensor< T, N > tensor
Fixed (static) rank array.
Definition: config.h:86
Tensor products / operations.
Definition: Cartesian2d.h:20