46 template<
unsigned int spacedim>
62 template<
unsigned int spacedim>
86 for (
unsigned int c=0; c<spacedim; c++)
printf(
"%g ", n[c]);
97 template<
unsigned int spacedim>
104 for (
unsigned int i=0; i<q.
size(); i++)
133 template<
unsigned int spacedim>
159 template<
unsigned int spacedim>
165 n_points_(_quadrature.size()),
166 n_sides_(_quadrature.dim() == dim ? 0 : dim+1),
168 side_ref_data(n_sides_),
169 data(n_points_, update_each(_flags), dim)
172 if ( _quadrature.
dim() == dim )
177 else if ( _quadrature.
dim() + 1 == dim )
180 for (
unsigned int sid = 0; sid <
n_sides_; sid++)
205 template<
unsigned int spacedim>
208 if (ref_data)
delete ref_data;
210 for (
unsigned int sid=0; sid<n_sides_; sid++)
211 delete side_ref_data[sid];
215 template<
unsigned int spacedim>
244 template<
unsigned int spacedim>
248 data.side = cell_side;
272 template<
unsigned int spacedim>
273 template<
unsigned int dim>
285 if (cell().is_valid())
302 for (
unsigned int i=0; i<n_points_; i++)
313 for (
unsigned int i=0; i<n_points_; i++)
314 data.determinants[i] = det;
318 for (
unsigned int i=0; i<n_points_; i++)
319 data.JxW_values[i] = det*ref_data->weights[i];
325 arma::mat::fixed<dim,spacedim> ijac;
335 for (
unsigned int i=0; i<n_points_; i++)
343 for (
unsigned int i=0; i<n_points_; i++)
349 template<
unsigned int spacedim>
350 template<
unsigned int dim>
353 const unsigned int side_idx = side().side_idx();
358 arma::vec::fixed<spacedim> n_cell;
360 n_cell = n_cell/norm(n_cell,2);
361 for (
unsigned int i=0; i<n_points_; i++)
370 for (
unsigned int i=0; i<n_points_; i++)
383 arma::mat::fixed<spacedim,dim> side_coords;
384 arma::mat::fixed<spacedim, MatrixSizes<dim>::dim_minus_one > side_jac;
387 for (
unsigned int n=0; n<dim; n++)
388 for (
unsigned int c=0; c<spacedim; c++)
389 side_coords(c,n) = (*data.side.node(n))[c];
395 for (
unsigned int i=0; i<n_points_; i++)
396 data.side_JxW_values[i] = side_det*side_ref_data[side_idx]->weights[i];
#define ASSERT_PERMANENT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
ArmaVec< Type, nr > vec(uint mat_index) const
unsigned int size() const
std::vector< double > determinants
Determinants of Jacobians at quadrature points.
ElementAccessor< spacedim > cell
Iterator to last updated cell.
ElementData(unsigned int size, UpdateFlags flags, unsigned int dim)
Resize the data arrays.
void print()
Print calculated data.
std::vector< double > JxW_values
Transformed quadrature weights.
Armor::array normal_vectors
Normal vectors (spacedim) to the element at the quadrature points lying on a side.
std::vector< double > side_JxW_values
JxW values for sides.
Side side
Iterator to last updated cell side.
Class for computation of data on cell and side.
const unsigned int n_sides_
Number of sides in reference cell.
RefElementData * ref_data
Data on reference element.
ElementValues(Quadrature &_quadrature, UpdateFlags _flags, unsigned int dim)
Constructor.
RefElementData * init_ref_data(const Quadrature &q)
Precompute data on reference element.
void fill_side_data()
Calculates the mapping data on a side of a cell.
~ElementValues()
Correct deallocation of objects created by 'initialize' methods.
std::vector< RefElementData * > side_ref_data
Data on reference element (for each side ).
void reinit(const ElementAccessor< spacedim > &cell)
Update cell-dependent data (gradients, Jacobians etc.)
UpdateFlags update_each(UpdateFlags flags)
Determine quantities to be recomputed on each cell.
void fill_data()
Compute data from reference cell and using MappingP1.
Affine mapping between reference and actual cell.
static arma::mat::fixed< spacedim, dim > jacobian(const ElementMap &coords)
arma::mat::fixed< spacedim, dim+1 > ElementMap
static ElementMap element_map(ElementAccessor< 3 > elm)
static UpdateFlags update_each(UpdateFlags flags)
Determines which additional quantities have to be computed.
Base class for quadrature rules on simplices in arbitrary dimensions.
Quadrature make_from_side(unsigned int sid) const
unsigned int size() const
Returns number of quadrature points.
Armor::ArmaVec< double, point_dim > point(unsigned int i) const
Returns the ith quadrature point.
double weight(unsigned int i) const
Returns the ith weight.
Structure for storing the precomputed element data.
RefElementData(unsigned int np)
Resize vectors to size np.
std::vector< arma::vec > bar_coords
Barycentric coordinates of quadrature points.
std::vector< double > weights
Quadrature weights.
static BaryPoint local_to_bary(const LocalPoint &lp)
Converts from local to barycentric coordinates.
static LocalPoint normal_vector(unsigned int sid)
unsigned int elem_idx() const
Returns index of element in Mesh::element_vec_.
unsigned int side_idx() const
Returns local index of the side on the element.
bool is_valid() const
Returns true if the side has assigned element.
unsigned int dim() const
Returns dimension of the side, that is dimension of the element minus one.
Class ElementValues calculates data related to transformation of reference cell to actual cell (Jacob...
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell.
ArmaMat< double, N, M > mat
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
Basic definitions of numerical quadrature rules.
UpdateFlags
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell.
@ update_volume_elements
Determinant of the Jacobian.
@ update_normal_vectors
Normal vectors.
@ update_JxW_values
Transformed quadrature weights.
@ update_jacobians
Volume element.
@ update_side_JxW_values
Transformed quadrature weight for cell sides.
@ update_inverse_jacobians
Volume element.
@ update_quadrature_points
Transformed quadrature points.