From 7b04fd88d00d4a1889783b1a2cfc564f50dc2233 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Sat, 22 Mar 2014 13:25:35 +0000
Subject: [PATCH] Use Functions::interpolate to set the Dirichlet values

[[Imported from SVN: r9660]]
---
 cosserat-continuum.cc | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/cosserat-continuum.cc b/cosserat-continuum.cc
index 4f0a0e9c..29907cbd 100644
--- a/cosserat-continuum.cc
+++ b/cosserat-continuum.cc
@@ -330,18 +330,12 @@ int main (int argc, char *argv[]) try
         ////////////////////////////////////////////////////////
 
         DirichletValues dirichletValues(homotopyParameter);
+        std::vector<FieldVector<double,3> > dV;
+        Functions::interpolate(feBasis, dV, dirichletValues, dirichletDofs);
 
-        for (vIt=gridView.begin<dim>(); vIt!=vEndIt; ++vIt) {
-
-            int idx = indexSet.index(*vIt);
-            if (dirichletDofs[idx][0]) {
-
-                // Only the positions have Dirichlet values
-                dirichletValues.evaluate(vIt->geometry().corner(0), x[idx].r);
-
-            }
-
-        }
+        for (size_t i=0; i<x.size(); i++)
+          if (dirichletDofs[i][0])
+            x[i].r = dV[i];
 
         // /////////////////////////////////////////////////////
         //   Solve!
-- 
GitLab