libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
Public 成员函数 | 所有成员列表
libMesh::PeriodicBoundaries类 参考

We're using a class instead of a typedef to allow forward declarations and future flexibility. 更多...

#include <periodic_boundaries.h>

类 libMesh::PeriodicBoundaries 继承关系图:
[图例]

Public 成员函数

PeriodicBoundaryBaseboundary (boundary_id_type id)
 
const PeriodicBoundaryBaseboundary (boundary_id_type id) const
 
 PeriodicBoundaries ()=default
 
 ~PeriodicBoundaries ()
 
const Elem * neighbor (boundary_id_type boundary_id, const PointLocatorBase &point_locator, const Elem *e, unsigned int side, unsigned int *neigh_side=nullptr) const
 

详细描述

We're using a class instead of a typedef to allow forward declarations and future flexibility.

作者
Roy Stogner
日期
2010 Maps between boundary ids and PeriodicBoundaryBase objects.

在文件 periodic_boundaries.h49 行定义.

构造及析构函数说明

libMesh::PeriodicBoundaries::PeriodicBoundaries ( )
default
libMesh::PeriodicBoundaries::~PeriodicBoundaries ( )
default

成员函数说明

PeriodicBoundaryBase * libMesh::PeriodicBoundaries::boundary ( boundary_id_type  id)

在文件 periodic_boundaries.C38 行定义.

参考自 neighbor().

39 {
40  iterator i = this->find(id);
41  if (i == this->end())
42  return nullptr;
43  return i->second.get();
44 }
const PeriodicBoundaryBase * libMesh::PeriodicBoundaries::boundary ( boundary_id_type  id) const

在文件 periodic_boundaries.C48 行定义.

49 {
50  const_iterator i = this->find(id);
51  if (i == this->end())
52  return nullptr;
53  return i->second.get();
54 }
const Elem * libMesh::PeriodicBoundaries::neighbor ( boundary_id_type  boundary_id,
const PointLocatorBase &  point_locator,
const Elem *  e,
unsigned int  side,
unsigned int *  neigh_side = nullptr 
) const

在文件 periodic_boundaries.C59 行定义.

参考 boundary(), libMesh::PeriodicBoundaryBase::get_corresponding_pos(), libMesh::invalid_uint , 以及 libMesh::PeriodicBoundaryBase::pairedboundary.

64 {
65  std::unique_ptr<const Elem> neigh_side_proxy;
66 
67  // Find a point on that side (and only that side)
68  Point p = e->build_side_ptr(side)->vertex_average();
69 
70  const PeriodicBoundaryBase * b = this->boundary(boundary_id);
71  libmesh_assert (b);
72  p = b->get_corresponding_pos(p);
73 
74  std::set<const Elem *> candidate_elements;
75  point_locator.operator()(p, candidate_elements);
76 
77  // We might have found multiple elements, e.g. if two distinct periodic
78  // boundaries are overlapping (see systems_of_equations_ex9, for example).
79  // As a result, we need to search for the element that has boundary_id.
80  const MeshBase & mesh = point_locator.get_mesh();
81  for(const Elem * elem_it : candidate_elements)
82  {
83  std::vector<unsigned int> neigh_sides =
84  mesh.get_boundary_info().sides_with_boundary_id(elem_it, b->pairedboundary);
85 
86  for (auto ns : neigh_sides)
87  {
88  if (neigh_side)
89  {
90  elem_it->build_side_ptr(neigh_side_proxy, ns);
91  if (neigh_side_proxy->contains_point(p))
92  {
93  *neigh_side = ns;
94  return elem_it;
95  }
96  }
97  else
98  // checking contains_point is too expensive if we don't
99  // definitely need it to find neigh_side
100  return elem_it;
101  }
102  }
103 
104  // If we should have found a periodic neighbor but didn't then
105  // either we're on a ghosted element with a remote periodic neighbor
106  // or we're on a mesh with an inconsistent periodic boundary.
107  libmesh_error_msg_if(mesh.is_serial() ||
108  (e->processor_id() == mesh.processor_id()),
109  "Periodic boundary neighbor not found");
110 
111  if (neigh_side)
112  *neigh_side = libMesh::invalid_uint;
113  return remote_elem;
114 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:254
PeriodicBoundaryBase * boundary(boundary_id_type id)

该类的文档由以下文件生成: