Skip to content

Commit

Permalink
Contact for 1D spherical
Browse files Browse the repository at this point in the history
Addresses #1609

r16042
  • Loading branch information
jasondhales authored and permcody committed Feb 14, 2014
1 parent 6730ce9 commit a2792ec
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
38 changes: 38 additions & 0 deletions framework/src/geomsearch/FindContactPoint.C
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,44 @@ findContactPoint(PenetrationLocator::PenetrationInfo & p_info,
const std::vector<RealGradient> & d2xyz_deta2 = _fe->get_d2xyzdeta2();
const std::vector<RealGradient> & d2xyz_detaxi = _fe->get_d2xyzdxideta();

if (dim == 1)
{
unsigned left(0);
unsigned right(left);
Real leftCoor((*master_elem->get_node(0))(0));
Real rightCoor(left);
for (unsigned i(1); i < master_elem->n_nodes(); ++i)
{
Real coor = (*master_elem->get_node(i))(0);
if (coor < leftCoor)
{
left = i;
leftCoor = coor;
}
if (coor > rightCoor)
{
right = i;
rightCoor = coor;
}
}
unsigned nearestNode(left);
Point nearestPoint(leftCoor, 0, 0);
if (side->node(0) == right)
{
nearestNode = right;
nearestPoint(0) = rightCoor;
}
p_info._closest_point_ref = FEInterface::inverse_map(dim, _fe_type, master_elem, nearestPoint, TOLERANCE, false);
p_info._closest_point = nearestPoint;
p_info._normal = Point(left == nearestNode ? -1 : 1, 0, 0);
p_info._distance = (slave_point - p_info._closest_point) * p_info._normal;
p_info._dxyzdxi = dxyz_dxi;
p_info._dxyzdeta = dxyz_deta;
p_info._d2xyzdxideta = d2xyz_dxieta;
contact_point_on_side = true;
return;
}

Point ref_point;

if(start_with_centroid)
Expand Down
6 changes: 5 additions & 1 deletion framework/src/geomsearch/PenetrationThread.C
Original file line number Diff line number Diff line change
Expand Up @@ -948,10 +948,14 @@ PenetrationThread::isFaceReasonableCandidate(const Elem * master_elem,
{
normal = dxyz_dxi[0].cross(dxyz_deta[0]);
}
else
else if (dim-1 == 1)
{
normal = RealGradient(dxyz_dxi[0](1),-dxyz_dxi[0](0));
}
else
{
return true;
}
normal /= normal.size();

const Real dot(d * normal);
Expand Down

0 comments on commit a2792ec

Please sign in to comment.