From a5d46fca92ae73d31e9fac43359c27f18edcb0e8 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Wed, 2 Nov 2011 17:45:03 +0100
Subject: [PATCH] Assemble a 2D function

---
 src/one-body-sample.cc | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc
index 4f7359d5..051d3888 100644
--- a/src/one-body-sample.cc
+++ b/src/one-body-sample.cc
@@ -171,6 +171,22 @@ int main() {
             neumannBoundaryAssembler, b,
             true); // resize the output vector and zero all of its entries
       }
+
+      { // constant 2D function
+        std::vector<SmallVector> b;
+        SmallVector SampleVector;
+        SampleVector[0] = 1;
+        SampleVector[1] = 2;
+        ConstantFunction<SmallVector, SmallVector> fNeumann(SampleVector);
+        NeumannBoundaryAssembler<GridType, SmallVector>
+        neumannBoundaryAssembler(fNeumann);
+
+        BoundaryFunctionalAssembler<P1Basis> boundaryFunctionalAssembler(
+            p1Basis, neumannBoundary);
+        boundaryFunctionalAssembler.assemble(
+            neumannBoundaryAssembler, b,
+            true); // resize the output vector and zero all of its entries
+      }
     }
 
     { // experiment with convex problems and the like
-- 
GitLab