From f73298adaa84e384159dcac46fce55d444090cf7 Mon Sep 17 00:00:00 2001 From: Jean-Matthieu Etancelin <jean-matthieu.etancelin@imag.fr> Date: Wed, 15 May 2013 07:49:23 +0000 Subject: [PATCH] Remove multiples variables initializations --- HySoP/hysop/problem/problem.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/HySoP/hysop/problem/problem.py b/HySoP/hysop/problem/problem.py index 95711388e..ca3593b82 100644 --- a/HySoP/hysop/problem/problem.py +++ b/HySoP/hysop/problem/problem.py @@ -75,9 +75,13 @@ class Problem(object): self.timer = Timer(t_end, dt) if __VERBOSE__: print "==== Variables initialization ====" + var_list = [] for op in self.operators: for v in op.variables: - v.initialize() + var_list.append(v) + # List of unique elements (initialize once each variable) + for v in set(var_list): + v.initialize() if __VERBOSE__: print "====" for op in self.operators: -- GitLab