]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add implementation of a continuous function.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 26 Mar 1998 10:01:02 +0000 (10:01 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 26 Mar 1998 10:01:02 +0000 (10:01 +0000)
git-svn-id: https://svn.dealii.org/trunk@96 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/function.cc [new file with mode: 0644]

diff --git a/deal.II/base/source/function.cc b/deal.II/base/source/function.cc
new file mode 100644 (file)
index 0000000..7de474d
--- /dev/null
@@ -0,0 +1,55 @@
+/*      $Id$                 */
+
+
+#include <basic/function.h>
+#include <vector.h>
+
+
+template <int dim>
+double Function<dim>::operator () (const Point<dim> &) const {
+  Assert (false, ExcPureFunctionCalled());
+  return 0;
+};
+
+
+
+template <int dim>
+void Function<dim>::value_list (const vector<Point<dim> > &points,
+                               vector<double>            &values) const {
+  Assert (values.size() == 0,
+         ExcVectorNotEmpty());
+
+  values.reserve (points.size());
+  for (unsigned int i=0; i<points.size(); ++i)
+    values.push_back (this->operator() (points[i]));
+};
+
+
+
+
+template <int dim>
+Point<dim> Function<dim>::gradient (const Point<dim> &) const {
+  Assert (false, ExcPureFunctionCalled());
+  return Point<dim>();
+};
+
+
+
+template <int dim>
+void Function<dim>::gradient_list (const vector<Point<dim> > &points,
+                                  vector<Point<dim> >       &gradients) const {
+  Assert (gradients.size() == 0,
+         ExcVectorNotEmpty());
+
+  gradients.reserve (points.size());
+  for (unsigned int i=0; i<points.size(); ++i)
+    gradients.push_back (gradient(points[i]));
+};
+
+
+
+
+
+// explicit instantiations
+template class Function<1>;
+template class Function<2>;

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


Typeset in Trocchi and Trocchi Bold Sans Serif.