252 {
255 int nb_integration_pts = data.
getN().size1();
256 auto v = getVolume();
257 auto t_w = getFTensor0IntegrationWeight();
258 auto t_div_P = getFTensor1FromMat<3>(
dataAtPts->divPAtPts);
259 auto t_s_dot_w = getFTensor1FromMat<3>(
dataAtPts->wDotAtPts);
260 if (
dataAtPts->wDotDotAtPts.size1() == 0 &&
261 dataAtPts->wDotDotAtPts.size2() != nb_integration_pts) {
262 dataAtPts->wDotDotAtPts.resize(3, nb_integration_pts);
264 }
265 auto t_s_dot_dot_w = getFTensor1FromMat<3>(
dataAtPts->wDotDotAtPts);
266
267 int nb_base_functions = data.
getN().size2();
269
271 auto get_ftensor1 = [](
auto &
v) {
274 };
275
276 for (int gg = 0; gg != nb_integration_pts; ++gg) {
278 auto t_nf = get_ftensor1(
nF);
279 int bb = 0;
280 for (; bb != nb_dofs / 3; ++bb) {
281 t_nf(
i) +=
a * t_row_base_fun * t_div_P(
i);
282 t_nf(
i) -=
a * t_row_base_fun *
alphaW * t_s_dot_w(
i);
283 t_nf(
i) -=
a * t_row_base_fun *
alphaRho * t_s_dot_dot_w(
i);
284 ++t_nf;
285 ++t_row_base_fun;
286 }
287 for (; bb != nb_base_functions; ++bb)
288 ++t_row_base_fun;
289 ++t_w;
290 ++t_div_P;
291 ++t_s_dot_w;
292 ++t_s_dot_dot_w;
293 }
294
296}
#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()
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)
VectorDouble nF
local right hand side vector
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
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.