24 template <
int spacedim>
inline
32 template <
int spacedim>
inline
42 template <
int spacedim>
inline
48 template <
int spacedim>
inline
50 ASSERT(!is_regional()).error(
"Do not call inc() for regional accessor!");
58 template <
int spacedim>
inline
68 return jacobian_S2() / 2.0;
71 return fabs( jacobian_S3() ) / 6.0;
80 template <
int spacedim>
inline
82 ASSERT(is_valid()).error(
"Invalid element accessor.");
83 if (is_regional() )
return arma::vec::fixed<spacedim>();
85 arma::vec::fixed<spacedim> centre;
88 for (
unsigned int li=0; li<element()->n_nodes(); li++) {
89 centre += *node( li );
91 centre /= (double) element()->n_nodes();
96 template <
int spacedim>
inline
105 arma::norm(*node(1) - *node(0), 2)
106 *arma::norm(*node(2) - *node(1), 2)
107 *arma::norm(*node(0) - *node(2), 2)
109 / ( sqrt(3.0) / 4.0 );
113 for(
unsigned int i=0; i<4; i++) sum_faces+=( face[i]=side(i)->measure());
116 for(
unsigned int i=0;i<3;i++)
117 for(
unsigned int j=i+1;j<4;j++) {
120 sum_pairs += face[i]*face[j]*arma::dot(line, line);
122 double regular = (2.0*sqrt(2.0/3.0)/9.0);
123 double sign_measure = jacobian_S3() / 6;
124 return sign_measure * pow( sum_faces/sum_pairs, 3.0/4.0) / regular;
130 template <
int spacedim>
inline
132 return SideIter(
Side(mesh_, element_idx_, loc_index) );
135 template <
int spacedim>
inline
137 return SideIter(
Side(mesh_, element_idx_, loc_index) );
141 template <
int spacedim>
inline
143 arma::vec3 node_vertex = mesh_->nodes_->vec<spacedim>( element()->node_idx(0) );
146 for(
unsigned int i=1; i<element()->n_nodes(); i++) {
147 node_vertex = mesh_->nodes_->vec<spacedim>( element()->node_idx(i) );
148 bb.expand(node_vertex);
189 : mesh_(NULL), elem_idx_(0), side_idx_(0)
193 : mesh_(mesh), elem_idx_(elem_idx), side_idx_(set_lnum)
219 ASSERT(
is_valid() ).error(
"Wrong use of uninitialized accessor.\n");
246 : boundary_data_(nullptr)
250 : boundary_data_(boundary_data)
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
const Element * element()
BoundaryData * boundary_data_
ElementAccessor< 3 > element_accessor()
Bounding box in 3d ambient space.
const MeshBase * mesh_
Pointer to the mesh owning the node.
Edge()
Default invalid edge accessor constructor.
unsigned int n_sides() const
Returns number of sides aligned with the edge.
unsigned int edge_idx_
Index into Mesh::edges vector.
SideIter side(const unsigned int i) const
Gets side iterator of the i -th side.
const EdgeData * edge_data() const
Getter for edge data from mesh.
NodeAccessor< 3 > node(unsigned int ni) const
void inc()
Incremental function of the Element iterator.
double measure() const
Computes the measure of the element.
SideIter side(const unsigned int loc_index)
BoundingBox bounding_box() const
double quality_measure_smooth() const
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.
ElementAccessor()
Default invalid accessor.
unsigned int * boundary_idx_
unsigned int edge_idx(unsigned int edg_idx) const
Return edge_idx of given index.
Base class for Mesh and BCMesh.
virtual Boundary boundary(uint edge_idx) const =0
const Element & element(unsigned idx) const
void check_element_size(unsigned int elem_idx) const
Check if given index is in element_vec_.
std::vector< EdgeData > edges
Vector of MH edges, this should not be part of the geometrical mesh.
const std::vector< unsigned int > & get_side_nodes(unsigned int dim, unsigned int side) const
Edge edge(uint edge_idx) const
Return edge with given index.
ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
BCMesh * bc_mesh() const override
Implement MeshBase::bc_mesh(), getter of boundary mesh.
static unsigned int line_between_faces(unsigned int f1, unsigned int f2)
unsigned int elem_idx() const
Returns index of element in Mesh::element_vec_.
const MeshBase * mesh_
Pointer to Mesh to which belonged.
bool is_valid() const
Returns true if the side has assigned element.
ElementAccessor< 3 > element() const
Returns iterator to the element of the side.
unsigned int cond_idx() const
Returns global index of the prescribed boundary condition.
bool is_external() const
Returns true for all sides either on boundary or connected to vb neigboring.
Side()
Default invalid side accessor constructor.
unsigned int side_idx_
Local # of side in element (to remove it, we heve to remove calc_side_rhs)
bool is_boundary() const
Returns true for side on the boundary.
unsigned int edge_idx() const
Returns global index of the edge connected to the side.
unsigned int dim() const
Returns dimension of the side, that is dimension of the element minus one.
unsigned int elem_idx_
Index of element in Mesh::element_vec_.
Edge edge() const
Returns pointer to the edge connected to the side.
NodeAccessor< 3 > node(unsigned int i) const
Returns node for given local index i on the side.
const unsigned int undef_idx