OGS
Divergence.h
Go to the documentation of this file.
1
11#pragma once
12
13namespace ProcessLib
14{
15namespace Deformation
16{
18template <int DisplacementDim, int NPOINTS, typename DNDX_Type>
20 const Eigen::Ref<Eigen::Matrix<double, NPOINTS * DisplacementDim, 1> const>&
21 u,
22 DNDX_Type const& dNdx)
23{
24 double divergence = 0;
25 for (int i = 0; i < DisplacementDim; ++i)
26 {
27 divergence += dNdx.template block<1, NPOINTS>(i, 0) *
28 u.template segment<NPOINTS>(i * NPOINTS);
29 }
30 return divergence;
31}
32} // namespace Deformation
33} // namespace ProcessLib
double divergence(const Eigen::Ref< Eigen::Matrix< double, NPOINTS *DisplacementDim, 1 > const > &u, DNDX_Type const &dNdx)
Divergence of displacement, the volumetric strain.
Definition Divergence.h:19