From dc36cadb64b45b7dc41ed5fb78fb62b12ea9139c Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 10 Sep 2018 13:00:08 +0200
Subject: [PATCH] use absolute path for res_opt

---
 Team25/shape.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Team25/shape.py b/Team25/shape.py
index 0bb2d1e..0557239 100644
--- a/Team25/shape.py
+++ b/Team25/shape.py
@@ -139,7 +139,7 @@ while it <= maxIter and c.getString('shape/Action') != 'stop':
     # generate the velocity field of each design variable
     getVelocityField(x)
 
-    # compute objective function and constraints 
+    # compute objective function and constraints
     c.runSubClient('myGetDP', mygetdp + '-solve GetPerformances')
 
     # as well as their sensitivity with respect to design variables at `x'
@@ -151,11 +151,11 @@ while it <= maxIter and c.getString('shape/Action') != 'stop':
 
     # get the value of the objective function and of the constraints
     # as well as their sensitivity with respect to design variables at `x'
-    objective = np.sum(readSimpleTable('res_opt/w.txt'))
+    objective = np.sum(readSimpleTable(c.getPath('res_opt/w.txt')))
     constraints = np.array([np.sum(xFromMMA)/100.0-1.0])
-    grad_objective = np.asarray([np.sum(readSimpleTable('res_opt/Grad_w_wrt_dv_'+str(dv)+'.txt'))\
+    grad_objective = np.asarray([np.sum(readSimpleTable(c.getPath('res_opt/Grad_w_wrt_dv_'+str(dv)+'.txt')))\
         for dv in xrange(numVariables)])
-    grad_constraints = np.ones(numVariables)/100.0	     
+    grad_constraints = np.ones(numVariables)/100.0
 
     if it == 1: fscale = 1.0 / objective
     objective *= fscale
-- 
GitLab