79 {
81 static_assert(DIM == 3,
82 "AdolCVolumeLengthQuality is implemented for 3D only");
83
88
93
94 auto t_F = getFTensor2FromPtr<DIM, DIM>(
96 auto t_P = getFTensor2FromPtr<DIM, DIM>(
98
100
105
106
108
116
118
120
121 std::array<adouble, 12> refCoords;
122 for (
auto dd = 0;
dd != 12; ++
dd) {
124 }
125
126 ta_F(
i,
J) <<= t_F(
i,
J);
127 det_aF = determinantTensor(ta_F);
128 CHKERR invertTensor(ta_F, det_aF, ta_invF);
129
130 const auto x00 = refCoords[0];
131 const auto x01 = refCoords[1];
132 const auto x02 = refCoords[2];
133 const auto x10 = refCoords[3];
134 const auto x11 = refCoords[4];
135 const auto x12 = refCoords[5];
136 const auto x20 = refCoords[6];
137 const auto x21 = refCoords[7];
138 const auto x22 = refCoords[8];
139 const auto x30 = refCoords[9];
140 const auto x31 = refCoords[10];
141 const auto x32 = refCoords[11];
142
143 const auto ax = x10 - x00;
144 const auto ay = x11 - x01;
145 const auto az = x12 - x02;
146
147 const auto bx = x20 - x00;
148 const auto by = x21 - x01;
149 const auto bz = x22 - x02;
150
151 const auto cx = x30 - x00;
152 const auto cy = x31 - x01;
153 const auto cz = x32 - x02;
154
156 (ax * (by * cz - bz * cy) - ay * (bx * cz - bz * cx) +
157 az * (bx * cy - by * cx)) /
158 6.0;
159
160 dX_dChiT(
i,
J) = 0.0;
161
164
165 for (auto ee = 0; ee != 6; ++ee) {
166 for (
auto dd = 0;
dd != DIM; ++
dd) {
167 delta_chi(dd) =
170 }
171
172 delta_X(
i) = ta_F(
i,
J) * delta_chi(
J);
173
174 lrms_squared += (1. / 6.) * delta_X(
i) * delta_X(
i);
175 lrms_squared0 += (1. / 6.) * delta_chi(
I) * delta_chi(
I);
176 dX_dChiT(
i,
I) += delta_X(
i) * delta_chi(
I);
177 }
178
179 Q(
i,
j) = ta_invF(
j,
i) - 0.5 * dX_dChiT(
i,
j) / lrms_squared;
180
181 const adouble lrms_cubed0 = lrms_squared0 * sqrt(lrms_squared0);
183 det_aF / (lrms_squared * sqrt(lrms_squared) / lrms_cubed0);
184 const adouble current_volume = det_aF * signed_volume;
186 6. * sqrt(2.) * current_volume / (lrms_squared * sqrt(lrms_squared));
187
190 ta_P(
i,
J) = q * Q(
i,
J);
191 break;
194 ta_P(
i,
J) = t_mp * Q(
i,
J);
195 break;
196 }
199 ta_P(
i,
J) = t_mp * Q(
i,
J);
200 break;
201 }
204 t_mp *= b / (1.0 -
gAmma) - 1.0 / (b -
gAmma);
205 ta_P(
i,
J) = t_mp * Q(
i,
J);
206 break;
207 }
208 default:
210 "Unknown volume-length-quality type");
211 }
212
213 ta_P(
i,
J) *=
aLpha / signed_volume;
214 ta_P(
i,
J) >>= t_P(
i,
J);
215
216 trace_off();
217
219 }
#define FTENSOR_INDEX(DIM, I)
@ MOFEM_DATA_INCONSISTENCY
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
FTensor::Index< 'j', 3 > j
@ BARRIER_AND_CHANGE_QUALITY
@ BARRIER_AND_CHANGE_QUALITY_SCALED_BY_VOLUME
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)
UBlasMatrix< double > MatrixDouble
constexpr IntegrationType I
std::array< double, 12 > coordsTet
static constexpr std::array< std::array< int, 2 >, 6 > edgeNodes
boost::shared_ptr< ADolCData > adolcDataPtr