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++)
132 template<
unsigned int spacedim>
158 template<
unsigned int spacedim>
164 n_points_(_quadrature.size()),
165 n_sides_(_quadrature.dim() == dim ? 0 : dim+1),
167 side_ref_data(n_sides_),
168 data(n_points_, update_each(_flags), dim)
171 if ( _quadrature.
dim() == dim )
176 else if ( _quadrature.
dim() + 1 == dim )
179 for (
unsigned int sid = 0; sid <
n_sides_; sid++)
204 template<
unsigned int spacedim>
207 if (ref_data)
delete ref_data;
209 for (
unsigned int sid=0; sid<n_sides_; sid++)
210 delete side_ref_data[sid];
214 template<
unsigned int spacedim>
243 template<
unsigned int spacedim>
247 data.side = cell_side;
271 template<
unsigned int spacedim>
272 template<
unsigned int dim>
284 if (cell().is_valid())
301 for (
unsigned int i=0; i<n_points_; i++)
312 for (
unsigned int i=0; i<n_points_; i++)
313 data.determinants[i] = det;
317 for (
unsigned int i=0; i<n_points_; i++)
318 data.JxW_values[i] = det*ref_data->weights[i];
324 arma::mat::fixed<dim,spacedim> ijac;
333 for (
unsigned int i=0; i<n_points_; i++)
341 for (
unsigned int i=0; i<n_points_; i++)
347 template<
unsigned int spacedim>
348 template<
unsigned int dim>
351 const unsigned int side_idx = side().side_idx();
356 arma::vec::fixed<spacedim> n_cell;
358 n_cell = n_cell/norm(n_cell,2);
359 for (
unsigned int i=0; i<n_points_; i++)
368 for (
unsigned int i=0; i<n_points_; i++)
381 arma::mat::fixed<spacedim,dim> side_coords;
382 arma::mat::fixed<spacedim, MatrixSizes<dim>::dim_minus_one > side_jac;
385 for (
unsigned int n=0; n<dim; n++)
386 for (
unsigned int c=0; c<spacedim; c++)
387 side_coords(c,n) = (*data.side.node(n))[c];
393 for (
unsigned int i=0; i<n_points_; i++)
394 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...
double determinant(const T &M)
Calculates determinant of a rectangular matrix.
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.