32 template <
unsigned int dim>
36 std::shared_ptr<BulkIntegral> bulk_integral = std::make_shared<BulkIntegral>(shared_from_this(), dim);
44 std::shared_ptr<BulkIntegral> EvalPoints::add_bulk<0>(
const Quadrature &quad)
47 std::shared_ptr<BulkIntegral> bulk_integral = std::make_shared<BulkIntegral>(shared_from_this(), 0);
53 template <
unsigned int dim>
57 unsigned int old_data_size=this->
size(dim), new_data_size;
61 std::shared_ptr<EdgeIntegral> edge_integral = std::make_shared<EdgeIntegral>(shared_from_this(), dim, n_side_permutations, points_per_side);
62 unsigned int*** perm_indices = edge_integral->perm_indices_;
65 for (
unsigned int i=0; i<dim+1; ++i) {
70 new_data_size = this->
size(dim);
71 unsigned int i_data=old_data_size;
72 for (
unsigned int i_side=0; i_side<dim+1; ++i_side) {
73 for (
unsigned int i_point=0; i_point<points_per_side; ++i_point) {
74 perm_indices[i_side][0][i_point] = i_data;
80 for (
unsigned int i_perm=1; i_perm<n_side_permutations; ++i_perm) {
81 for (
unsigned int i_side=0; i_side<dim+1; ++i_side) {
84 for (
unsigned int i_point=0; i_point<quad_points.size(); ++i_point) {
85 perm_indices[i_side][i_perm][i_point] =
dim_eval_points_[dim].find_permute_point<dim>( quad_points.vec<dim>(i_point), old_data_size, new_data_size );
94 template <
unsigned int dim>
98 std::shared_ptr<BulkIntegral> bulk_integral = this->
add_bulk<dim-1>(quad);
99 std::shared_ptr<EdgeIntegral> edge_integral = this->add_edge<dim>(quad);
100 return std::make_shared<CouplingIntegral>(edge_integral, bulk_integral);
103 template <
unsigned int dim>
106 std::shared_ptr<BulkIntegral> bulk_integral = this->
add_bulk<dim-1>(quad);
107 std::shared_ptr<EdgeIntegral> edge_integral = this->add_edge<dim>(quad);
108 return std::make_shared<BoundaryIntegral>(edge_integral, bulk_integral);
112 : local_points_(dim), n_subsets_(0), dim_(dim)
118 template <
unsigned int dim>
120 ASSERT_GT(dim, 0).error(
"Dimension 0 not supported!\n");
123 for (
unsigned int i=0; i<quad_points.
size(); ++i) {
128 template <
unsigned int dim>
130 ASSERT_GT(dim, 0).error(
"Dimension 0 not supported!\n");
131 for (
unsigned int loc_idx=data_begin; loc_idx<data_end; ++loc_idx) {
133 if ( arma::norm(coords-
local_points_.
vec<dim>(loc_idx), 2) < 4*std::numeric_limits<double>::epsilon() )
return loc_idx;
148 template std::shared_ptr<BulkIntegral> EvalPoints::add_bulk<0>(
const Quadrature &);
149 template std::shared_ptr<BulkIntegral> EvalPoints::add_bulk<1>(
const Quadrature &);
150 template std::shared_ptr<BulkIntegral> EvalPoints::add_bulk<2>(
const Quadrature &);
151 template std::shared_ptr<BulkIntegral> EvalPoints::add_bulk<3>(
const Quadrature &);
152 template std::shared_ptr<EdgeIntegral> EvalPoints::add_edge<1>(
const Quadrature &);
153 template std::shared_ptr<EdgeIntegral> EvalPoints::add_edge<2>(
const Quadrature &);
154 template std::shared_ptr<EdgeIntegral> EvalPoints::add_edge<3>(
const Quadrature &);
155 template std::shared_ptr<CouplingIntegral> EvalPoints::add_coupling<2>(
const Quadrature &);
156 template std::shared_ptr<CouplingIntegral> EvalPoints::add_coupling<3>(
const Quadrature &);
157 template std::shared_ptr<BoundaryIntegral> EvalPoints::add_boundary<1>(
const Quadrature &);
158 template std::shared_ptr<BoundaryIntegral> EvalPoints::add_boundary<2>(
const Quadrature &);
159 template std::shared_ptr<BoundaryIntegral> EvalPoints::add_boundary<3>(
const Quadrature &);
163 template unsigned int EvalPoints::DimEvalPoints::find_permute_point<1>(
arma::vec,
unsigned int,
unsigned int);
164 template unsigned int EvalPoints::DimEvalPoints::find_permute_point<2>(
arma::vec,
unsigned int,
unsigned int);
165 template unsigned int EvalPoints::DimEvalPoints::find_permute_point<3>(
arma::vec,
unsigned int,
unsigned int);
static constexpr unsigned int max_subsets
Maximal number of hold subsets.
std::shared_ptr< BulkIntegral > add_bulk(const Quadrature &)
Armor::Array< double > local_points_
Local coords of points vector.
unsigned int size() const
unsigned int n_subsets_
Number of subset.
const Armor::Array< double > & get_points() const
Return a reference to the whole array of quadrature points.
Quadrature make_from_side(unsigned int sid, unsigned int pid) const
#define ASSERT_GT(a, b)
Definition of comparative assert macro (Greater Than)
static const unsigned int max_subset_points
Maximal average number of points hold in subset.
DimEvalPoints(unsigned int dim)
Constructor.
Subobject holds evaluation points data of one dimension (0,1,2,3)
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
ArmaVec< Type, nr > vec(uint mat_index) const
static const unsigned int undefined_dim
Undefined dimension of new (empty) object.
Base class for quadrature rules on simplices in arbitrary dimensions.
unsigned int max_size_
Maximal number of used EvalPoints.
std::shared_ptr< EdgeIntegral > add_edge(const Quadrature &)
The same as add_bulk but for edge points on sides.
std::array< DimEvalPoints, 4 > dim_eval_points_
Sub objects of dimensions 0,1,2,3.
std::shared_ptr< CouplingIntegral > add_coupling(const Quadrature &)
The same as add_bulk but for points between side points of element of dim and bulk points of element ...
unsigned int find_permute_point(arma::vec coords, unsigned int data_begin, unsigned int data_end)
Find position of local point (coords) in subvector of local points given by limits <data_begin...
Basic definitions of numerical quadrature rules.
ArrayMatSet set(uint index)
unsigned int size() const
Return size of evaluation points object (number of points).
unsigned int size(unsigned int dim) const
Return size of evaluation points object (number of points).
void add_local_points(const Armor::Array< double > &quad_points)
Adds set of local point to local_points_ (bulk or side of given permutation).
Class RefElement defines numbering of vertices, sides, calculation of normal vectors etc...
std::shared_ptr< BoundaryIntegral > add_boundary(const Quadrature &)
The same as add_bulk but for edge points on boundary sides.
std::array< int, EvalPoints::max_subsets+1 > subset_starts_
Indices of subsets data in local_points_ vector, used size is n_subsets_ + 1.
unsigned int size() const
Returns number of quadrature points.
void add_subset()
Adds new subset and its end size to subset_starts_ array.
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.