Skip to content
Snippets Groups Projects
Commit 1e92bee7 authored by Jonathan Youett's avatar Jonathan Youett
Browse files

Fix case when the grids overlap a little

parent e4fe0a3a
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -65,7 +65,7 @@ void ClosestPointProjection<BoundaryPatchType>::project(const BoundaryPatchType&
const BoundaryPatchType& mortar,
const ctype couplingDist)
{
ctype eps = 1e-5;
ctype eps = 1e-11;
// initialize
this->obsDirections_.resize(nonmortar.numVertices());
......@@ -131,19 +131,20 @@ void ClosestPointProjection<BoundaryPatchType>::project(const BoundaryPatchType&
// if we found a feasible closest point save the distance and
if (bestTri != -1) {
this->obstacles_[localIdx] = dist;
// if obstacle distance is very small, use minus the outer mortar normal as direction
if (dist<1e-5) {
// if there is overlap, fix orientation of the direction
if (dist<this->overlap_ and (projDirection*mortarSegments[bestTri].unitOuterNormal)>eps) {
this->obsDirections_[localIdx] = projDirection;
this->obsDirections_[localIdx] *= -1;
// if obstacle distance is very small, use the inner mortar normal as direction
} else if (dist<eps) {
this->obsDirections_[localIdx] = mortarSegments[bestTri].unitOuterNormal;
this->obsDirections_[localIdx] *= -1;
} else
this->obsDirections_[localIdx] = projDirection;
} else {
this->obstacles_[localIdx] = std::numeric_limits<ctype>::max();
this->obsDirections_[localIdx] = averagedNonmortarNormals[globalIdx];
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment