45 template<
unsigned int spacedim>
61 template<
unsigned int spacedim>
85 for (
unsigned int c=0; c<spacedim; c++)
printf(
"%g ", n[c]);
96 template<
unsigned int spacedim>
103 for (
unsigned int i=0; i<q.
size(); i++)
117 ASSERT(
false)(q.
dim()).error(
"Unsupported dimension.\n");
120 ref_data->weights[i] = q.
weight(i);
128 template<
unsigned int spacedim>
146 ASSERT(
false)(
dim_).error(
"Unsupported dimension.\n");
154 template<
unsigned int spacedim>
160 n_points_(_quadrature.size()),
161 n_sides_(_quadrature.dim() == dim ? 0 : dim+1),
162 n_side_permutations_(_quadrature.dim() +1 == dim ? (dim+1)*(2*dim*dim-5*dim+6)/6 : 0),
165 data(n_points_, update_each(_flags), dim)
167 if (dim == 0)
return;
168 if ( _quadrature.
dim() == dim )
173 else if ( _quadrature.
dim() + 1 == dim )
176 for (
unsigned int sid = 0; sid <
n_sides_; sid++)
194 ASSERT(
false)(dim).error(
"Unsupported dimension.\n");
204 template<
unsigned int spacedim>
209 for (
unsigned int sid=0; sid<
n_sides_; sid++)
215 template<
unsigned int spacedim>
234 ASSERT(
false)(
dim_).error(
"Unsupported dimension.\n");
240 template<
unsigned int spacedim>
244 data.side = cell_side;
262 ASSERT(
false)(
dim_).error(
"Unsupported dimension.\n");
268 template<
unsigned int spacedim>
269 template<
unsigned int dim>
281 if (
cell().is_valid())
310 data.determinants[i] = det;
321 arma::mat::fixed<dim,spacedim> ijac;
344 template<
unsigned int spacedim>
345 template<
unsigned int dim>
354 arma::vec::fixed<spacedim> n_cell;
356 n_cell = n_cell/norm(n_cell,2);
379 arma::mat::fixed<spacedim,dim> side_coords;
380 arma::mat::fixed<spacedim, MatrixSizes<dim>::dim_minus_one > side_jac;
383 for (
unsigned int n=0; n<dim; n++)
384 for (
unsigned int c=0; c<spacedim; c++)
385 side_coords(c,n) = (*
data.side.node(n))[c];
392 data.side_JxW_values[i] = side_det*
side_ref_data[side_idx][perm_idx]->weights[i];
arma::mat::fixed< spacedim, dim+1 > ElementMap
~ElementValues()
Correct deallocation of objects created by 'initialize' methods.
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell...
UpdateFlags
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell...
static LocalPoint normal_vector(unsigned int sid)
const ElementAccessor< spacedim > & cell() const
Return cell at which the values were reinited.
unsigned int size() const
Transformed quadrature weight for cell sides.
#define ASSERT_EQ_DBG(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
const Side & side() const
Return cell side where the values were reinited.
void fill_data()
Compute data from reference cell and using MappingP1.
std::vector< double > side_JxW_values
JxW values for sides.
Armor::ArmaVec< double, point_dim > point(unsigned int i) const
Returns the ith quadrature point.
ElementData< spacedim > data
Data computed by the mapping.
unsigned int side_idx() const
Returns local index of the side on the element.
Determinant of the Jacobian.
Quadrature make_from_side(unsigned int sid, unsigned int pid) const
RefElementData(unsigned int np)
Resize vectors to size np.
void fill_side_data()
Calculates the mapping data on a side of a cell.
const unsigned int dim_
Dimension of space of reference cell.
std::vector< arma::vec > bar_coords
Barycentric coordinates of quadrature points.
double weight(unsigned int i) const
Returns the ith weight.
static UpdateFlags update_each(UpdateFlags flags)
Determines which additional quantities have to be computed.
Class ElementValues calculates data related to transformation of reference cell to actual cell (Jacob...
double determinant(const unsigned int point_no) const
Return the relative volume change of the cell (Jacobian determinant).
Class for computation of data on cell and side.
Side side
Iterator to last updated cell side.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
const unsigned int n_sides_
Number of sides in reference cell.
const unsigned int dim_
Dimension of space of reference cell.
ArmaVec< Type, nr > vec(uint mat_index) const
ElementAccessor< 3 > element() const
Returns iterator to the element of the side.
Base class for quadrature rules on simplices in arbitrary dimensions.
std::vector< double > weights
Quadrature weights.
arma::mat jacobian(const unsigned int point_no) const
Return Jacobian matrix at point point_no.
Transformed quadrature points.
std::vector< double > determinants
Determinants of Jacobians at quadrature points.
ArmaMat< double, N, M > mat
unsigned int dim() const
Returns dimension of the side, that is dimension of the element minus one.
RefElementData * ref_data
Data on reference element.
bool is_valid() const
Returns true if the side has assigned element.
RefElementData * init_ref_data(const Quadrature &q)
Precompute data on reference element.
std::vector< double > JxW_values
Transformed quadrature weights.
Basic definitions of numerical quadrature rules.
Affine mapping between reference and actual cell.
ElementAccessor< spacedim > cell
Iterator to last updated cell.
Structure for storing the precomputed element data.
UpdateFlags update_each(UpdateFlags flags)
Determine quantities to be recomputed on each cell.
const unsigned int n_side_permutations_
Number of permutations of points on side of reference cell.
void print()
Print calculated data.
ElementValues(Quadrature &_quadrature, UpdateFlags _flags, unsigned int dim)
Constructor.
Armor::array normal_vectors
Normal vectors (spacedim) to the element at the quadrature points lying on a side.
std::vector< std::vector< RefElementData * > > side_ref_data
Data on reference element (for each side and its permutation).
static BaryPoint local_to_bary(const LocalPoint &lp)
Converts from local to barycentric coordinates.
const unsigned int n_points_
Number of integration points.
#define OLD_ASSERT_EQUAL(a, b)
unsigned int elem_idx() const
Returns index of element in Mesh::element_vec_.
static arma::mat::fixed< spacedim, dim > jacobian(const ElementMap &coords)
ElementData(unsigned int size, UpdateFlags flags, unsigned int dim)
Resize the data arrays.
static ElementMap element_map(ElementAccessor< 3 > elm)
unsigned int size() const
Returns number of quadrature points.
unsigned int permutation_idx(unsigned int prm_idx) const
Return permutation_idx of given index.
void reinit(const ElementAccessor< spacedim > &cell)
Update cell-dependent data (gradients, Jacobians etc.)
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
Transformed quadrature weights.