Flow123d
master-93637712f
|
Go to the documentation of this file.
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)
Edge edge() const
Returns pointer to the edge connected to the side.
unsigned int side_idx_
Local # of side in element (to remove it, we heve to remove calc_side_rhs)
const Element & element(unsigned idx) const
const MeshBase * mesh_
Pointer to the mesh owning the node.
unsigned int elem_idx_
Index of element in Mesh::element_vec_.
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 n_sides() const
Returns number of sides aligned with the edge.
bool is_boundary() const
Returns true for side on the boundary.
unsigned int dim() const
Returns dimension of the side, that is dimension of the element minus one.
unsigned int elem_idx() const
Returns index of element in Mesh::element_vec_.
const EdgeData * edge_data() const
Getter for edge data from mesh.
Edge()
Default invalid edge accessor constructor.
double quality_measure_smooth() const
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
Bounding box in 3d ambient space.
void check_element_size(unsigned int elem_idx) const
Check if given index is in element_vec_.
BCMesh * bc_mesh() const override
Implement MeshBase::bc_mesh(), getter of boundary mesh.
std::vector< EdgeData > edges
Vector of MH edges, this should not be part of the geometrical mesh.
BoundingBox bounding_box() const
unsigned int edge_idx() const
Returns global index of the edge connected to the side.
unsigned int cond_idx() const
Returns global index of the prescribed boundary condition.
SideIter side(const unsigned int i) const
Gets side iterator of the i -th side.
const unsigned int undef_idx
void inc()
Incremental function of the Element iterator.
ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
ElementAccessor< 3 > element() const
Returns iterator to the element of the side.
ElementAccessor< 3 > element_accessor()
NodeAccessor< 3 > node(unsigned int ni) const
const Element * element()
const std::vector< unsigned int > & get_side_nodes(unsigned int dim, unsigned int side) const
unsigned int edge_idx(unsigned int edg_idx) const
Return edge_idx of given index.
Edge edge(uint edge_idx) const
Return edge with given index.
ElementAccessor()
Default invalid accessor.
const MeshBase * mesh_
Pointer to Mesh to which belonged.
static unsigned int line_between_faces(unsigned int f1, unsigned int f2)
Base class for Mesh and BCMesh.
BoundaryData * boundary_data_
virtual Boundary boundary(uint edge_idx) const =0
bool is_valid() const
Returns true if the side has assigned element.
NodeAccessor< 3 > node(unsigned int i) const
Returns node for given local index i on the side.
SideIter side(const unsigned int loc_index)
unsigned int edge_idx_
Index into Mesh::edges vector.
unsigned int * boundary_idx_
double measure() const
Computes the measure of the element.
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.