168 {
170
171 const size_t nb_gauss_pts = getGaussPts().size2();
172 const size_t nb_dofs = data.
getIndices().size();
173
174 if (nb_dofs) {
175
176 auto t_w = getFTensor0IntegrationWeight();
177 auto t_coords = getFTensor1CoordsAtGaussPts();
179 auto t_grad = getFTensor2FromMat<3, 3>(*(
commonDataPtr->mGradPtr));
180 size_t nb_base_functions = data.
getN().size2();
182 auto t_normal = getFTensor1Normal();
183 const double ls = sqrt(t_normal(
i) * t_normal(
i));
185
186 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
187
188 auto t_nf = getFTensor1FromArray<3, 3>(locF);
189
190 if (getNormalsAtGaussPts().size1() == nb_gauss_pts) {
192 auto t_n = getFTensor1FromPtr<3>(&*
n.data().begin());
193 t_normal(
i) = t_n(
i) / sqrt(t_n(
j) * t_n(
j));
194 }
195
196 const double alpha = t_w * getMeasure() * (*cache).density;
198 omg(
i) = (*cache).Omega(
i,
j) * t_coords(
j);
199
200 size_t bb = 0;
201 for (; bb != nb_dofs / 3; ++bb) {
202
203 t_nf(
i) +=
alpha * t_base *
205 (omg(
k) * t_normal(
k));
206
207
208 ++t_nf;
209 ++t_base;
210 }
211 for (; bb < nb_base_functions; ++bb)
212 ++t_base;
213
214 ++t_grad;
215 ++t_coords;
216 ++t_w;
217 }
218 }
219
221}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.