Flow123d
JS_before_hm-1711-g43b724b37
|
Go to the documentation of this file.
24 template <
int spacedim>
inline
32 template <
int spacedim>
inline
34 : dim_(undefined_dim_),
42 template <
int spacedim>
inline
45 boundary_(idx>=mesh->n_elements()),
47 r_idx_(element()->region_idx())
52 template <
int spacedim>
inline
54 ASSERT(!is_regional()).error(
"Do not call inc() for regional accessor!");
56 r_idx_ = element()->region_idx();
57 dim_=element()->dim();
58 boundary_ = (element_idx_>=mesh_->n_elements());
61 template <
int spacedim>
inline
63 vector<arma::vec3> vertices(element()->n_nodes());
64 for(
unsigned int i=0; i<element()->n_nodes(); i++) vertices[i]=*node(i);
68 template <
int spacedim>
inline
71 ASSERT(dim() == 3)(dim()).error(
"Cannot provide Jacobian for dimension other than 3.");
72 return arma::dot( arma::cross(*( node(1) ) - *( node(0) ),
73 *( node(2) ) - *( node(0) )),
74 *( node(3) ) - *( node(0) )
81 template <
int spacedim>
inline
88 return arma::norm(*( node(1) ) - *( node(0) ) , 2);
93 arma::cross(*( node(1) ) - *( node(0) ), *( node(2) ) - *( node(0) )),
100 arma::cross(*( node(1) ) - *( node(0) ), *( node(2) ) - *( node(0) )),
101 *( node(3) ) - *( node(0) ) )
111 template <
int spacedim>
inline
113 ASSERT(is_valid()).error(
"Invalid element accessor.");
114 if (is_regional() )
return arma::vec::fixed<spacedim>();
116 arma::vec::fixed<spacedim> centre;
119 for (
unsigned int li=0; li<element()->n_nodes(); li++) {
120 centre += *node( li );
122 centre /= (double) element()->n_nodes();
127 template <
int spacedim>
inline
132 for(
unsigned int i=0; i<4; i++) sum_faces+=( face[i]=side(i)->measure());
135 for(
unsigned int i=0;i<3;i++)
136 for(
unsigned int j=i+1;j<4;j++) {
139 sum_pairs += face[i]*face[j]*arma::dot(line, line);
141 double regular = (2.0*sqrt(2.0/3.0)/9.0);
142 return fabs( measure()
143 * pow( sum_faces/sum_pairs, 3.0/4.0))/ regular;
150 arma::norm(*node(1) - *node(0), 2)
151 *arma::norm(*node(2) - *node(1), 2)
152 *arma::norm(*node(0) - *node(2), 2)
154 ) / ( sqrt(3.0) / 4.0 );
159 template <
int spacedim>
inline
161 return SideIter(
Side(mesh_, element_idx_, loc_index) );
164 template <
int spacedim>
inline
166 return SideIter(
Side(mesh_, element_idx_, loc_index) );
177 edge_idx_(
Mesh::undef_idx)
204 : mesh_(NULL), elem_idx_(0), side_idx_(0)
207 inline Side::Side(
const Mesh * mesh,
unsigned int elem_idx,
unsigned int set_lnum)
208 : mesh_(mesh), elem_idx_(elem_idx), side_idx_(set_lnum)
234 ASSERT(
is_valid() ).error(
"Wrong use of uninitialized accessor.\n");
261 : boundary_data_(nullptr)
265 : 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 dim_
Dimension of reference element.
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.
double tetrahedron_jacobian() const
const Mesh * mesh_
Pointer to the mesh owning the node.
static const unsigned int undef_idx
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
const Element * element() 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.
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.