Flow123d  JS_before_hm-1921-g7df00d392
accessors.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file accessors.hh
15  * @brief
16  */
17 
18 #ifndef ACCESSORS_HH_
19 #define ACCESSORS_HH_
20 
21 #include "mesh/bounding_box.hh"
22 #include "mesh/region.hh"
23 #include "mesh/elements.h"
24 #include "mesh/mesh.h"
25 #include "mesh/node_accessor.hh"
26 #include "mesh/ref_element.hh"
27 #include "la/distribution.hh"
28 #include "mesh/point.hh"
29 #include <vector>
30 #include <armadillo>
31 
32 
33 /**
34  * Due to circular dependence of return parameters in mesh accessors,
35  * and the intention to have all methods inlined,
36  * we gathered the accessors into a single file.
37  * This way, it is possible to implement it, see the simple test below.
38  *
39  * Do not include accessors_impl.hh file anywhere but at the end of this file!
40  *
41  * previous include loops:
42  * side -> boundary -> elemen accessor
43  * element accessor <-> side
44  * edge <-> side
45  * boundary -> edge
46  */
47 
48 // Compilable test of class loop dependence of return parameters.
49 // class A;
50 // class B;
51 
52 // class A{
53 // public:
54 // A()
55 // {};
56 
57 // B create_b();
58 // };
59 
60 // class B{
61 // public:
62 // B()
63 // {};
64 
65 // A create_a();
66 // };
67 
68 
69 // B A::create_b()
70 // { return B(); }
71 
72 // A B::create_a()
73 // { return A(); }
74 
75 
76 class Side;
77 class SiderIter;
78 class Edge;
79 class Boundary;
80 
81 /**
82  * Element accessor templated just by dimension of the embedding space, used by Fields.
83  * This should allow algorithms over elements where dimension of particular element is runtime parameter.
84  *
85  * This class suites as interface of Fields to the mesh elements, in particular this accessor knows directly
86  * the region, and also can be used as an accessor that works on the whole region if used by Fields that do not depend on
87  * particular elements as FieldConstant, FiledFormula, and FieldPython.
88  *
89  * TODO:
90  * - make this kind of accessor subclass of FieldCommonBase or at least move it into src/fields
91  * since it has functionality particular for Fields
92  *
93  * Ideas:
94  * need function to calculate intersection (object) of two ElementAccessors, but this definitely should be templated by
95  * dimension of the ref. element (or rather shape of ref. element), here we can have case dispatch
96  *
97  */
98 template <int spacedim>
99 class ElementAccessor {
100 public:
101  /// Default invalid accessor.
102  ElementAccessor();
103 
104  /// Regional accessor.
105  ElementAccessor(const Mesh *mesh, RegionIdx r_idx);
106 
107  /// Element accessor.
108  ElementAccessor(const Mesh *mesh, unsigned int idx);
109 
110  /// Incremental function of the Element iterator.
111  void inc();
112 
113  /// Return list of element vertices.
115 
116  /// Computes the measure of the element.
117  double measure() const;
118 
119  inline bool inverted() const {
120  return element()->inverted;
121  }
122 
123  inline double sign() const {
124  return inverted() ? -1 : 1;
125  }
126 
127  /**
128  * Returns Jacobian of 3D element.
129  * Used by measure and in intersections.
130  */
131  inline double jacobian_S3() const {
132  ASSERT_DBG(dim() == 3)(dim()).error("Dimension mismatch.");
133  return arma::dot( arma::cross(*( node(1) ) - *( node(0) ),
134  *( node(2) ) - *( node(0) )),
135  *( node(3) ) - *( node(0) )
136  );
137  }
138 
139  /**
140  * Returns Jacobian of 2D element.
141  */
142  inline double jacobian_S2() const {
143  ASSERT_DBG(dim() == 2)(dim()).error("Dimension mismatch.");
144  return arma::norm(
145  arma::cross(*( node(1) ) - *( node(0) ), *( node(2) ) - *( node(0) )),
146  2
147  );
148  }
149 
150  /**
151  * Returns Jacobian of 1D element.
152  */
153  inline double jacobian_S1() const {
154  ASSERT_DBG(dim() == 1)(dim()).error("Dimension mismatch.");
155  return arma::norm(*( node(1) ) - *( node(0) ) , 2);
156  }
157 
158  /// Computes the barycenter.
159  arma::vec::fixed<spacedim> centre() const;
160 
161  /**
162  * Quality of the element based on the smooth and scale-invariant quality measures proposed in:
163  * J. R. Schewchuk: What is a Good Linear Element?
164  *
165  * We scale the measure so that is gives value 1 for regular elements. Line 1d elements
166  * have always quality 1.
167  *
168  * We return signed value in order to detect inverted elements.
169  */
170  double quality_measure_smooth() const;
171 
172  SideIter side(const unsigned int loc_index);
173 
174  const SideIter side(const unsigned int loc_index) const;
175 
176 
177 
178  inline bool is_regional() const {
179  return r_idx_.is_valid();
180  }
181 
182  inline bool is_elemental() const {
183  return ( is_valid() && ! is_regional() );
184  }
185 
186  inline bool is_valid() const {
187  return mesh_ != NULL;
188  }
189 
190  inline unsigned int dim() const {
191  ASSERT_DBG(! is_regional());
192  return element()->dim();
193  }
194 
195  inline const Element * element() const {
197  return &(mesh_->element_vec_[element_idx_]);
198  }
199 
200 
201  inline Region region() const
202  { return Region( region_idx(), mesh_->region_db()); }
203 
204  inline RegionIdx region_idx() const {
205  if (r_idx_.is_valid()) {
206  return r_idx_;
207  } else {
208  return element()->region_idx();
209  }
210  }
211 
212  /// We need this method after replacing Region by RegionIdx, and movinf RegionDB instance into particular mesh
213  //unsigned int region_id() const {
214  // return region().id();
215  //}
216 
217  bool is_boundary() const {
219  return (element_idx_>=mesh_->n_elements());
220  }
221 
222  /// Return local idx of element in boundary / bulk part of element vector
223  unsigned int idx() const {
225  if (is_boundary()) return ( element_idx_ - mesh_->bulk_size_ );
226  else return element_idx_;
227  }
228 
229  /// Return global idx of element in full element vector
230  unsigned int mesh_idx() const {
232  return element_idx_;
233  }
234 
235  unsigned int index() const {
236  return (unsigned int)mesh_->find_elem_id(element_idx_);
237  }
238 
239  unsigned int proc() const {
242  }
243 
244 
245  NodeAccessor<3> node(unsigned int ni) const {
246  return mesh_->node( element()->node_idx(ni) );
247  }
248 
249  /**
250  * Return bounding box of the element.
251  * Simpler code, but need to check performance penelty.
252  */
254  return BoundingBox(this->vertex_list());
255  }
256 
257 
258  inline auto &orig_nodes_order() const {
260  }
261 
262  bool operator==(const ElementAccessor<spacedim>& other) const {
263  return (element_idx_ == other.element_idx_);
264  }
265 
266  inline bool operator!=(const ElementAccessor<spacedim>& other) const {
267  return (element_idx_ != other.element_idx_);
268  }
269 
270  /**
271  * -> dereference operator
272  *
273  * Allow simplify calling of element() method. Example:
274  @code
275  ElementAccessor<3> elm_ac(mesh, index);
276  arma::vec centre;
277  centre = elm_ac.element()->node_idx(0); // full format of access to element
278  centre = elm_ac->node_idx(0); // short format with dereference operator
279  @endcode
280  */
281  const Element * operator ->() const {
283  return &(mesh_->element_vec_[element_idx_]);
284  }
285 
286 
287 private:
288  /**
289  * When dim_ == undefined_dim_ ; the value of element_idx_ is invalid.
290  * Is used for ElementAccessors for whole region
291  */
292  static const unsigned int undefined_dim_ = 100;
293 
294  /// Pointer to the mesh owning the element.
295  const Mesh *mesh_;
296 
297  /// Index into Mesh::element_vec_ array.
298  unsigned int element_idx_;
299 
300  // Hack for sorption tables. TODO: remove
301  // undefined for regular elements
303 
304 };
305 
306 
307 
308 
309 
310 //=============================================================================
311 // Edge class
312 //=============================================================================
313 class Edge
314 {
315 public:
316  /// Default invalid edge accessor constructor.
317  Edge();
318 
319  /// Valid edge accessor constructor.
320  Edge(const Mesh *mesh, unsigned int edge_idx);
321 
322  /// Gets side iterator of the @p i -th side.
323  SideIter side(const unsigned int i) const;
324 
325 
326 
327  bool is_valid() const
328  { return mesh_ != nullptr; }
329 
330  /// Returns edge global index.
331  unsigned int idx() const {
332  ASSERT_DBG(is_valid());
333  return edge_idx_;
334  }
335 
336  /// Incremental function of the Edge iterator.
337  void inc() {
338  ASSERT_DBG(is_valid()).error("Do not call inc() for invalid accessor!");
339  edge_idx_++;
340  }
341 
342  /// Comparison operator of the iterator.
343  bool operator==(const Edge& other) const{
344  return (edge_idx_ == other.edge_idx_);
345  }
346 
347  /// Returns number of sides aligned with the edge.
348  unsigned int n_sides() const
349  { return edge_data()->n_sides;}
350 
351 private:
352  /// Pointer to the mesh owning the node.
353  const Mesh *mesh_;
354  /// Index into Mesh::edges vector.
355  unsigned int edge_idx_;
356 
357  /// Getter for edge data from mesh.
358  const EdgeData* edge_data() const;
359 };
360 
361 
362 
363 
364 
365 //=============================================================================
366 // Boundary class
367 //=============================================================================
368 class Boundary
369 {
370 public:
371  Boundary();
372  Boundary(BoundaryData* boundary_data);
373 
374  Edge edge();
376  Region region();
377  Element * element();
378 
379  bool is_valid() const {
380  return boundary_data_ != nullptr;
381  }
382 
383  Mesh* mesh() {
384  ASSERT_DBG(is_valid());
385  return boundary_data_->mesh_;
386  }
387 
389  ASSERT_DBG(is_valid());
390  return boundary_data_->edge_idx_;
391  }
392 
394  ASSERT_DBG(is_valid());
395  return boundary_data_->bc_ele_idx_;
396  }
397 
398 private:
400 };
401 
402 
403 
404 
405 
406 //=============================================================================
407 // Side class
408 //=============================================================================
409 class Side {
410 public:
411  /// Default invalid side accessor constructor.
412  Side();
413 
414  /// Valid edge accessor constructor.
415  Side(const Mesh * mesh, unsigned int elem_idx, unsigned int set_lnum);
416 
417  double measure() const; ///< Calculate metrics of the side
418  arma::vec3 centre() const; ///< Centre of side
419  arma::vec3 normal() const; ///< Vector of (generalized) normal
420  double diameter() const; ///< Calculate the side diameter.
421 
422  /// Returns dimension of the side, that is dimension of the element minus one.
423  unsigned int dim() const;
424 
425  /// Returns true for all sides either on boundary or connected to vb neigboring.
426  bool is_external() const;
427 
428  /// Returns true for side on the boundary.
429  bool is_boundary() const;
430 
431  /// Returns node for given local index @p i on the side.
432  NodeAccessor<3> node(unsigned int i) const;
433 
434  /// Returns iterator to the element of the side.
435  ElementAccessor<3> element() const;
436 
437  /// Returns global index of the edge connected to the side.
438  unsigned int edge_idx() const;
439 
440  /// Returns pointer to the edge connected to the side.
441  Edge edge() const;
442 
443  /**
444  * Returns boundary condition prescribed on the side.
445  * Fails on assert if side if not on boundary and no BC is prescribed.
446  */
447  Boundary cond() const;
448 
449  /// Returns global index of the prescribed boundary condition.
450  unsigned int cond_idx() const;
451 
452 
453 
454  /// Returns number of nodes of the side.
455  unsigned int n_nodes() const
456  { return dim()+1; }
457 
458  /// Returns pointer to the mesh.
459  const Mesh * mesh() const
460  { return this->mesh_; }
461 
462  /// Returns local index of the side on the element.
463  unsigned int side_idx() const
464  { return side_idx_; }
465 
466  /// Returns index of element in Mesh::element_vec_.
467  unsigned int elem_idx() const
468  { return elem_idx_; }
469 
470  /// Returns true if the side has assigned element.
471  bool is_valid() const
472  { return mesh_!= nullptr; }
473 
474  /// Iterate over local sides of the element.
475  void inc() {
476  ASSERT_DBG(is_valid()).error("Do not call inc() for invalid accessor!");
477  side_idx_++;
478  }
479 
480  bool operator==(const Side &other) const {
481  return (mesh_ == other.mesh_ ) && ( elem_idx_ == other.elem_idx_ )
482  && ( side_idx_ == other.side_idx_ );
483  }
484 
485  bool operator!=(const Side &other) const {
486  return !( *this == other);
487  }
488 
489  /// This is necessary by current DofHandler, should change this
490  //void *make_ptr() const;
491 private:
492 
493  arma::vec3 normal_point() const;
494  arma::vec3 normal_line() const;
495  arma::vec3 normal_triangle() const;
496 
497  // Topology of the mesh
498 
499  const Mesh * mesh_; ///< Pointer to Mesh to which belonged
500  unsigned int elem_idx_; ///< Index of element in Mesh::element_vec_
501  unsigned int side_idx_; ///< Local # of side in element (to remove it, we heve to remove calc_side_rhs)
502 
503 };
504 
505 
506 /*
507  * Iterator to a side.
508  */
509 class SideIter {
510 public:
512  {}
513 
514  SideIter(const Side &side)
515  : side_(side)
516  {}
517 
518  bool operator==(const SideIter &other) {
519  return (side_.mesh() == other.side_.mesh() ) && ( side_.elem_idx() == other.side_.elem_idx() )
520  && ( side_.side_idx() == other.side_.side_idx() );
521  }
522 
523 
524  bool operator!=(const SideIter &other) {
525  return !( *this == other);
526  }
527 
528  /// * dereference operator
529  const Side & operator *() const
530  { return side_; }
531 
532  /// -> dereference operator
533  const Side * operator ->() const
534  { return &side_; }
535 
536  /// prefix increment iterate only on local element
538  side_.inc();
539  return (*this);
540  }
541 
542 private:
544 };
545 
546 
547 
548 #include "mesh/accessors_impl.hh"
549 
550 #endif /* ACCESSORS_HH_ */
ElementAccessor::dim
unsigned int dim() const
Definition: accessors.hh:190
SideIter::operator->
const Side * operator->() const
-> dereference operator
Definition: accessors.hh:533
Mesh::get_el_ds
Distribution * get_el_ds() const
Definition: mesh.h:198
Side::edge
Edge edge() const
Returns pointer to the edge connected to the side.
Definition: accessors_impl.hh:221
Side::side_idx_
unsigned int side_idx_
Local # of side in element (to remove it, we heve to remove calc_side_rhs)
Definition: accessors.hh:501
Side::mesh
const Mesh * mesh() const
Returns pointer to the mesh.
Definition: accessors.hh:459
Mesh::element_nodes_original_
std::array< std::array< uint, 4 >, 64 > element_nodes_original_
Definition: mesh.h:630
Boundary
Definition: accessors.hh:368
ElementAccessor::mesh_idx
unsigned int mesh_idx() const
Return global idx of element in full element vector.
Definition: accessors.hh:230
ElementAccessor::r_idx_
RegionIdx r_idx_
Definition: accessors.hh:302
ref_element.hh
Class RefElement defines numbering of vertices, sides, calculation of normal vectors etc.
ElementAccessor::operator==
bool operator==(const ElementAccessor< spacedim > &other) const
Definition: accessors.hh:262
SideIter::side_
Side side_
Definition: accessors.hh:543
ElementAccessor::inverted
bool inverted() const
Definition: accessors.hh:119
Side::elem_idx_
unsigned int elem_idx_
Index of element in Mesh::element_vec_.
Definition: accessors.hh:500
Element::inverted
bool inverted
Inverted permutation of element nodes, negative Jacobian.
Definition: elements.h:88
Side::is_external
bool is_external() const
Returns true for all sides either on boundary or connected to vb neigboring.
Definition: accessors_impl.hh:197
ElementAccessor::mesh_
const Mesh * mesh_
Pointer to the mesh owning the element.
Definition: accessors.hh:295
Boundary::edge_idx
uint edge_idx()
Definition: accessors.hh:388
Edge::mesh_
const Mesh * mesh_
Pointer to the mesh owning the node.
Definition: accessors.hh:353
SideIter::SideIter
SideIter(const Side &side)
Definition: accessors.hh:514
Side::Side
Side()
Default invalid side accessor constructor.
Definition: accessors_impl.hh:182
Element::dim
unsigned int dim() const
Definition: elements.h:118
Edge::inc
void inc()
Incremental function of the Edge iterator.
Definition: accessors.hh:337
Side::mesh_
const Mesh * mesh_
Pointer to Mesh to which belonged.
Definition: accessors.hh:499
distribution.hh
Support classes for parallel programing.
Edge::n_sides
unsigned int n_sides() const
Returns number of sides aligned with the edge.
Definition: accessors.hh:348
ElementAccessor::jacobian_S2
double jacobian_S2() const
Definition: accessors.hh:142
point.hh
BoundaryData::edge_idx_
unsigned int edge_idx_
Definition: mesh_data.hh:49
Side::is_boundary
bool is_boundary() const
Returns true for side on the boundary.
Definition: accessors_impl.hh:202
Mesh::element_vec_
vector< Element > element_vec_
Definition: mesh.h:598
ASSERT_DBG
#define ASSERT_DBG(expr)
Definition: include_fadbad.hh:28
RegionIdx::is_valid
bool is_valid() const
Returns false if the region has undefined/invalid value.
Definition: region.hh:78
ElementAccessor::orig_nodes_order
auto & orig_nodes_order() const
Definition: accessors.hh:258
Side::dim
unsigned int dim() const
Returns dimension of the side, that is dimension of the element minus one.
Definition: accessors_impl.hh:192
std::vector< arma::vec3 >
Side::measure
double measure() const
Calculate metrics of the side.
Definition: accessors.cc:27
ElementAccessor
Definition: dh_cell_accessor.hh:32
Side::elem_idx
unsigned int elem_idx() const
Returns index of element in Mesh::element_vec_.
Definition: accessors.hh:467
Element::permutation_
uint permutation_
Index of permutation of input nodes.
Definition: elements.h:92
arma::vec3
Definition: doxy_dummy_defs.hh:17
Edge::idx
unsigned int idx() const
Returns edge global index.
Definition: accessors.hh:331
SideIter::operator==
bool operator==(const SideIter &other)
Definition: accessors.hh:518
Mesh::get_row_4_el
LongIdx * get_row_4_el() const
Definition: mesh.h:201
BoundaryData
Definition: mesh_data.hh:40
Edge::edge_data
const EdgeData * edge_data() const
Getter for edge data from mesh.
Definition: accessors_impl.hh:164
EdgeData
Definition: mesh_data.hh:25
uint
unsigned int uint
Definition: mh_dofhandler.hh:101
Side::cond
Boundary cond() const
Definition: accessors_impl.hh:225
ElementAccessor::is_elemental
bool is_elemental() const
Definition: accessors.hh:182
Edge::is_valid
bool is_valid() const
Definition: accessors.hh:327
ElementAccessor::element
const Element * element() const
Definition: accessors.hh:195
Edge::Edge
Edge()
Default invalid edge accessor constructor.
Definition: accessors_impl.hh:154
BoundaryData::bc_ele_idx_
unsigned int bc_ele_idx_
Definition: mesh_data.hh:53
ElementAccessor::quality_measure_smooth
double quality_measure_smooth() const
Definition: accessors_impl.hh:105
Side::normal_point
arma::vec3 normal_point() const
This is necessary by current DofHandler, should change this.
Definition: accessors.cc:64
Mesh::n_elements
virtual unsigned int n_elements() const
Returns count of boundary or bulk elements.
Definition: mesh.h:398
Element
Definition: elements.h:40
accessors_impl.hh
Implementation of the inline functions of the mesh accessors.
BoundingBox
Bounding box in 3d ambient space.
Definition: bounding_box.hh:54
Side::normal_triangle
arma::vec3 normal_triangle() const
Definition: accessors.cc:101
Region
Definition: region.hh:146
Distribution::get_proc
unsigned int get_proc(unsigned int idx) const
get processor of the given index
Definition: distribution.cc:130
Boundary::bc_ele_idx
uint bc_ele_idx()
Definition: accessors.hh:393
ElementAccessor::is_boundary
bool is_boundary() const
We need this method after replacing Region by RegionIdx, and movinf RegionDB instance into particular...
Definition: accessors.hh:217
ElementAccessor::bounding_box
BoundingBox bounding_box() const
Definition: accessors.hh:253
Side::edge_idx
unsigned int edge_idx() const
Returns global index of the edge connected to the side.
Definition: accessors_impl.hh:217
Side::cond_idx
unsigned int cond_idx() const
Returns global index of the prescribed boundary condition.
Definition: accessors_impl.hh:229
elements.h
Edge::side
SideIter side(const unsigned int i) const
Gets side iterator of the i -th side.
Definition: accessors_impl.hh:171
Side::normal_line
arma::vec3 normal_line() const
Definition: accessors.cc:80
ElementAccessor::operator!=
bool operator!=(const ElementAccessor< spacedim > &other) const
Definition: accessors.hh:266
ElementAccessor::inc
void inc()
Incremental function of the Element iterator.
Definition: accessors_impl.hh:49
Boundary::is_valid
bool is_valid() const
Definition: accessors.hh:379
Side::inc
void inc()
Iterate over local sides of the element.
Definition: accessors.hh:475
Side
Definition: accessors.hh:409
ElementAccessor::sign
double sign() const
Definition: accessors.hh:123
ElementAccessor::jacobian_S3
double jacobian_S3() const
Definition: accessors.hh:131
ElementAccessor::undefined_dim_
static const unsigned int undefined_dim_
Definition: accessors.hh:292
Mesh::find_elem_id
int find_elem_id(unsigned int pos) const
Return element id (in GMSH file) of element of given position in element vector.
Definition: mesh.h:412
Mesh::region_db
const RegionDB & region_db() const
Definition: mesh.h:187
SideIter::operator*
const Side & operator*() const
Definition: accessors.hh:529
SideIter::SideIter
SideIter()
Definition: accessors.hh:511
Side::element
ElementAccessor< 3 > element() const
Returns iterator to the element of the side.
Definition: accessors_impl.hh:212
ElementAccessor::vertex_list
vector< arma::vec3 > vertex_list() const
Return list of element vertices.
Definition: accessors_impl.hh:55
mesh.h
Edge::operator==
bool operator==(const Edge &other) const
Comparison operator of the iterator.
Definition: accessors.hh:343
SideIter::operator!=
bool operator!=(const SideIter &other)
Definition: accessors.hh:524
Boundary::element_accessor
ElementAccessor< 3 > element_accessor()
Definition: accessors_impl.hh:253
Side::n_nodes
unsigned int n_nodes() const
Returns number of nodes of the side.
Definition: accessors.hh:455
ElementAccessor::proc
unsigned int proc() const
Definition: accessors.hh:239
bounding_box.hh
ElementAccessor::node
NodeAccessor< 3 > node(unsigned int ni) const
Definition: accessors.hh:245
Side::centre
arma::vec3 centre() const
Centre of side.
Definition: accessors.cc:116
Side::side_idx
unsigned int side_idx() const
Returns local index of the side on the element.
Definition: accessors.hh:463
Boundary::element
Element * element()
Definition: accessors_impl.hh:264
EdgeData::n_sides
unsigned int n_sides
Definition: mesh_data.hh:29
ElementAccessor::is_valid
bool is_valid() const
Definition: accessors.hh:186
Mesh
Definition: mesh.h:98
ElementAccessor::ElementAccessor
ElementAccessor()
Default invalid accessor.
Definition: accessors_impl.hh:25
Edge
Definition: accessors.hh:313
Side::operator!=
bool operator!=(const Side &other) const
Definition: accessors.hh:485
Side::diameter
double diameter() const
Calculate the side diameter.
Definition: accessors.cc:132
RegionIdx
Definition: region.hh:67
ElementAccessor::jacobian_S1
double jacobian_S1() const
Definition: accessors.hh:153
ElementAccessor::region
Region region() const
Definition: accessors.hh:201
Boundary::mesh
Mesh * mesh()
Definition: accessors.hh:383
Boundary::boundary_data_
BoundaryData * boundary_data_
Definition: accessors.hh:399
NodeAccessor
Definition: mesh.h:55
region.hh
Boundary::Boundary
Boundary()
Definition: accessors_impl.hh:239
ElementAccessor::idx
unsigned int idx() const
Return local idx of element in boundary / bulk part of element vector.
Definition: accessors.hh:223
ElementAccessor::operator->
const Element * operator->() const
Definition: accessors.hh:281
ElementAccessor::element_idx_
unsigned int element_idx_
Index into Mesh::element_vec_ array.
Definition: accessors.hh:298
Mesh::bulk_size_
unsigned int bulk_size_
Count of bulk elements.
Definition: mesh.h:604
Side::is_valid
bool is_valid() const
Returns true if the side has assigned element.
Definition: accessors.hh:471
SideIter::operator++
SideIter & operator++()
prefix increment iterate only on local element
Definition: accessors.hh:537
Side::node
NodeAccessor< 3 > node(unsigned int i) const
Returns node for given local index i on the side.
Definition: accessors_impl.hh:206
ElementAccessor::side
SideIter side(const unsigned int loc_index)
Definition: accessors_impl.hh:139
Mesh::node
NodeAccessor< 3 > node(unsigned int idx) const
Create and return NodeAccessor to node of given idx.
Definition: mesh.cc:862
BoundaryData::mesh_
Mesh * mesh_
Definition: mesh_data.hh:54
Edge::edge_idx_
unsigned int edge_idx_
Index into Mesh::edges vector.
Definition: accessors.hh:355
Element::region_idx
RegionIdx region_idx() const
Definition: elements.h:53
Side::operator==
bool operator==(const Side &other) const
Definition: accessors.hh:480
ElementAccessor::index
unsigned int index() const
Definition: accessors.hh:235
Boundary::region
Region region()
Definition: accessors_impl.hh:259
SideIter
Definition: accessors.hh:509
Boundary::edge
Edge edge()
Definition: accessors_impl.hh:247
Side::normal
arma::vec3 normal() const
Vector of (generalized) normal.
Definition: accessors.cc:48
ElementAccessor::measure
double measure() const
Computes the measure of the element.
Definition: accessors_impl.hh:67
ElementAccessor::region_idx
RegionIdx region_idx() const
Definition: accessors.hh:204
ElementAccessor::centre
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.
Definition: accessors_impl.hh:89
ElementAccessor::is_regional
bool is_regional() const
Definition: accessors.hh:178
node_accessor.hh