本文整理汇总了C++中PenetrationInfo::_closest_point方法的典型用法代码示例。如果您正苦于以下问题:C++ PenetrationInfo::_closest_point方法的具体用法?C++ PenetrationInfo::_closest_point怎么用?C++ PenetrationInfo::_closest_point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PenetrationInfo
的用法示例。
在下文中一共展示了PenetrationInfo::_closest_point方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Real
OneDContactConstraint::computeQpSlaveValue()
{
PenetrationInfo * pinfo = _penetration_locator._penetration_info[_current_node->id()];
Moose::err<<std::endl
<<"Popping out node: "<<_current_node->id()<<std::endl
<<"Closest Point x: "<<pinfo->_closest_point(0)<<std::endl
<<"Current Node x: "<<(*_current_node)(0)<<std::endl
<<"Current Value: "<<_u_slave[_qp]<<std::endl<<std::endl;
return pinfo->_closest_point(0) - ((*_current_node)(0) - _u_slave[_qp]);
}
示例2: switch
Real
GluedContactConstraint::computeQpResidual(Moose::ConstraintType type)
{
switch (type)
{
case Moose::Slave:
{
PenetrationInfo * pinfo = _penetration_locator._penetration_info[_current_node->id()];
Real distance = (*_current_node)(_component) - pinfo->_closest_point(_component);
Real pen_force = _penalty * distance;
Real resid = pen_force;
pinfo->_contact_force(_component) = resid;
pinfo->_mech_status=PenetrationInfo::MS_STICKING;
return _test_slave[_i][_qp] * resid;
}
case Moose::Master:
{
PenetrationInfo * pinfo = _penetration_locator._penetration_info[_current_node->id()];
long int dof_number = _current_node->dof_number(0, _vars(_component), 0);
Real resid = _residual_copy(dof_number);
pinfo->_contact_force(_component) = -resid;
pinfo->_mech_status=PenetrationInfo::MS_STICKING;
return _test_master[_i][_qp] * resid;
}
}
return 0;
}
示例3:
Real
MultiDContactConstraint::computeQpSlaveValue()
{
PenetrationInfo * pinfo = _penetration_locator._penetration_info[_current_node->id()];
/*
Moose::err<<std::endl
<<"Popping out node: "<<_current_node->id()<<std::endl
<<"Closest Point "<<_component<<": "<<pinfo->_closest_point(_component)<<std::endl
<<"Current Node "<<_component<<": "<<(*_current_node)(_component)<<std::endl
<<"Current Value: "<<_u_slave[_qp]<<std::endl
<<"New Value: "<<pinfo->_closest_point(_component) - ((*_current_node)(_component) - _u_slave[_qp])<<std::endl
<<"Change: "<<_u_slave[_qp] - (pinfo->_closest_point(_component) - ((*_current_node)(_component) - _u_slave[_qp]))<<std::endl<<std::endl;
*/
return pinfo->_closest_point(_component) - ((*_current_node)(_component) - _u_slave[_qp]);
}
示例4: switch
Real
OneDContactConstraint::computeQpResidual(Moose::ConstraintType type)
{
PenetrationInfo * pinfo = _penetration_locator._penetration_info[_current_node->id()];
switch (type)
{
case Moose::Slave:
// return (_u_slave[_qp] - _u_master[_qp])*_test_slave[_i][_qp];
return ((*_current_node)(0) - pinfo->_closest_point(0)) * _test_slave[_i][_qp];
case Moose::Master:
double slave_resid = _residual_copy(_current_node->dof_number(0, _var.number(), 0));
return slave_resid*_test_master[_i][_qp];
}
return 0;
}
示例5: 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:
//.........这里部分代码省略.........