42 permutation_idx_(NULL),
55 init(dim, mesh_in, reg);
95 return arma::norm(*(
node[ 1 ]) - *(
node[ 0 ]) , 2);
139 if (side_dim ==
dim())
return 1;
142 for (
unsigned int i=0; i<
n_sides(); i++)
143 if (
side(i)->
dim() == side_dim) n++;
168 for(
unsigned int i=0;i<4;i++) sum_faces+=( face[i]=
side(i)->
measure());
171 for(
unsigned int i=0;i<3;i++)
172 for(
unsigned int j=i+1;j<4;j++) {
175 sum_pairs += face[i]*face[j]*arma::dot(line, line);
177 double regular = (2.0*sqrt(2.0/3.0)/9.0);
179 * pow( sum_faces/sum_pairs, 3.0/4.0))/ regular;
190 ) / ( sqrt(3.0) / 4.0 );
200 for (
unsigned int i=1; i<
n_nodes(); i++)
201 bounding_box.
expand( this->node[i]->point() );
208 if (
dim() == 0)
return arma::ones(1);
210 arma::mat A=map.cols(0,
dim()-1);
211 arma::mat AtA = A.t()*A;
212 arma::vec Atb = A.t()*(point - map.col(
dim()));
213 arma::vec bary_coord(
dim()+1);
214 bary_coord.rows(0,
dim() - 1) = solve(AtA, Atb);
215 bary_coord(
dim() ) = 1.0 - arma::sum( bary_coord.rows(0,
dim()-1) );
arma::vec project_point(const arma::vec3 &point, const arma::mat &map) const
Bounding box in 3d ambient space.
unsigned int n_nodes() const
#define FOR_ELEMENT_NODES(i, j)
unsigned int * boundary_idx_
int get_id(const T *it) const
unsigned int * permutation_idx_
static const unsigned int undef_idx
void expand(const Point &point)
#define FOR_ELEMENT_SIDES(i, j)
static unsigned int line_between_faces(unsigned int f1, unsigned int f2)
const RegionDB & region_db() const
ElementAccessor< 3 > element_accessor(unsigned int idx, bool boundary=false)
unsigned int n_sides() const
unsigned int index(const T *pointer) const
void get_bounding_box(BoundingBox &bounding_box) const
SideIter side(const unsigned int loc_index)
void init(unsigned int dim, Mesh *mesh_in, RegionIdx reg)
arma::vec3 centre() const
double quality_measure_smooth()
Class RefElement defines numbering of vertices, sides, calculation of normal vectors etc...
ElementAccessor< 3 > element_accessor() const
Gets ElementAccessor of this element.
unsigned int n_sides_by_dim(unsigned int side_dim)
ElementVector element
Vector of elements of the mesh.
BoundingBox bounding_box()