当前位置: 首页>>代码示例>>C++>>正文


C++ BPoint::set_center方法代码示例

本文整理汇总了C++中BPoint::set_center方法的典型用法代码示例。如果您正苦于以下问题:C++ BPoint::set_center方法的具体用法?C++ BPoint::set_center怎么用?C++ BPoint::set_center使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BPoint的用法示例。


在下文中一共展示了BPoint::set_center方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: meshUtil

    const stk_classic::mesh::Entity *
    STKSearcher<SpatialDim>::findElement(MDArray& input_phy_points, MDArray& found_parametric_coordinates,
                                         unsigned& found_it, const mesh::Entity *hint_element )
    {
      //return 0;
      mesh::fem::FEMMetaData& metaData = stk_classic::mesh::fem::FEMMetaData::get(*m_bulk);
      mesh::BulkData& bulkData = *m_bulk;

      //VectorFieldType *coords_field = metaData.get_field<VectorFieldType >("coordinates");

      PerceptMesh meshUtil(&metaData, &bulkData);

      double pts[SpatialDim];
      for (unsigned iDim = 0; iDim < SpatialDim; iDim++)
        {
          pts[iDim] = input_phy_points(0, iDim);
        }
      BPoint pointBoundingBox;
      pointBoundingBox.key.ident = 123;  // FIXME for multiple points
      pointBoundingBox.set_center(pts);
      std::vector<BPoint> points(1, pointBoundingBox);

      stk_classic::search::FactoryOrder order;
      order.m_communicator = bulkData.parallel();
      order.m_algorithm = stk_classic::search::FactoryOrder::BIHTREE;

      if (0 || EXTRA_PRINT)
        {
          bool box_p = m_boxes[0].intersect(pointBoundingBox);
          bool p_box = pointBoundingBox.intersect(m_boxes[0]);

          std::cout << "STKSearcher::findElement: m_boxes[0]=  " << m_boxes[0] << std::endl;
          std::cout << "STKSearcher::findElement: pointBoundingBox=  " << pointBoundingBox << std::endl;
          std::cout << "STKSearcher::findElement: box_p=  " << box_p << std::endl;
          std::cout << "STKSearcher::findElement: p_box=  " << p_box << std::endl;
        }

      if (0 || EXTRA_PRINT) std::cout << "STKSearcher::findElement: nboxes=  " << m_boxes.size()  << std::endl;

      IdentProcRelation relation;
      stk_classic::search::coarse_search(relation,  m_boxes, points, order);
      //stk_classic::search::coarse_search(relation,   points, m_boxes, order);

      if (0 || EXTRA_PRINT) std::cout << "STKSearcher::findElement: found  " << relation.size() << " containing bboxes"  << std::endl;

      if (relation.size())
        {
          IsInElement isIn(input_phy_points, found_parametric_coordinates);

          for (unsigned i = 0; i < relation.size(); i++)
            {
              if (0 || EXTRA_PRINT)
                std::cout << "relation[ " << i << "]= {" << relation[i].first << "} --> { " << relation[i].second << "}" << std::endl;
              mesh::Entity *element = bulkData.get_entity(metaData.element_rank(), relation[i].second.ident);
              //bool loop_break = ... intentionally ignoring return value
              isIn(*element, bulkData);
              if (0 || EXTRA_PRINT) std::cout << "STKSearcher::findElement: found it= " << isIn.m_found_it << std::endl;
              if (isIn.m_found_it)
                {
                  found_it = 1;
                  return isIn.m_foundElement;
                }
              else
                {
                  found_it = 0;
                  return 0;
                }
            }
        }

      return 0;
    }
开发者ID:00liujj,项目名称:trilinos,代码行数:72,代码来源:STKSearcherDef.hpp


注:本文中的BPoint::set_center方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。