本文整理汇总了C++中meshtools::BoundingBox::contains_point方法的典型用法代码示例。如果您正苦于以下问题:C++ BoundingBox::contains_point方法的具体用法?C++ BoundingBox::contains_point怎么用?C++ BoundingBox::contains_point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meshtools::BoundingBox
的用法示例。
在下文中一共展示了BoundingBox::contains_point方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getLocalElemContainingPoint
void
PointSamplerBase::execute()
{
MeshTools::BoundingBox bbox = _mesh.getInflatedProcessorBoundingBox();
for (unsigned int i=0; i<_points.size(); i++)
{
Point & p = _points[i];
// Do a bounding box check so we're not doing unnecessary PointLocator lookups
if (bbox.contains_point(p))
{
std::vector<Real> & values = _values[i];
if (values.empty())
values.resize(_coupled_moose_vars.size());
// First find the element the hit lands in
const Elem * elem = getLocalElemContainingPoint(p, i);
if (elem)
{
// We have to pass a vector of points into reinitElemPhys
_point_vec[0] = p;
_subproblem.reinitElemPhys(elem, _point_vec, 0); // Zero is for tid
for (unsigned int j=0; j<_coupled_moose_vars.size(); j++)
values[j] = _coupled_moose_vars[j]->sln()[0]; // The zero is for the "qp"
_found_points[i] = true;
}
}
}
}