subtract_mean_value(VECTOR &v,
const std::vector<bool> &p_select)
{
- const unsigned int n = v.size();
- Assert(p_select.size() == 0 || p_select.size() == n,
- ExcDimensionMismatch(p_select.size(), n));
-
if(p_select.size() == 0)
{
// In case of an empty boolean mask operate on the whole vector:
}
else
{
+ // This function is not implemented for distributed vectors, so
+ // if v is not a boring Vector or BlockVector:
+ Assert( dynamic_cast<Vector<double> *>(& v)
+ || dynamic_cast<Vector<float> *>(& v)
+ || dynamic_cast<Vector<long double> *>(& v)
+ || dynamic_cast<BlockVector<double> *>(& v)
+ || dynamic_cast<BlockVector<float> *>(& v)
+ || dynamic_cast<BlockVector<long double> *>(& v),
+ ExcNotImplemented());
+
+ const unsigned int n = v.size();
+
+ Assert(p_select.size() == n,
+ ExcDimensionMismatch(p_select.size(), n));
+
typename VECTOR::value_type s = 0.;
unsigned int counter = 0;
for (unsigned int i=0; i<n; ++i)
}
-for (VEC : DEAL_II_VEC_TEMPLATES; real : REAL_SCALARS)
+for (VEC : SERIAL_VECTORS)
{
namespace VectorTools \{
template
- void subtract_mean_value(VEC<real> &, const std::vector<bool> &);
+ void subtract_mean_value(VEC &, const std::vector<bool> &);
\}
}