Flow123d
JS_before_hm-1879-g0c4ed93bc
|
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!");
54 template <
int spacedim>
inline
56 vector<arma::vec3> vertices(element()->n_nodes());
57 for(
unsigned int i=0; i<element()->n_nodes(); i++) vertices[i]=*node(i);
66 template <
int spacedim>
inline
76 return jacobian_S2() / 2.0;
79 return fabs( jacobian_S3() ) / 6.0;
88 template <
int spacedim>
inline
90 ASSERT(is_valid()).error(
"Invalid element accessor.");
91 if (is_regional() )
return arma::vec::fixed<spacedim>();
93 arma::vec::fixed<spacedim> centre;
96 for (
unsigned int li=0; li<element()->n_nodes(); li++) {
97 centre += *node( li );
99 centre /= (double) element()->n_nodes();
104 template <
int spacedim>
inline
113 arma::norm(*node(1) - *node(0), 2)
114 *arma::norm(*node(2) - *node(1), 2)
115 *arma::norm(*node(0) - *node(2), 2)
117 / ( sqrt(3.0) / 4.0 );
121 for(
unsigned int i=0; i<4; i++) sum_faces+=( face[i]=side(i)->measure());
124 for(
unsigned int i=0;i<3;i++)
125 for(
unsigned int j=i+1;j<4;j++) {
128 sum_pairs += face[i]*face[j]*arma::dot(line, line);
130 double regular = (2.0*sqrt(2.0/3.0)/9.0);
131 double sign_measure = jacobian_S3() / 6;
132 return sign_measure * pow( sum_faces/sum_pairs, 3.0/4.0) / regular;
138 template <
int spacedim>
inline
140 return SideIter(
Side(mesh_, element_idx_, loc_index) );
143 template <
int spacedim>
inline
145 return SideIter(
Side(mesh_, element_idx_, loc_index) );
183 : mesh_(NULL), elem_idx_(0), side_idx_(0)
186 inline Side::Side(
const Mesh * mesh,
unsigned int elem_idx,
unsigned int set_lnum)
187 : mesh_(mesh), elem_idx_(elem_idx), side_idx_(set_lnum)
213 ASSERT(
is_valid() ).error(
"Wrong use of uninitialized accessor.\n");
240 : boundary_data_(nullptr)
244 : 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)
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.
const Mesh * mesh_
Pointer to the mesh owning the node.
Side()
Default invalid side accessor constructor.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
const Mesh * mesh_
Pointer to Mesh to which belonged.
unsigned int n_sides() const
Returns number of sides aligned with the edge.
bool is_boundary() const
Returns true for side on the boundary.
vector< Element > element_vec_
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.
Boundary boundary(uint edge_idx) const
Edge()
Default invalid edge accessor constructor.
double quality_measure_smooth() 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.
vector< vector< vector< unsigned int > > > side_nodes
ElementAccessor< 3 > element() const
Returns iterator to the element of the side.
vector< arma::vec3 > vertex_list() const
Return list of element vertices.
ElementAccessor< 3 > element_accessor()
NodeAccessor< 3 > node(unsigned int ni) const
void check_element_size(unsigned int elem_idx) const
Check if given index is in element_vec_.
unsigned int edge_idx(unsigned int edg_idx) const
Return edge_idx of given index.
ElementAccessor()
Default invalid accessor.
std::vector< EdgeData > edges
Vector of MH edges, this should not be part of the geometrical mesh.
static unsigned int line_between_faces(unsigned int f1, unsigned int f2)
BoundaryData * boundary_data_
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
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)
virtual ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
unsigned int edge_idx_
Index into Mesh::edges vector.
unsigned int * boundary_idx_
Edge edge(uint edge_idx) const
double measure() const
Computes the measure of the element.
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.