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