本文整理汇总了C++中PenetrationInfo::isCaptured方法的典型用法代码示例。如果您正苦于以下问题:C++ PenetrationInfo::isCaptured方法的具体用法?C++ PenetrationInfo::isCaptured怎么用?C++ PenetrationInfo::isCaptured使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PenetrationInfo
的用法示例。
在下文中一共展示了PenetrationInfo::isCaptured方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
ContactMaster::updateContactSet(bool beginning_of_step)
{
std::map<dof_id_type, PenetrationInfo *>::iterator
it = _penetration_locator._penetration_info.begin(),
end = _penetration_locator._penetration_info.end();
for (; it!=end; ++it)
{
const dof_id_type slave_node_num = it->first;
PenetrationInfo * pinfo = it->second;
// Skip this pinfo if there are no DOFs on this node.
if ( ! pinfo || pinfo->_node->n_comp(_sys.number(), _vars(_component)) < 1 )
continue;
if (beginning_of_step)
{
pinfo->_locked_this_step = 0;
pinfo->_starting_elem = it->second->_elem;
pinfo->_starting_side_num = it->second->_side_num;
pinfo->_starting_closest_point_ref = it->second->_closest_point_ref;
pinfo->_contact_force_old = pinfo->_contact_force;
pinfo->_accumulated_slip_old = pinfo->_accumulated_slip;
pinfo->_frictional_energy_old = pinfo->_frictional_energy;
}
const Real contact_pressure = -(pinfo->_normal * pinfo->_contact_force) / nodalArea(*pinfo);
const Real distance = pinfo->_normal * (pinfo->_closest_point - _mesh.node(slave_node_num));
// Capture
if ( ! pinfo->isCaptured() && MooseUtils::absoluteFuzzyGreaterEqual(distance, 0, _capture_tolerance))
{
pinfo->capture();
// Increment the lock count every time the node comes back into contact from not being in contact.
if (_formulation == CF_KINEMATIC)
++pinfo->_locked_this_step;
}
// Release
else if (_model != CM_GLUED &&
pinfo->isCaptured() &&
_tension_release >= 0 &&
-contact_pressure >= _tension_release &&
pinfo->_locked_this_step < 2)
{
pinfo->release();
pinfo->_contact_force.zero();
}
if (_formulation == CF_AUGMENTED_LAGRANGE && pinfo->isCaptured())
pinfo->_lagrange_multiplier -= getPenalty(*pinfo) * distance;
}
}
示例2: addPoint
void
ContactMaster::addPoints()
{
_point_to_info.clear();
std::map<dof_id_type, PenetrationInfo *>::iterator
it = _penetration_locator._penetration_info.begin(),
end = _penetration_locator._penetration_info.end();
for (; it!=end; ++it)
{
PenetrationInfo * pinfo = it->second;
// Skip this pinfo if there are no DOFs on this node.
if ( ! pinfo || pinfo->_node->n_comp(_sys.number(), _vars(_component)) < 1 )
continue;
if ( pinfo->isCaptured() )
{
addPoint(pinfo->_elem, pinfo->_closest_point);
_point_to_info[pinfo->_closest_point] = pinfo;
computeContactForce(pinfo);
}
}
}
示例3: mooseAssert
void
SlaveConstraint::addPoints()
{
_point_to_info.clear();
std::map<dof_id_type, PenetrationInfo *>::iterator
it = _penetration_locator._penetration_info.begin(),
end = _penetration_locator._penetration_info.end();
const auto & node_to_elem_map = _mesh.nodeToElemMap();
for (; it != end; ++it)
{
PenetrationInfo * pinfo = it->second;
// Skip this pinfo if there are no DOFs on this node.
if (!pinfo || pinfo->_node->n_comp(_sys.number(), _vars[_component]) < 1)
continue;
dof_id_type slave_node_num = it->first;
const Node * node = pinfo->_node;
if (pinfo->isCaptured() && node->processor_id() == processor_id())
{
// Find an element that is connected to this node that and that is also on this processor
auto node_to_elem_pair = node_to_elem_map.find(slave_node_num);
mooseAssert(node_to_elem_pair != node_to_elem_map.end(), "Missing node in node to elem map");
const std::vector<dof_id_type> & connected_elems = node_to_elem_pair->second;
Elem * elem = NULL;
for (unsigned int i = 0; i < connected_elems.size() && !elem; ++i)
{
Elem * cur_elem = _mesh.elemPtr(connected_elems[i]);
if (cur_elem->processor_id() == processor_id())
elem = cur_elem;
}
mooseAssert(elem,
"Couldn't find an element on this processor that is attached to the slave node!");
addPoint(elem, *node);
_point_to_info[*node] = pinfo;
}
}
}
示例4: num_constraints
unsigned int
FrictionalContactProblem::numLocalFrictionalConstraints()
{
GeometricSearchData & displaced_geom_search_data = getDisplacedProblem()->geomSearchData();
std::map<std::pair<unsigned int, unsigned int>, PenetrationLocator *> * penetration_locators = &displaced_geom_search_data._penetration_locators;
unsigned int num_constraints(0);
for (std::map<std::pair<unsigned int, unsigned int>, PenetrationLocator *>::iterator plit = penetration_locators->begin();
plit != penetration_locators->end();
++plit)
{
PenetrationLocator & pen_loc = *plit->second;
bool frictional_contact_this_interaction = false;
std::map<std::pair<int,int>,InteractionParams>::iterator ipit;
std::pair<int,int> ms_pair(pen_loc._master_boundary,pen_loc._slave_boundary);
ipit = _interaction_params.find(ms_pair);
if (ipit != _interaction_params.end())
frictional_contact_this_interaction = true;
if (frictional_contact_this_interaction)
{
std::vector<dof_id_type> & slave_nodes = pen_loc._nearest_node._slave_nodes;
for (unsigned int i=0; i<slave_nodes.size(); i++)
{
dof_id_type slave_node_num = slave_nodes[i];
PenetrationInfo * pinfo = pen_loc._penetration_info[slave_node_num];
if (pinfo)
if (pinfo->isCaptured())
++num_constraints;
}
}
}
return num_constraints;
}
示例5: computeContactForce
bool
MechanicalContactConstraint::shouldApply()
{
bool in_contact = false;
std::map<dof_id_type, PenetrationInfo *>::iterator found =
_penetration_locator._penetration_info.find(_current_node->id());
if ( found != _penetration_locator._penetration_info.end() )
{
PenetrationInfo * pinfo = found->second;
if ( pinfo != NULL && pinfo->isCaptured() )
{
in_contact = true;
// This does the contact force once per constraint, rather than once per quad point and for
// both master and slave cases.
computeContactForce(pinfo);
}
}
return in_contact;
}
示例6: retVal
Real
PenetrationAux::computeValue()
{
const Node * current_node = NULL;
if (_nodal)
current_node = _current_node;
else
current_node = _mesh.getQuadratureNode(_current_elem, _current_side, _qp);
PenetrationInfo * pinfo = _penetration_locator._penetration_info[current_node->id()];
Real retVal(NotPenetrated);
if (pinfo)
switch (_quantity)
{
case PA_DISTANCE:
retVal = pinfo->_distance;
break;
case PA_TANG_DISTANCE:
retVal = pinfo->_tangential_distance;
break;
case PA_NORMAL_X:
retVal = pinfo->_normal(0);
break;
case PA_NORMAL_Y:
retVal = pinfo->_normal(1);
break;
case PA_NORMAL_Z:
retVal = pinfo->_normal(2);
break;
case PA_CLOSEST_POINT_X:
retVal = pinfo->_closest_point(0);
break;
case PA_CLOSEST_POINT_Y:
retVal = pinfo->_closest_point(1);
break;
case PA_CLOSEST_POINT_Z:
retVal = pinfo->_closest_point(2);
break;
case PA_ELEM_ID:
retVal = static_cast<Real>(pinfo->_elem->id() + 1);
break;
case PA_SIDE:
retVal = static_cast<Real>(pinfo->_side_num);
break;
case PA_INCREMENTAL_SLIP_MAG:
retVal = pinfo->isCaptured() ? pinfo->_incremental_slip.norm() : 0;
break;
case PA_INCREMENTAL_SLIP_X:
retVal = pinfo->isCaptured() ? pinfo->_incremental_slip(0) : 0;
break;
case PA_INCREMENTAL_SLIP_Y:
retVal = pinfo->isCaptured() ? pinfo->_incremental_slip(1) : 0;
break;
case PA_INCREMENTAL_SLIP_Z:
retVal = pinfo->isCaptured() ? pinfo->_incremental_slip(2) : 0;
break;
case PA_ACCUMULATED_SLIP:
retVal = pinfo->_accumulated_slip;
break;
case PA_FORCE_X:
retVal = pinfo->_contact_force(0);
break;
case PA_FORCE_Y:
retVal = pinfo->_contact_force(1);
break;
case PA_FORCE_Z:
retVal = pinfo->_contact_force(2);
break;
case PA_NORMAL_FORCE_MAG:
retVal = -pinfo->_contact_force * pinfo->_normal;
break;
case PA_NORMAL_FORCE_X:
retVal = (pinfo->_contact_force * pinfo->_normal) * pinfo->_normal(0);
break;
case PA_NORMAL_FORCE_Y:
retVal = (pinfo->_contact_force * pinfo->_normal) * pinfo->_normal(1);
break;
case PA_NORMAL_FORCE_Z:
retVal = (pinfo->_contact_force * pinfo->_normal) * pinfo->_normal(2);
break;
case PA_TANGENTIAL_FORCE_MAG:
{
RealVectorValue contact_force_normal((pinfo->_contact_force * pinfo->_normal) *
pinfo->_normal);
RealVectorValue contact_force_tangential(pinfo->_contact_force - contact_force_normal);
retVal = contact_force_tangential.norm();
break;
}
case PA_TANGENTIAL_FORCE_X:
retVal =
pinfo->_contact_force(0) - (pinfo->_contact_force * pinfo->_normal) * pinfo->_normal(0);
break;
case PA_TANGENTIAL_FORCE_Y:
retVal =
pinfo->_contact_force(1) - (pinfo->_contact_force * pinfo->_normal) * pinfo->_normal(1);
break;
case PA_TANGENTIAL_FORCE_Z:
//.........这里部分代码省略.........