-New: The Quadrature class has a new boolean is_tensor_product_flag
-to indicate if the represented quadrature formula is in fact a
-tensor product of 1D formulas. The corresponding 1D objects
-can be queried using Quadrature::get_tensor_basis().
+New: Quadrature::is_tensor_product() returns if the corresponding quadrature
+formula can be represented as a tensor product and the quadrature points are
+sorted lexicographically. The corresponding 1D objects can be queried using
+Quadrature::get_tensor_basis().
<br>
(Daniel Arndt, 2017/07/26)
/**
* This function returns true if the quadrature object is a tensor product
- * of one-dimensional formulas.
+ * of one-dimensional formulas and the quadrature points are sorted
+ * lexicographically.
*/
bool is_tensor_product() const;
* Indicates if this object represents quadrature formula that is a tensor
* product of one-dimensional formulas.
* This flag is set if dim==1 or the constructors taking a Quadrature<1>
- * (and possibly a Quadrature<dim-1> object) is called.
+ * (and possibly a Quadrature<dim-1> object) is called. This implies
+ * that the quadrature points are sorted lexicographically.
*/
bool is_tensor_product_flag;
ExcMessage("This function only makes sense if "
"this object represents a tensor product!"));
- return std::array<Quadrature<1>, 1> {*this};
+ return std::array<Quadrature<1>, 1> {{*this}};
}
}
Assert (k==this->size(), ExcInternalError());
this->is_tensor_product_flag = true;
- const std::array<Quadrature<1>, 2> q_array = {qx, qy};
+ const std::array<Quadrature<1>, 2> q_array {{qx, qy}};
this->tensor_basis = std_cxx14::make_unique<std::array<Quadrature<1>, 2>>(q_array);
}
}
Assert (k==this->size(), ExcInternalError());
this->is_tensor_product_flag = true;
- const std::array<Quadrature<1>, 3> q_array = {qx, qy, qz};
+ const std::array<Quadrature<1>, 3> q_array {{qx, qy, qz}};
this->tensor_basis = std_cxx14::make_unique<std::array<Quadrature<1>, 3>>(q_array);
}
std::placeholders::_1,
std::placeholders::_2));
+ // At this point, the variable is_tensor_product_flag is set
+ // to the respective value of the given Quadrature in the base
+ // class copy constructor.
+ // We only call a quadrature formula 'tensor product'
+ // if the quadrature points are also sorted lexicographically.
+ // In particular, any reordering destroys that property
+ // and we might need to modify the variable accordingly.
for (unsigned int i=0; i<quad.size(); ++i)
{
this->weights[i] = quad.weight(permutation[i]);