59 M << M_pp, M_pT, M_px, M_Tp, M_TT, M_Tx, M_xp, M_xT, M_xx;
213 unsigned integration_point,
214 std::vector<double>
const& localX,
215 typename Traits::ShapeMatrices
const& sm,
217 Eigen::Map<typename Traits::LocalMatrix>& local_M,
218 Eigen::Map<typename Traits::LocalMatrix>& local_K,
219 Eigen::Map<typename Traits::LocalVector>& local_b)
221 preEachAssembleIntegrationPoint(integration_point, localX, sm);
224 static_cast<unsigned>(sm.dNdx.cols());
226 static_cast<unsigned>(sm.dNdx.rows());
230 auto const laplaceCoeffMat = getLaplaceCoeffMatrix(integration_point, D);
231 assert(laplaceCoeffMat.cols() == D *
NODAL_DOF);
232 auto const massCoeffMat = getMassCoeffMatrix(integration_point);
233 auto const advCoeffMat = getAdvectionCoeffMatrix(integration_point);
234 auto const contentCoeffMat = getContentCoeffMatrix(integration_point);
237 assert((
unsigned)sm.dNdx.rows() == _d.velocity.size() &&
238 (
unsigned)sm.dNdx.cols() == _d.velocity[0].size());
240 auto const velocity =
241 (Traits::blockDimDim(laplaceCoeffMat, 0, 0, D, D) *
243 Eigen::Map<const typename Traits::Vector1Comp>(localX.data(),
247 assert(velocity.size() == D);
249 for (
unsigned d = 0; d < D; ++d)
251 _d.velocity[d][integration_point] = velocity[d];
254 auto const detJ_w_im_NT =
255 (sm.detJ * weight * sm.integralMeasure * sm.N.transpose()).eval();
256 auto const detJ_w_im_NT_N = (detJ_w_im_NT * sm.N).eval();
257 assert(detJ_w_im_NT_N.rows() == N && detJ_w_im_NT_N.cols() == N);
259 auto const detJ_w_im_NT_vT_dNdx =
260 (detJ_w_im_NT * velocity.transpose() * sm.dNdx).eval();
261 assert(detJ_w_im_NT_vT_dNdx.rows() == N &&
262 detJ_w_im_NT_vT_dNdx.cols() == N);
268 Traits::blockShpShp(local_K, N * r, N * c, N, N).noalias() +=
269 sm.detJ * weight * sm.integralMeasure * sm.dNdx.transpose() *
270 Traits::blockDimDim(laplaceCoeffMat, D * r, D * c, D, D) *
272 + detJ_w_im_NT_N * contentCoeffMat(r, c) +
273 detJ_w_im_NT_vT_dNdx * advCoeffMat(r, c);
274 Traits::blockShpShp(local_M, N * r, N * c, N, N).noalias() +=
275 detJ_w_im_NT_N * massCoeffMat(r, c);
279 auto const rhsCoeffVector = getRHSCoeffVector(integration_point);
283 Traits::blockShp(local_b, N * r, N).noalias() +=
284 rhsCoeffVector(r) * sm.N.transpose() * sm.detJ * weight *