and therefore leads to problems when linking with libdeal_II_2d and
libdeal_II_3d at the same time.
git-svn-id: https://svn.dealii.org/trunk@2117
0785d39b-7218-0410-832d-
ea1e28bc413d
--- /dev/null
+/* $Id$ */
+/* Copyright W. Bangerth, University of Heidelberg, 1998 */
+
+#include <lac/vector.h>
+#include <numerics/vectors.h>
+
+
+void
+VectorTools::subtract_mean_value(Vector<double> &v,
+ const vector<bool> &p_select)
+{
+ unsigned int n = v.size();
+ Assert(n == p_select.size(), ExcDimensionMismatch(n, p_select.size()));
+
+ double s = 0;
+ unsigned int counter = 0;
+
+ for (unsigned int i=0; i<n; ++i)
+ if (p_select[i])
+ {
+ s += v(i);
+ ++counter;
+ };
+
+ s /= counter;
+
+ for (unsigned int i=0; i<n; ++i)
+ if (p_select[i])
+ v(i) -= s;
+};
+
+
+
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams