220{
222
224 static_cast<unsigned>(sm.dNdx.cols());
225 auto const D =
226 static_cast<unsigned>(sm.dNdx.rows());
227
229
231 assert(laplaceCoeffMat.cols() == D *
NODAL_DOF);
235
236
237 assert((
unsigned)sm.dNdx.rows() ==
_d.
velocity.size() &&
238 (
unsigned)sm.dNdx.cols() ==
_d.
velocity[0].size());
239
240 auto const velocity =
241 (Traits::blockDimDim(laplaceCoeffMat, 0, 0, D, D) *
242 (sm.dNdx *
243 Eigen::Map<const typename Traits::Vector1Comp>(localX.data(),
244 N)
246 .eval();
247 assert(velocity.size() == D);
248
249 for (unsigned d = 0; d < D; ++d)
250 {
251 _d.
velocity[d][integration_point] = velocity[d];
252 }
253
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);
258
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);
263
265 {
267 {
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) *
271 sm.dNdx
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);
276 }
277 }
278
280
282 {
283 Traits::blockShp(local_b, N * r, N).noalias() +=
284 rhsCoeffVector(r) * sm.N.transpose() * sm.detJ * weight *
285 sm.integralMeasure;
286 }
287}
Eigen::Matrix3d getMassCoeffMatrix(const unsigned int_pt) const
void preEachAssembleIntegrationPoint(const unsigned int_pt, std::vector< double > const &localX, typename Traits::ShapeMatrices const &sm)
Traits::LaplaceMatrix getLaplaceCoeffMatrix(const unsigned int_pt, const unsigned dim)
Eigen::Matrix3d getContentCoeffMatrix(const unsigned int_pt) const
Eigen::Matrix3d getAdvectionCoeffMatrix(const unsigned int_pt) const
Eigen::Vector3d getRHSCoeffVector(const unsigned int_pt)
auto eval(Function &f, Tuples &... ts) -> typename detail::GetFunctionReturnType< decltype(&Function::eval)>::type
std::vector< std::vector< double > > velocity