コード例 #1
0
void
XFEMElementPairLocator::reinit()
{
  // Does not support secondary cut yet.
  if (_xfem->has_secondary_cut())
    return;

  _element_pair_info.clear();

  for (std::list<std::pair<const Elem *, const Elem *>>::const_iterator it = _elem_pairs->begin();
       it != _elem_pairs->end();
       ++it)
  {
    const Elem * elem1 = it->first;
    const Elem * elem2 = it->second;

    std::vector<Point> intersectionPoints1;
    Point normal1;
    std::vector<Point> q_points1;
    std::vector<Real> weights1;

    unsigned int plane_id = 0; // Only support one cut plane for the time being

    _xfem->getXFEMIntersectionInfo(
        elem1, plane_id, normal1, intersectionPoints1, _use_displaced_mesh);

    if (intersectionPoints1.size() == 2)
      _xfem->getXFEMqRuleOnLine(intersectionPoints1, q_points1, weights1);
    else if (intersectionPoints1.size() > 2)
      _xfem->getXFEMqRuleOnSurface(intersectionPoints1, q_points1, weights1);

    if (!_use_displaced_mesh)
    {
      ElementPairInfo new_elem_info(
          elem1, elem2, q_points1, q_points1, weights1, weights1, normal1, -normal1);
      _element_pair_info.insert(
          std::pair<std::pair<const Elem *, const Elem *>, ElementPairInfo>(*it, new_elem_info));
    }
    else
    {
      std::vector<Point> intersectionPoints2;
      Point normal2;
      std::vector<Point> q_points2;
      std::vector<Real> weights2;

      _xfem->getXFEMIntersectionInfo(
          elem2, plane_id, normal2, intersectionPoints2, _use_displaced_mesh);

      if (intersectionPoints2.size() == 2)
        _xfem->getXFEMqRuleOnLine(intersectionPoints2, q_points2, weights2);
      else if (intersectionPoints2.size() > 2)
        _xfem->getXFEMqRuleOnSurface(intersectionPoints2, q_points2, weights2);

      ElementPairInfo new_elem_info(
          elem1, elem2, q_points1, q_points2, weights1, weights2, normal1, normal2);
      _element_pair_info.insert(
          std::pair<std::pair<const Elem *, const Elem *>, ElementPairInfo>(*it, new_elem_info));
    }
  }
}
コード例 #2
0
ファイル: XFEMElementPairLocator.C プロジェクト: Biyss/moose
void
XFEMElementPairLocator::reinit()
{
  _element_pair_info.clear();

  for (std::list<std::pair<const Elem *, const Elem*> >::const_iterator it = _elem_pairs->begin();
       it != _elem_pairs->end(); ++it)
  {
    const Elem * elem = it->first;
    const Elem * elem2 = it->second;

    std::vector<Point> intersectionPoints;

    Point normal;
    std::vector<Point> q_points;
    std::vector<Real> weights;

    unsigned int plane_id = 0; // Only support one cut plane for the time being
    _xfem->getXFEMIntersectionInfo(elem, plane_id, normal, intersectionPoints);

    if (intersectionPoints.size() == 2)
      _xfem->getXFEMqRuleOnLine(intersectionPoints, q_points, weights);
    else if (intersectionPoints.size() > 2)
      _xfem->getXFEMqRuleOnSurface(intersectionPoints, q_points, weights);

    ElementPairInfo new_elem_info(elem, q_points, weights, normal);
    _element_pair_info.insert(std::pair<const Elem*, ElementPairInfo>(elem, new_elem_info));
  }
}