Permalink
Browse files

Merge branch 'fix_tangent_bbnd' into 'master'

fix tangential vector for BBND elements

See merge request !215
  • Loading branch information...
JSchoeberl committed Aug 9, 2017
2 parents df5493b + 1fb555c commit 07032906946ac8cc6560dbf658a4137c722d0f62
Showing with 9 additions and 44 deletions.
  1. +0 −42 fem/intrule.cpp
  2. +9 −2 fem/intrule.hpp
@@ -136,48 +136,6 @@ namespace ngfem
return eltrans->VB();
}
template <int S, int R, typename SCAL>
MappedIntegrationPoint<S,R,SCAL> ::
MappedIntegrationPoint (const IntegrationPoint & aip,
const ElementTransformation & aeltrans)
: DimMappedIntegrationPoint<R,SCAL> (aip, aeltrans)
{
this->eltrans->CalcPointJacobian(this->IP(), this->point, dxdxi);
if (S == R)
{
det = Det (dxdxi);
if(det == 0)
{
throw Exception ("Jacobi-det is zero");
}
if (det < 0 && 0)
{
throw Exception ("Jacobi-det is negative");
}
// dxidx = Inv (dxdxi);
}
else
{
if (R == 3)
{
normalvec = Cross (Vec<3,SCAL> (dxdxi.Col(0)),
Vec<3,SCAL> (dxdxi.Col(1)));
det = L2Norm (normalvec);
normalvec /= det;
}
else
{
det = sqrt ( sqr (dxdxi(0,0)) + sqr (dxdxi(1,0)));
normalvec(0) = -dxdxi(1,0) / det;
normalvec(1) = dxdxi(0,0) / det;
}
}
this->measure = fabs (det);
}
template <int S, int R, typename SCAL>
void MappedIntegrationPoint<S,R,SCAL> ::
@@ -368,7 +368,12 @@ namespace ngfem
NGS_DLL_HEADER MappedIntegrationPoint () = default;
///
NGS_DLL_HEADER MappedIntegrationPoint (const IntegrationPoint & aip,
const ElementTransformation & aeltrans);
const ElementTransformation & aeltrans)
: DimMappedIntegrationPoint<DIMR,SCAL> (aip, aeltrans)
{
this->eltrans->CalcPointJacobian(this->IP(), this->point, dxdxi);
this->Compute();
}
INLINE MappedIntegrationPoint (const IntegrationPoint & aip,
const ElementTransformation & aeltrans,
@@ -406,6 +411,7 @@ namespace ngfem
Vec<3,SCAL> (dxdxi.Col(1)));
det = L2Norm (normalvec);
normalvec /= det;
tangentialvec = TSCAL(0.0);
}
else
{
@@ -422,13 +428,14 @@ namespace ngfem
normalvec(0) = -dxdxi(1,0) / det;
normalvec(1) = dxdxi(0,0) / det;
tangentialvec = TSCAL(0.0);
}
else
{
det = 1.0;
normalvec = 1.0;
tangentialvec = TSCAL(0.0);
}
tangentialvec = TSCAL(0.0);
}
this->measure = fabs (det);
}

0 comments on commit 0703290

Please sign in to comment.