19 #ifndef INTEGRAL_ACC_HH_
20 #define INTEGRAL_ACC_HH_
68 unsigned int dim()
const {
81 template<
unsigned int dim>
95 template<
class OpType>
101 template<
class OpType>
107 template<
class ValueType,
template<
unsigned int,
class,
unsigned int>
class OpType,
class Domain>
115 std::shared_ptr< FiniteElement<dim> >
fe_;
139 unsigned int dim()
const {
189 friend class ::BulkIntegral;
190 friend class ::CouplingIntegral;
191 friend class ::BoundaryIntegral;
192 template <
unsigned int qdim>
193 friend class ::BulkIntegralAcc;
194 template <
unsigned int qdim>
195 friend class ::CouplingIntegralAcc;
196 template <
unsigned int qdim>
197 friend class ::BoundaryIntegralAcc;
238 friend class ::EdgeIntegral;
239 friend class ::CouplingIntegral;
240 friend class ::BoundaryIntegral;
241 template <
unsigned int qdim>
242 friend class ::EdgeIntegralAcc;
243 template <
unsigned int qdim>
244 friend class ::CouplingIntegralAcc;
245 template <
unsigned int qdim>
246 friend class ::BoundaryIntegralAcc;
305 template<
unsigned int qdim>
364 return factory_.template make_qarray<Scalar, Op::ScalarShape, Op::BulkDomain>(component_idx);
375 return factory_.template make_qarray<Vector, Op::DispatchVectorShape, Op::BulkDomain>(component_idx);
389 return factory_.template make_qarray<Vector, Op::GradScalarShape, Op::BulkDomain>(component_idx);
400 return factory_.template make_qarray<Tensor, Op::DispatchGradVectorShape, Op::BulkDomain>(component_idx);
411 return factory_.template make_qarray<Tensor, Op::VectorSymGrad, Op::BulkDomain>(component_idx);
422 return factory_.template make_qarray<Scalar, Op::VectorDivergence, Op::BulkDomain>(component_idx);
456 ASSERT(
false).error(
"Should not happen!\n");
484 auto bgn_it = make_iter<EdgePoint>(
EdgePoint(
486 auto end_it = make_iter<EdgePoint>(
EdgePoint(
502 template<
unsigned int qdim>
504 template<
unsigned int qdim>
513 template<
unsigned int qdim>
539 auto bgn_it = make_iter<EdgePoint>(
EdgePoint(
541 auto end_it = make_iter<EdgePoint>(
EdgePoint(
577 return factory_.template make_qarray<Scalar, Op::ScalarShape, Op::SideDomain>(component_idx);
583 return factory_.template make_qarray<Vector, Op::DispatchVectorShape, Op::SideDomain>(component_idx);
589 return factory_.template make_qarray<Vector, Op::GradScalarShape, Op::SideDomain>(component_idx);
600 return factory_.template make_qarray<Tensor, Op::DispatchGradVectorShape, Op::SideDomain>(component_idx);
611 return factory_.template make_qarray<Tensor, Op::VectorSymGrad, Op::SideDomain>(component_idx);
622 return factory_.template make_qarray<Scalar, Op::VectorDivergence, Op::SideDomain>(component_idx);
633 template <
unsigned int quaddim>
635 template <
unsigned int quaddim>
664 ASSERT(
false)(
dim).error(
"Should not happen!\n");
706 template<
unsigned int qdim>
715 factory_(pfev, element_cache_map, pfev->fe_dim<qdim>(), quad),
716 factory_high_(pfev, element_cache_map, pfev->fe_dim<qdim+1>(), quad)
758 template<
class ValueType,
template<
unsigned int,
class,
unsigned int>
class OpType>
770 ASSERT_EQ(fe_component_high->fe_type(), fe_component_low->fe_type()).error(
"Type of FiniteElement of low and high element must be same!\n");
771 return FeQJoin<ValueType>(low_dim_op, high_dim_op, low_dim_zero_op, high_dim_zero_op);
792 return factory_high_.template make_qarray<Vector, Op::DispatchVectorShape, Op::SideDomain>(component_idx);
797 return this->
template make_qjoin<Scalar, Op::ScalarShape>(component_idx);
802 return this->
template make_qjoin<Vector, Op::DispatchVectorShape>(component_idx);
807 return this->
template make_qjoin<Tensor, Op::DispatchGradVectorShape>(component_idx);
831 factory_(pfev, element_cache_map, pfev->fe_dim<3>(), quad)
834 this->eval_points_ = eval_points;
901 return internal_edge_->subset_index_;
906 return internal_bulk_->subset_index_;
913 return internal_bulk_->begin_idx_;
920 uint side_begin = internal_edge_->side_begin(cell_side);
922 BulkPoint(elm_cache_map, element_patch_idx, 0), internal_bulk_, side_begin) );
924 BulkPoint(elm_cache_map, element_patch_idx, internal_edge_->n_points_per_side_), internal_bulk_, side_begin) );;
938 template<
unsigned int qdim>
945 :
BoundaryIntegral(eval_points, quad, qdim), factory_(pfev, element_cache_map, pfev->fe_dim<qdim>(), quad)
959 uint element_patch_idx = factory_.element_cache_map_->position_in_cache(cell_side.
element().
idx());
960 uint side_begin = internal_edge_->side_begin(cell_side);
962 BulkPoint(factory_.element_cache_map_, element_patch_idx, 0), internal_bulk_, side_begin) );
964 BulkPoint(factory_.element_cache_map_, element_patch_idx, internal_edge_->n_points_per_side_), internal_bulk_, side_begin) );;
999 return factory_.template make_qarray<Scalar, Op::ScalarShape, Op::SideDomain>(component_idx);
1005 return factory_.template make_qarray<Vector, Op::DispatchVectorShape, Op::SideDomain>(component_idx);
1011 return factory_.template make_qarray<Vector, Op::GradScalarShape, Op::SideDomain>(component_idx);
1022 return factory_.template make_qarray<Tensor, Op::DispatchGradVectorShape, Op::SideDomain>(component_idx);
1033 return factory_.template make_qarray<Tensor, Op::VectorSymGrad, Op::SideDomain>(component_idx);
1044 return factory_.template make_qarray<Scalar, Op::VectorDivergence, Op::SideDomain>(component_idx);
#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.
FeQArray< Vector > grad_scalar_shape(uint component_idx=0)
Same as BulkValues::grad_scalar_shape but register at side quadrature points.
internal::IntegralFactory< qdim > factory_
Defines interface of operation accessors declaration.
Range< BoundaryPoint > points(const DHCellSide &cell_side) const
Returns range of bulk local points for appropriate cell accessor.
BoundaryIntegralAcc()
Default constructor.
FeQArray< Tensor > grad_vector_shape(uint component_idx=0)
Return the value of the function_no-th gradient vector shape function at the p bulk quadrature point.
~BoundaryIntegralAcc()
Destructor.
FeQ< Vector > coords()
Create side accessor of coords entity.
FeQArray< Tensor > vector_sym_grad(uint component_idx=0)
Return the value of the function_no-th vector symmetric gradient at the p side quadrature point.
FeQArray< Vector > vector_shape(uint component_idx=0)
Same as BulkValues::vector_shape but register at side quadrature points.
FeQArray< Scalar > scalar_shape(uint component_idx=0)
Same as BulkValues::scalar_shape but register at side quadrature points.
FeQ< Scalar > JxW()
Same as BulkValues::JxW but register at side quadrature points.
FeQArray< Scalar > vector_divergence(uint component_idx=0)
Return the value of the function_no-th vector divergence at the p side quadrature point.
friend class BoundaryPoint
ElQ< Scalar > determinant()
Create bulk accessor of jac determinant entity.
ElQ< Vector > normal_vector()
Register the normal vector to a side at side quadrature points.
BoundaryIntegralAcc(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map)
Range< BoundaryPoint > points(const DHCellSide &cell_side, const ElementCacheMap *elm_cache_map) const
Returns range of bulk local points for appropriate cell accessor - obsolete method.
int get_subset_low_idx() const
Return index of data block according to subset of lower dim (boundary) in EvalPoints object.
BoundaryIntegral()
Default constructor.
std::shared_ptr< internal_integrals::Bulk > internal_bulk_
Integral according to kower dim (boundary) element subset part in EvalPoints object.
friend class BoundaryPoint
int get_subset_high_idx() const
Return index of data block according to subset of higher dim in EvalPoints object.
std::shared_ptr< internal_integrals::Edge > internal_edge_
Integral according to higher dim (bulk) element subset part in EvalPoints object.
Point accessor allow iterate over quadrature points of given side defined in local element coordinate...
BulkIntegralAcc(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map)
Constructor of bulk integral.
FeQArray< Scalar > scalar_shape(uint component_idx=0)
Return the value of the function_no-th shape function at the p bulk quadrature point.
FeQArray< Vector > grad_scalar_shape(uint component_idx=0)
Return the value of the function_no-th gradient shape function at the p bulk quadrature point.
FeQ< Scalar > JxW()
Register the product of Jacobian determinant and the quadrature weight at bulk quadrature points.
ElQ< Scalar > determinant()
Create bulk accessor of jac determinant entity.
FeQArray< Tensor > grad_vector_shape(uint component_idx=0)
Return the value of the function_no-th gradient vector shape function at the p bulk quadrature point.
FeQArray< Tensor > vector_sym_grad(uint component_idx=0)
Return the value of the function_no-th vector symmetric gradient at the p bulk quadrature point.
FeQ< Vector > coords()
Create bulk accessor of coords entity.
Range< BulkPoint > points(unsigned int element_patch_idx) const
Returns range of bulk local points for appropriate cell accessor.
FeQArray< Vector > vector_shape(uint component_idx=0)
Return the value of the function_no-th vector shape function at the p bulk quadrature point.
BulkIntegralAcc()
Default constructor.
internal::IntegralFactory< qdim > factory_
Defines interface of operation accessors declaration.
~BulkIntegralAcc()
Destructor.
FeQArray< Scalar > vector_divergence(uint component_idx=0)
Return the value of the function_no-th vector divergence at the p bulk quadrature point.
int get_subset_idx() const
Return index of data block according to subset in EvalPoints object.
~BulkIntegral()
Destructor.
Range< BulkPoint > points(unsigned int element_patch_idx, const ElementCacheMap *elm_cache_map) const
Returns range of bulk local points for appropriate cell accessor - obsolete method.
BulkIntegral()
Default constructor.
BulkIntegral(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, unsigned int dim)
Constructor of bulk integral.
std::shared_ptr< internal_integrals::Bulk > internal_bulk_
Internal integral object.
Base point accessor class.
Template specialization of previous class.
CouplingIntegralAcc()
Default constructor.
ElQ< Vector > normal_vector()
FeQJoin< Scalar > scalar_join_shape(FMT_UNUSED uint component_idx=0)
CouplingIntegralAcc(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map)
Constructor of ngh integral.
FeQArray< Vector > vector_shape(FMT_UNUSED uint component_idx=0)
FeQJoin< Vector > vector_join_shape(FMT_UNUSED uint component_idx=0)
~CouplingIntegralAcc()
Destructor.
FeQ< Scalar > JxW()
Define empty operations.
FeQJoin< Tensor > gradient_vector_join_shape(FMT_UNUSED uint component_idx=0)
Range< CouplingPoint > points(FMT_UNUSED const DHCellSide &cell_side) const
Returns empty point range.
internal::IntegralFactory< 3 > factory_
Defines interface of operation accessors declaration.
FeQJoin< Scalar > scalar_join_shape(uint component_idx=0)
FeQJoin< Tensor > gradient_vector_join_shape(uint component_idx=0)
CouplingIntegralAcc(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map)
Constructor of ngh integral.
~CouplingIntegralAcc()
Destructor.
int get_subset_low_idx() const
Return index of data block according to subset of lower dim in EvalPoints object.
FeQJoin< ValueType > make_qjoin(uint component_idx=0)
Factory method. Same as previous but creates FE operation.
FeQ< Scalar > JxW()
Same as BulkValues::JxW but register at side quadrature points.
ElQ< Vector > normal_vector()
Register the normal vector to a side at side quadrature points.
internal::IntegralFactory< qdim+1 > factory_high_
Same as prefious but for element of higher dim.
Range< CouplingPoint > points(const DHCellSide &cell_side) const
Returns range of side local points for appropriate cell side accessor.
FeQJoin< Vector > vector_join_shape(uint component_idx=0)
CouplingIntegralAcc()
Default constructor.
internal::IntegralFactory< qdim > factory_
Defines interface of operation accessors declaration.
int get_subset_high_idx() const
Return index of data block according to subset of higher dim in EvalPoints object.
friend class CouplingPoint
FeQArray< Vector > vector_shape(uint component_idx=0)
Range< CouplingPoint > points(const DHCellSide &cell_side, const ElementCacheMap *elm_cache_map) const
Returns range of side local points for appropriate cell side accessor - obsolete method.
int get_subset_high_idx() const
Return index of data block according to subset of higher dim in EvalPoints object.
int get_subset_low_idx() const
Return index of data block according to subset of lower dim in EvalPoints object.
CouplingIntegral()
Default constructor.
std::shared_ptr< internal_integrals::Edge > internal_edge_
Integral according to side subset part (element of higher dim) in EvalPoints object.
std::shared_ptr< internal_integrals::Bulk > internal_bulk_
Integral according to bulk subset part (element of lower dim) in EvalPoints object.
~CouplingIntegral()
Destructor.
CouplingIntegral(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, unsigned int dim)
Constructor of ngh integral.
friend class CouplingPoint
Point accessor allow iterate over quadrature points of given side defined in local element coordinate...
Side accessor allows to iterate over sides of DOF handler cell.
unsigned int dim() const
Return dimension of element appropriate to the side.
ElementAccessor< 3 > element() const
unsigned int side_idx() const
FeQArray< Scalar > scalar_shape(uint component_idx=0)
Same as BulkValues::scalar_shape but register at side quadrature points.
internal::IntegralFactory< qdim > factory_
Defines interface of operation accessors declaration.
EdgeIntegralAcc(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map)
Constructor of edge integral.
ElQ< Vector > normal_vector()
Register the normal vector to a side at side quadrature points.
FeQArray< Vector > grad_scalar_shape(uint component_idx=0)
Same as BulkValues::grad_scalar_shape but register at side quadrature points.
~EdgeIntegralAcc()
Destructor.
Range< EdgePoint > points(const DHCellSide &cell_side) const
Returns range of side local points for appropriate cell side accessor.
ElQ< Scalar > determinant()
Create bulk accessor of jac determinant entity.
FeQArray< Scalar > vector_divergence(uint component_idx=0)
Return the value of the function_no-th vector divergence at the p side quadrature point.
EdgeIntegralAcc()
Default constructor.
FeQ< Scalar > JxW()
Same as BulkValues::JxW but register at side quadrature points.
FeQArray< Vector > vector_shape(uint component_idx=0)
Same as BulkValues::vector_shape but register at side quadrature points.
FeQArray< Tensor > grad_vector_shape(uint component_idx=0)
Return the value of the function_no-th gradient vector shape function at the p bulk quadrature point.
FeQ< Vector > coords()
Create side accessor of coords entity.
FeQArray< Tensor > vector_sym_grad(uint component_idx=0)
Return the value of the function_no-th vector symmetric gradient at the p side quadrature point.
int get_subset_idx() const
Return index of data block according to subset in EvalPoints object.
EdgeIntegral()
Default constructor.
std::shared_ptr< internal_integrals::Edge > internal_edge_
Internal integral object.
EdgeIntegral(std::shared_ptr< EvalPoints > eval_points, Quadrature *quad, unsigned int dim)
Constructor of edge integral.
unsigned int n_sides() const
Getter of n_sides.
~EdgeIntegral()
Destructor.
Range< EdgePoint > points(const DHCellSide &cell_side, const ElementCacheMap *elm_cache_map) const
Returns range of side local points for appropriate cell side accessor - obsolete method.
uint side_begin(const DHCellSide &cell_side) const
Point accessor allow iterate over quadrature points of given side defined in local element coordinate...
unsigned int idx() const
We need this method after replacing Region by RegionIdx, and movinf RegionDB instance into particular...
Directing class of FieldValueCache.
unsigned int position_in_cache(unsigned mesh_elm_idx, bool bdr=false) const
Return position of element stored in ElementCacheMap.
Class holds local coordinations of evaluating points (bulk and sides) specified by element dimension.
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
Evaluates Jacobian determinants on Bulk (Element) / Side.
Evaluates normal vector on side quadrature points.
Evaluates coordinates of quadrature points - not implemented yet.
PatchOp< spacedim > * get_for_elem_quad()
Returns operation of given dim and OpType, creates it if doesn't exist.
PatchOp< spacedim > * get(const Quadrature *quad)
Returns operation of given dim and OpType, creates it if doesn't exist.
void set_used_domain(fem_domain domain)
Mark domain (bulk or side) as used in assembly class.
std::shared_ptr< FiniteElement< dim > > fe_comp(std::shared_ptr< FiniteElement< dim > > fe, uint component_idx)
Returnd FiniteElement of component_idx for FESystem or fe for other types.
Base class for quadrature rules on simplices in arbitrary dimensions.
unsigned int size() const
Returns number of quadrature points.
BaseIntegral(std::shared_ptr< EvalPoints > eval_points, unsigned int dim)
Constructor of bulk or side subset.
std::shared_ptr< EvalPoints > eval_points() const
Getter of eval_points.
unsigned int dim_
Dimension of the cell on which points are placed.
BaseIntegral()
Default constructor.
std::shared_ptr< EvalPoints > eval_points_
Pointer to EvalPoints.
unsigned int dim() const
Returns dimension.
virtual ~BaseIntegral()
Destructor.
FeQArray< ValueType > make_qarray(uint component_idx=0)
Factory method. Same as previous but creates FE operation.
ElementCacheMap * element_cache_map_
PatchOp< 3 > * make_patch_op()
Factory method. Creates operation of given OpType.
IntegralFactory(PatchFEValues< 3 > *pfev, ElementCacheMap *element_cache_map, std::shared_ptr< FiniteElement< dim > > fe, Quadrature *quad)
PatchOp< 3 > * make_elem_patch_op()
Factory method. Creates element / side operation of given OpType.
std::shared_ptr< FiniteElement< dim > > fe_
PatchFEValues< 3 > * patch_fe_values_
Quadrature * quad_
Pointer to Quadrature that represents quadrature points of integral.
unsigned int dim_
Dimension of the cell on which points are placed.
unsigned int dim() const
Returns dimension.
Base()
Default constructor.
virtual ~Base()
Destructor.
bool operator==(const Base &other) const
Comparison operator.
Quadrature * quad() const
Returns quadrature.
Base(Quadrature *quad, unsigned int dim)
Constructor of bulk or side subset.
unsigned int subset_index_
Index of data block according to subset in EvalPoints object.
Bulk(Quadrature *quad, unsigned int dim, std::shared_ptr< EvalPoints > eval_points, unsigned int subset_idx)
Constructor of bulk integral- obsolete constructor.
uint begin_idx_
Begin index of quadrature points in EvalPoinnts.
uint end_idx_
Begin index of quadrature points in EvalPoinnts.
Bulk()
Default constructor.
uint begin_idx() const
Getter of bulk_begin.
uint n_points_per_side_
Number of points. TODO: pass this to the constructor, avoid extraction from the eval_points.
Edge()
Default constructor.
uint side_begin(const DHCellSide &cell_side) const
unsigned int n_sides_
Number of sides (value 0 indicates bulk set)
Edge(Quadrature *quad, unsigned int dim, std::shared_ptr< EvalPoints > eval_points, unsigned int subset_idx)
Constructor of edge integral.
unsigned int subset_index_
Store finite element reinit functions.
Class FEValues calculates finite element data on the actual cells such as shape function values,...
Implementation of range helper class.