Skip to content
Snippets Groups Projects
Commit 2ff5a741 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[NL] added integral measure formula

parent 9897f106
No related branches found
No related tags found
No related merge requests found
...@@ -16,9 +16,10 @@ ...@@ -16,9 +16,10 @@
#include <cassert> #include <cassert>
#include <boost/math/constants/constants.hpp>
#include "../CoordinatesMapping/ShapeMatrices.h" #include "NumLib/Fem/CoordinatesMapping/ShapeMatrices.h"
#include "../CoordinatesMapping/NaturalCoordinatesMapping.h" #include "NumLib/Fem/CoordinatesMapping/NaturalCoordinatesMapping.h"
namespace NumLib namespace NumLib
{ {
...@@ -111,6 +112,18 @@ public: ...@@ -111,6 +112,18 @@ public:
computeIntegralMeasure(is_axially_symmetric, shape); computeIntegralMeasure(is_axially_symmetric, shape);
} }
double interpolateZerothCoordinate(
typename ShapeMatrices::ShapeType const& N) const
{
auto* nodes = _ele->getNodes();
typename ShapeMatrices::ShapeType rs(N.size());
for (int i=0; i<rs.size(); ++i) {
rs[i] = (*nodes[i])[0];
}
auto const r = N.dot(rs);
return r;
}
private: private:
void computeIntegralMeasure(bool is_axially_symmetric, void computeIntegralMeasure(bool is_axially_symmetric,
ShapeMatrices& shape) const ShapeMatrices& shape) const
...@@ -119,6 +132,16 @@ private: ...@@ -119,6 +132,16 @@ private:
shape.integralMeasure = 1.0; shape.integralMeasure = 1.0;
return; return;
} }
// Note: If an integration point is located at the rotation axis, r will
// be zero which might lead to problems with the assembled equation
// system.
// E.g., for triangle elements, if an integration point is
// located at edge of the unit triangle, it is possible that
// r becomes zero.
auto const r = interpolateZerothCoordinate(shape.N);
shape.integralMeasure =
boost::math::constants::two_pi<double>() * r;
} }
const MeshElementType* _ele; const MeshElementType* _ele;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment