30 template<
unsigned int dim,
unsigned int spacedim>
35 template<
unsigned int dim,
unsigned int spacedim>
52 for (
unsigned int i=0; i<dim; i++)
63 for (
unsigned int i=0; i<q.
size(); i++)
72 template<
unsigned int dim,
unsigned int spacedim>
89 template<
unsigned int dim,
unsigned int spacedim>
97 arma::mat::fixed<spacedim,dim> jac;
105 coords = element_map(cell);
118 for (
unsigned int i=0; i<q.
size(); i++)
128 for (
unsigned int i=0; i<q.
size(); i++)
133 for (
unsigned int i=0; i<q.
size(); i++)
140 arma::mat::fixed<dim,spacedim> ijac;
149 for (
unsigned int i=0; i<q.
size(); i++)
158 for (
unsigned int i=0; i<q.
size(); i++)
163 template<
unsigned int dim,
unsigned int spacedim>
179 coords = element_map(cell);
188 arma::mat::fixed<spacedim,dim> jac = coords*grad;
192 for (
unsigned int i=0; i<q.
size(); i++)
199 for (
unsigned int i=0; i<q.
size(); i++)
206 arma::mat::fixed<dim,spacedim> ijac;
216 for (
unsigned int i=0; i<q.
size(); i++)
222 arma::vec::fixed<spacedim> n_cell;
224 n_cell = n_cell/norm(n_cell,2);
225 for (
unsigned int i=0; i<q.
size(); i++)
235 for (
unsigned int i=0; i<q.
size(); i++)
248 arma::mat::fixed<spacedim,dim> side_coords;
249 arma::mat::fixed<spacedim, MatrixSizes<dim>::dim_minus_one > side_jac;
253 for (
unsigned int n=0; n<dim; n++)
254 for (
unsigned int c=0; c<spacedim; c++)
255 side_coords(c,n) = cell.
side(sid)->
node(n)->point()[c];
256 side_jac = side_coords * grad.submat(0,0,dim-1,dim-2);
261 for (
unsigned int i=0; i<q.
size(); i++)
267 template<
unsigned int dim,
unsigned int spacedim>
271 for (
unsigned int i=0; i<dim+1; i++)
272 coords.col(i) = elm.node(i)->point();
277 template<
unsigned int dim,
unsigned int spacedim>
280 arma::mat::fixed<3, dim> A =
map.cols(1,dim);
281 for(
unsigned int i=0; i < dim; i++ ) {
282 A.col(i) -=
map.col(0);
285 arma::mat::fixed<dim, dim> AtA = A.t()*A;
286 arma::vec::fixed<dim> Atb = A.t()*(point -
map.col(0));
287 arma::vec::fixed<dim+1> bary_coord;
288 bary_coord.rows(1, dim) = arma::solve(AtA, Atb);
289 bary_coord( 0 ) = 1.0 - arma::sum( bary_coord.rows(1,dim) );
293 template<
unsigned int dim,
unsigned int spacedim>
299 template<
unsigned int dim,
unsigned int spacedim>
304 template <
unsigned int dim,
unsigned int spacedim>
307 arma::vec projection = this->project_real_to_unit(point, this->element_map(elm));
arma::mat::fixed< spacedim, dim+1 > ElementMap
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)
Transformed quadrature weight for cell sides.
RealPoint project_unit_to_real(const BaryPoint &point, const ElementMap &map) const
BaryPoint project_real_to_unit(const RealPoint &point, const ElementMap &map) const
Determinant of the Jacobian.
std::vector< arma::mat::fixed< dim, spacedim > > inverse_jacobians
Inverse Jacobians at the quadrature points.
UpdateFlags update_flags
Flags that indicate which finite element quantities are to be computed.
UpdateFlags update_each(UpdateFlags flags)
Determines which additional quantities have to be computed.
Class FEValues calculates finite element data on the actual cells such as shape function values...
static const double epsilon
stabilization parameter
arma::vec::fixed< spacedim > RealPoint
SideIter side(const unsigned int loc_index)
std::vector< double > JxW_values
Transformed quadrature weights.
double weight(const unsigned int i) const
Returns the ith weight.
Base class for quadrature rules on simplices in arbitrary dimensions.
double determinant(const T &M)
Calculates determinant of a rectangular matrix.
std::vector< arma::vec::fixed< spacedim > > normal_vectors
Shape functions (for vectorial finite elements) evaluated at quadrature points.
Armor::vec< point_dim > point(const unsigned int i) const
Returns the ith quadrature point.
Transformed quadrature points.
std::vector< arma::mat::fixed< spacedim, dim > > jacobians
Jacobians of the mapping at the quadrature points.
std::vector< arma::vec::fixed< spacedim > > points
Coordinates of quadrature points in the actual cell coordinate system.
const unsigned int size() const
Returns number of quadrature points.
arma::vec::fixed< dim+1 > BaryPoint
std::vector< arma::vec > bar_coords
Auxiliary array of barycentric coordinates of quadrature points.
Basic definitions of numerical quadrature rules.
void fill_fe_side_values(const ElementAccessor< 3 > &cell, unsigned int sid, const Quadrature &q, MappingInternalData &data, FEValuesData< dim, spacedim > &fv_data)
Calculates the mapping data on a side of a cell.
NodeAccessor< 3 > node(unsigned int i) const
#define ASSERT_LE_DBG(a, b)
Definition of comparative assert macro (Less or Equal) only for debug mode.
MappingInternalData * initialize(const Quadrature &q, UpdateFlags flags)
Initializes the structures and computes static data.
Class FEValuesData holds the arrays of data computed by Mapping and FiniteElement.
void fill_fe_values(const ElementAccessor< 3 > &cell, const Quadrature &q, MappingInternalData &data, FEValuesData< dim, spacedim > &fv_data)
Calculates the mapping data on the actual cell.
std::vector< double > determinants
Determinants of Jacobians at quadrature points.
static BaryPoint clip(const BaryPoint &barycentric)
BaryPoint clip_to_element(BaryPoint &barycentric)
bool contains_point(arma::vec point, ElementAccessor< 3 > elm)
Test if element contains given point.
ElementMap element_map(ElementAccessor< 3 > elm) const
Mapping data that can be precomputed on the actual cell.
Transformed quadrature weights.