本文整理汇总了C++中PenetrationInfo::_contact_force方法的典型用法代码示例。如果您正苦于以下问题:C++ PenetrationInfo::_contact_force方法的具体用法?C++ PenetrationInfo::_contact_force怎么用?C++ PenetrationInfo::_contact_force使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PenetrationInfo
的用法示例。
在下文中一共展示了PenetrationInfo::_contact_force方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: distance_vec
Real
SlaveConstraint::computeQpResidual()
{
PenetrationInfo * pinfo = _point_to_info[_current_point];
const Node * node = pinfo->_node;
Real resid = pinfo->_contact_force(_component);
const Real area = nodalArea(*pinfo);
if (_formulation == CF_DEFAULT)
{
RealVectorValue distance_vec(_mesh.node(node->id()) - pinfo->_closest_point);
RealVectorValue pen_force(_penalty * distance_vec);
if (_normalize_penalty)
pen_force *= area;
if (_model == CM_FRICTIONLESS)
resid += pinfo->_normal(_component) * pinfo->_normal * pen_force;
else if (_model == CM_GLUED || _model == CM_COULOMB)
resid += pen_force(_component);
}
return _test[_i][_qp] * resid;
}
示例3: distance_vec
Real
MechanicalContactConstraint::computeQpResidual(Moose::ConstraintType type)
{
PenetrationInfo * pinfo = _penetration_locator._penetration_info[_current_node->id()];
computeContactForce(pinfo);
Real resid = pinfo->_contact_force(_component);
switch(type)
{
case Moose::Slave:
if (_formulation == CF_DEFAULT)
{
//Real distance = (*_current_node)(_component) - pinfo->_closest_point(_component);
//Real pen_force = _penalty * distance;
RealVectorValue distance_vec(*_current_node - pinfo->_closest_point);
RealVectorValue pen_force(_penalty * distance_vec);
if (_model == CM_FRICTIONLESS || _model == CM_EXPERIMENTAL)
resid += pinfo->_normal(_component) * pinfo->_normal * pen_force;
else if (_model == CM_GLUED || _model == CM_TIED || _model == CM_COULOMB)
resid += pen_force(_component);
}
return _test_slave[_i][_qp] * resid;
case Moose::Master:
return _test_master[_i][_qp] * -resid;
}
return 0;
}
示例4:
Real
ContactMaster::computeQpResidual()
{
PenetrationInfo * pinfo = _point_to_info[_current_point];
Real resid = -pinfo->_contact_force(_component);
return _test[_i][_qp] * resid;
}
示例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:
//.........这里部分代码省略.........