From cde73f94e087965361d24475ded210c93f601395 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Wed, 5 Jan 2011 11:28:55 +0000
Subject: [PATCH] Use new ConfigParser capability to read a sequence of values
 into a FieldVector

[[Imported from SVN: r6677]]
---
 dirneucoupling.cc     | 19 +++++------------
 dirneucoupling.parset | 48 ++++++++++++-------------------------------
 2 files changed, 18 insertions(+), 49 deletions(-)

diff --git a/dirneucoupling.cc b/dirneucoupling.cc
index 573a0ab4..c6f9d7e4 100644
--- a/dirneucoupling.cc
+++ b/dirneucoupling.cc
@@ -330,12 +330,8 @@ int main (int argc, char *argv[]) try
     double rodNu  = parameterSet.get<double>("rodNu");
 
     Dune::array<FieldVector<double,3>,2> rodRestEndPoint;
-    rodRestEndPoint[0][0] = parameterSet.get<double>("rodRestEndPoint0X");
-    rodRestEndPoint[0][1] = parameterSet.get<double>("rodRestEndPoint0Y");
-    rodRestEndPoint[0][2] = parameterSet.get<double>("rodRestEndPoint0Z");
-    rodRestEndPoint[1][0] = parameterSet.get<double>("rodRestEndPoint1X");
-    rodRestEndPoint[1][1] = parameterSet.get<double>("rodRestEndPoint1Y");
-    rodRestEndPoint[1][2] = parameterSet.get<double>("rodRestEndPoint1Z");
+    rodRestEndPoint[0] = parameterSet.get<FieldVector<double,3> >("rodRestEndPoint0");
+    rodRestEndPoint[1] = parameterSet.get<FieldVector<double,3> >("rodRestEndPoint1");
     
     //////////////////////////////////////////////////////////////////
     //  Print the algorithm type so we have it in the log files
@@ -380,14 +376,9 @@ int main (int argc, char *argv[]) try
     // /////////////////////////////////////////
     //   Read Dirichlet values
     // /////////////////////////////////////////
-    rodX.back().r[0] = parameterSet.get("dirichletValueX", rodRestEndPoint[1][0]);
-    rodX.back().r[1] = parameterSet.get("dirichletValueY", rodRestEndPoint[1][1]);
-    rodX.back().r[2] = parameterSet.get("dirichletValueZ", rodRestEndPoint[1][2]);
-
-    FieldVector<double,3> axis;
-    axis[0] = parameterSet.get("dirichletAxisX", double(0));
-    axis[1] = parameterSet.get("dirichletAxisY", double(0));
-    axis[2] = parameterSet.get("dirichletAxisZ", double(0));
+    rodX.back().r = parameterSet.get("dirichletValue", rodRestEndPoint[1]);
+
+    FieldVector<double,3> axis = parameterSet.get("dirichletAxis", FieldVector<double,3>(0));
     double angle = parameterSet.get("dirichletAngle", double(0));
 
     rodX.back().q = Rotation<3,double>(axis, M_PI*angle/180);
diff --git a/dirneucoupling.parset b/dirneucoupling.parset
index 96b68b20..64a524d1 100644
--- a/dirneucoupling.parset
+++ b/dirneucoupling.parset
@@ -84,21 +84,13 @@ damping = 0.6
 #E     = 1e6
 #nu    = 0.3
 
-#rodRestEndPoint0X = 0.125
-#rodRestEndPoint0Y = 0.125
-#rodRestEndPoint0Z = 1
-#rodRestEndPoint1X = 0.125
-#rodRestEndPoint1Y = 0.125
-#rodRestEndPoint1Z = 2
+#rodRestEndPoint0 = 0.125 0.125 1
+#rodRestEndPoint1 = 0.125 0.125 2
 
 ## Dirichlet values
-#dirichletValueX = 0.125
-#dirichletValueY = 0.125
-#dirichletValueZ = 2.5
+#dirichletValue = 0.125 0.125 2.5
 
-#dirichletAxisX = 0
-#dirichletAxisY = 0
-#dirichletAxisZ = 1
+#dirichletAxis = 0 0 1
 #dirichletAngle = 0
 
 
@@ -123,13 +115,9 @@ damping = 0.6
 #rodNu = 0.3
 
 ## Dirichlet values
-#dirichletValueX = 0.5
-#dirichletValueY = 1.5
-#dirichletValueZ = 10
+#dirichletValue = 0.5 1.5 10
 
-#dirichletAxisX = 0
-#dirichletAxisY = 0
-#dirichletAxisZ = 1
+#dirichletAxis = 0 0 1
 #dirichletAngle = 90
 
 ########################################################
@@ -156,22 +144,12 @@ rodNu = 0.3
 E     = 1e6
 nu    = 0.3
 
-rodRestEndPoint0X = 0.625
-rodRestEndPoint0Y = 0.625
-rodRestEndPoint0Z = 1
-rodRestEndPoint1X = 0.625
-rodRestEndPoint1Y = 0.625
-rodRestEndPoint1Z = 2
-#rodRestEndPoint1X = 0.625
-#rodRestEndPoint1Y = -0.082
-#rodRestEndPoint1Z = 1.707
+rodRestEndPoint0 = 0.625 0.625 1
+rodRestEndPoint1 = 0.625 0.625 2
+#rodRestEndPoint1 = 0.625 -0.082 1.707
 
 # Dirichlet values
-dirichletValueX = 0.625
-dirichletValueY = 0.625
-dirichletValueZ = 2.5
-
-dirichletAxisX = 0
-dirichletAxisY = 0
-dirichletAxisZ = 1
-dirichletAngle = 0
\ No newline at end of file
+dirichletValue = 0.625 0.625 2.5
+
+dirichletAxis = 0 0 1
+dirichletAngle = 0
-- 
GitLab