Flow123d
release_3.0.0-973-g92f55e826
|
Go to the documentation of this file.
49 template <
int spacedim>
87 inline unsigned int dim()
const
111 inline unsigned int idx()
const {
125 inline unsigned int proc()
const {
181 ASSERT(
dim() == 3)(
dim()).error(
"Cannot provide Jacobian for dimension other than 3.");
182 return arma::dot( arma::cross(*(
node(1) ) - *(
node(0) ),
189 arma::vec::fixed<spacedim>
centre()
const;
253 template <
int spacedim>
260 return arma::norm(*( node(1) ) - *( node(0) ) , 2);
265 arma::cross(*( node(1) ) - *( node(0) ), *( node(2) ) - *( node(0) )),
272 arma::cross(*( node(1) ) - *( node(0) ), *( node(2) ) - *( node(0) )),
273 *( node(3) ) - *( node(0) ) )
284 template <
int spacedim>
286 ASSERT(is_valid()).error(
"Invalid element accessor.");
287 if (is_regional() )
return arma::vec::fixed<spacedim>();
289 arma::vec::fixed<spacedim> centre;
292 for (
unsigned int li=0; li<element()->n_nodes(); li++) {
293 centre += node( li )->point();
295 centre /= (double) element()->n_nodes();
300 template <
int spacedim>
305 for(
unsigned int i=0; i<4; i++, ++side) sum_faces+=( face[i]=side->
measure());
308 for(
unsigned int i=0;i<3;i++)
309 for(
unsigned int j=i+1;j<4;j++) {
312 sum_pairs += face[i]*face[j]*arma::dot(line, line);
314 double regular = (2.0*sqrt(2.0/3.0)/9.0);
315 return fabs( measure()
316 * pow( sum_faces/sum_pairs, 3.0/4.0))/ regular;
323 arma::norm(*node(1) - *node(0), 2)
324 *arma::norm(*node(2) - *node(1), 2)
325 *arma::norm(*node(0) - *node(2), 2)
327 ) / ( sqrt(3.0) / 4.0 );
Distribution * get_el_ds() const
const SideIter side(const unsigned int loc_index) const
unsigned int mesh_idx() const
Return global idx of element in full element vector.
RegionIdx r_idx_
Region index.
unsigned int dim_
Dimension of reference element.
double tetrahedron_jacobian() const
const Mesh * mesh_
Pointer to the mesh owning the element.
double quality_measure_smooth(SideIter side) const
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
Support classes for parallel programing.
vector< Element > element_vec_
vector< arma::vec3 > vertex_list() const
bool operator==(const ElementAccessor< spacedim > &other)
LongIdx * get_row_4_el() const
const Node * node(unsigned int ni) const
bool is_elemental() const
const Element * element() const
ElementAccessor(const Mesh *mesh, unsigned int idx)
Bounding box in 3d ambient space.
unsigned int get_proc(unsigned int idx) const
get processor of the given index
bool is_boundary() const
We need this method after replacing Region by RegionIdx, and movinf RegionDB instance into particular...
BoundingBox bounding_box() const
ElementAccessor(const Mesh *mesh, RegionIdx r_idx)
static const unsigned int undefined_dim_
int find_elem_id(unsigned int pos) const
Return element id (in GMSH file) of element of given position in element vector.
const RegionDB & region_db() const
bool boundary_
True if the element is boundary.
unsigned int proc() const
unsigned int node_idx(unsigned int ni) const
Return index (in Mesh::node_vec) of ni-th node.
NodeAccessor< 3 > node_accessor(unsigned int ni) const
static unsigned int line_between_faces(unsigned int f1, unsigned int f2)
NodeAccessor< 3 > node_accessor(unsigned int idx) const
Create and return NodeAccessor to node of given idx.
unsigned int idx() const
Return local idx of element in boundary / bulk part of element vector.
const Element * operator->() const
unsigned int element_idx_
Index into Mesh::element_vec_ array.
unsigned int bulk_size_
Count of bulk elements.
virtual unsigned int n_elements(bool boundary=false) const
Returns count of boundary or bulk elements.
SideIter side(const unsigned int loc_index)
RegionIdx region_idx() const
unsigned int index() const
double measure() const
Computes the measure of the element.
unsigned int n_nodes() const
RegionIdx region_idx() const
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.