80 {
82 static_assert(DIM == 3,
83 "MatVolumeLengthQuality is implemented for 3D only");
84
88
92
95
96 auto t_F = getFTensor2FromPtr<DIM, DIM>(
98 auto t_P = getFTensor2FromPtr<DIM, DIM>(
100
102
107
108
110
118
120
122
123 std::array<adouble, 12> refCoords;
124 for (
auto dd = 0;
dd != 12; ++
dd) {
126 }
127
128 ta_F(
i,
J) <<= t_F(
i,
J);
129 det_aF = determinantTensor(ta_F);
130 CHKERR invertTensor(ta_F, det_aF, ta_invF);
131
132 const auto x00 = refCoords[0];
133 const auto x01 = refCoords[1];
134 const auto x02 = refCoords[2];
135 const auto x10 = refCoords[3];
136 const auto x11 = refCoords[4];
137 const auto x12 = refCoords[5];
138 const auto x20 = refCoords[6];
139 const auto x21 = refCoords[7];
140 const auto x22 = refCoords[8];
141 const auto x30 = refCoords[9];
142 const auto x31 = refCoords[10];
143 const auto x32 = refCoords[11];
144
145 const auto ax = x10 - x00;
146 const auto ay = x11 - x01;
147 const auto az = x12 - x02;
148
149 const auto bx = x20 - x00;
150 const auto by = x21 - x01;
151 const auto bz = x22 - x02;
152
153 const auto cx = x30 - x00;
154 const auto cy = x31 - x01;
155 const auto cz = x32 - x02;
156
158 (ax * (by * cz - bz * cy) - ay * (bx * cz - bz * cx) +
159 az * (bx * cy - by * cx)) /
160 6.0;
161
162 dX_dChiT(
i,
J) = 0.0;
163
166
167 for (auto ee = 0; ee != 6; ++ee) {
168 for (
auto dd = 0;
dd != DIM; ++
dd) {
169 delta_chi(dd) =
172 }
173
174 delta_X(
i) = ta_F(
i,
J) * delta_chi(
J);
175
176 lrms_squared += (1. / 6.) * delta_X(
i) * delta_X(
i);
177 lrms_squared0 += (1. / 6.) * delta_chi(
I) * delta_chi(
I);
178 dX_dChiT(
i,
I) += delta_X(
i) * delta_chi(
I);
179 }
180
181 Q(
i,
j) = ta_invF(
j,
i) - 0.5 * dX_dChiT(
i,
j) / lrms_squared;
182
183 const adouble lrms_cubed0 = lrms_squared0 * sqrt(lrms_squared0);
185 det_aF / (lrms_squared * sqrt(lrms_squared) / lrms_cubed0);
186 const adouble current_volume = det_aF * signed_volume;
188 6. * sqrt(2.) * current_volume / (lrms_squared * sqrt(lrms_squared));
189
192 ta_P(
i,
J) = q * Q(
i,
J);
193 break;
196 ta_P(
i,
J) = t_mp * Q(
i,
J);
197 break;
198 }
201 ta_P(
i,
J) = t_mp * Q(
i,
J);
202 break;
203 }
206 t_mp *= b / (1.0 -
gAmma) - 1.0 / (b -
gAmma);
207 ta_P(
i,
J) = t_mp * Q(
i,
J);
208 break;
209 }
210 default:
212 "Unknown volume-length-quality type");
213 }
214
215 ta_P(
i,
J) *=
aLpha / signed_volume;
216 ta_P(
i,
J) >>= t_P(
i,
J);
217
218 trace_off();
219
221 }
#define FTENSOR_INDEX(DIM, I)
@ MOFEM_DATA_INCONSISTENCY
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
FTensor::Index< 'j', 3 > j
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
@ BARRIER_AND_CHANGE_QUALITY_SCALED_BY_VOLUME
@ BARRIER_AND_CHANGE_QUALITY
UBlasMatrix< double > MatrixDouble
constexpr IntegrationType I
static constexpr std::array< std::array< int, 2 >, 6 > edgeNodes
std::array< double, 12 > coordsTet
boost::shared_ptr< MatOpsData > matOpsDataPtr