34 , is_tensor_product_flag(false)
43 , is_tensor_product_flag(dim == 1)
51 const std::vector<double> &
w)
62 const std::vector<double> & weights)
65 , is_tensor_product_flag(dim == 1)
76 , weights(points.size(),
std::numeric_limits<double>::infinity())
77 , is_tensor_product_flag(dim == 1)
88 , weights(
std::vector<double>(1, 1.))
89 , is_tensor_product_flag(true)
92 for (
unsigned int i = 0; i < dim; ++i)
94 const std::vector<Point<1>> quad_vec_1d(1,
Point<1>(
point[i]));
105 , weights(
std::vector<double>(1, 1.))
106 , is_tensor_product_flag(true)
113 : is_tensor_product_flag(false)
132 , weights(q1.size() * q2.size())
133 , is_tensor_product_flag(q1.is_tensor_product())
135 unsigned int present_index = 0;
136 for (
unsigned int i2 = 0; i2 < q2.
size(); ++i2)
137 for (
unsigned int i1 = 0; i1 < q1.
size(); ++i1)
141 for (
unsigned int d = 0;
d < dim - 1; ++
d)
154 for (
unsigned int i = 0; i < size(); ++i)
162 if (is_tensor_product_flag)
164 tensor_basis = std::make_unique<std::array<Quadrature<1>, dim>>();
165 for (
unsigned int i = 0; i < dim - 1; ++i)
167 (*tensor_basis)[dim - 1] = q2;
177 , is_tensor_product_flag(true)
179 unsigned int present_index = 0;
180 for (
unsigned int i2 = 0; i2 < q2.
size(); ++i2)
195 for (
unsigned int i = 0; i <
size(); ++i)
212 , is_tensor_product_flag(false)
233 , is_tensor_product_flag(true)
237 const unsigned int n0 = q.
size();
238 const unsigned int n1 = (dim > 1) ? n0 : 1;
239 const unsigned int n2 = (dim > 2) ? n0 : 1;
242 for (
unsigned int i2 = 0; i2 < n2; ++i2)
243 for (
unsigned int i1 = 0; i1 < n1; ++i1)
244 for (
unsigned int i0 = 0; i0 < n0; ++i0)
251 weights[k] = q.
weight(i0);
253 weights[k] *= q.
weight(i1);
255 weights[k] *= q.
weight(i2);
259 tensor_basis = std::make_unique<std::array<Quadrature<1>, dim>>();
260 for (
unsigned int i = 0; i < dim; ++i)
261 (*tensor_basis)[i] = q;
271 , is_tensor_product_flag(q.is_tensor_product_flag)
275 std::make_unique<std::array<Quadrature<1>, dim>>(*q.
tensor_basis);
287 if (dim > 1 && is_tensor_product_flag)
289 if (tensor_basis ==
nullptr)
291 std::make_unique<std::array<Quadrature<1>, dim>>(*q.
tensor_basis);
320typename std::conditional<dim == 1,
321 std::array<Quadrature<1>, dim>,
322 const std::array<Quadrature<1>, dim> &>::type
325 Assert(this->is_tensor_product_flag ==
true,
326 ExcMessage(
"This function only makes sense if "
327 "this object represents a tensor product!"));
330 return *tensor_basis;
336std::array<Quadrature<1>, 1>
340 ExcMessage(
"This function only makes sense if "
341 "this object represents a tensor product!"));
343 return std::array<Quadrature<1>, 1>{{*
this}};
356 for (
unsigned int k1 = 0; k1 < qx.
size(); ++k1)
382 for (
unsigned int k2 = 0; k2 < qy.
size(); ++k2)
383 for (
unsigned int k1 = 0; k1 < qx.
size(); ++k1)
391 const std::array<Quadrature<1>, 2> q_array{{qx, qy}};
392 this->
tensor_basis = std::make_unique<std::array<Quadrature<1>, 2>>(q_array);
401 :
Quadrature<dim>(qx.size() * qy.size() * qz.size())
412 :
Quadrature<3>(qx.size() * qy.size() * qz.size())
415 for (
unsigned int k3 = 0; k3 < qz.
size(); ++k3)
416 for (
unsigned int k2 = 0; k2 < qy.
size(); ++k2)
417 for (
unsigned int k1 = 0; k1 < qx.
size(); ++k1)
426 const std::array<Quadrature<1>, 3> q_array{{qx, qy, qz}};
427 this->
tensor_basis = std::make_unique<std::array<Quadrature<1>, 3>>(q_array);
436 namespace QIteratedImplementation
444 std::any_of(base_quadrature.
get_points().cbegin(),
446 [](
const Point<1> &p) { return p == Point<1>{0.}; });
447 const bool at_right =
448 std::any_of(base_quadrature.
get_points().cbegin(),
450 [](
const Point<1> &p) { return p == Point<1>{1.}; });
451 return (at_left && at_right);
470 const unsigned int n_copies)
472 internal::QIteratedImplementation::uses_both_endpoints(base_quadrature) ?
473 (base_quadrature.size() - 1) * n_copies + 1 :
474 base_quadrature.size() * n_copies)
479 if (!internal::QIteratedImplementation::uses_both_endpoints(base_quadrature))
483 unsigned int next_point = 0;
485 for (
unsigned int q_point = 0; q_point < base_quadrature.
size();
490 (1.0 *
copy) / n_copies);
492 base_quadrature.
weight(q_point) / n_copies;
500 unsigned int next_point = 0;
504 double double_point_weight = 0;
505 unsigned int n_end_points = 0;
506 for (
unsigned int i = 0; i < base_quadrature.
size(); ++i)
511 double_point_weight += base_quadrature.
weight(i);
515 double_point_weight /= n_copies;
523 for (
unsigned int q_point = 0; q_point < base_quadrature.
size();
533 (1.0 *
copy) / n_copies);
537 if ((
copy != n_copies - 1) &&
539 this->
weights[next_point] = double_point_weight;
542 base_quadrature.
weight(q_point) / n_copies;
549 double sum_of_weights = 0;
550 for (
unsigned int i = 0; i < this->
size(); ++i)
551 sum_of_weights += this->
weight(i);
562 const unsigned int N)
QAnisotropic(const Quadrature< 1 > &qx)
QIterated(const Quadrature< 1 > &base_quadrature, const unsigned int n_copies)
std::vector< Point< dim > > quadrature_points
std::unique_ptr< std::array< Quadrature< 1 >, dim > > tensor_basis
Quadrature & operator=(const Quadrature< dim > &)
std::size_t memory_consumption() const
const Point< dim > & point(const unsigned int i) const
bool is_tensor_product_flag
Quadrature(const unsigned int n_quadrature_points=0)
const std::array< Quadrature< 1 >, dim > & get_tensor_basis() const
double weight(const unsigned int i) const
bool operator==(const Quadrature< dim > &p) const
void initialize(const std::vector< Point< dim > > &points, const std::vector< double > &weights)
std::vector< double > weights
const std::vector< Point< dim > > & get_points() const
unsigned int size() const
SymmetricTensor< rank, dim, Number > sum(const SymmetricTensor< rank, dim, Number > &local, const MPI_Comm &mpi_communicator)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcZero()
static ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcInvalidQuadratureFormula()
#define Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcNotInitialized()
static ::ExceptionBase & ExcMessage(std::string arg1)
Expression fabs(const Expression &x)
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
void quadrature_points(const Triangulation< dim, spacedim > &triangulation, const Quadrature< dim > &quadrature, const std::vector< std::vector< BoundingBox< spacedim > > > &global_bounding_boxes, ParticleHandler< dim, spacedim > &particle_handler, const Mapping< dim, spacedim > &mapping=(ReferenceCells::get_hypercube< dim >() .template get_default_linear_mapping< dim, spacedim >()), const std::vector< std::vector< double > > &properties={})
Tensor< 2, dim, Number > w(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
T sum(const T &t, const MPI_Comm &mpi_communicator)
void copy(const T *begin, const T *end, U *dest)