X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FSwig%2FMEDLoaderCouplingTrainingSession.py;h=730772680b27ae39f79e1275d27503e62de6978c;hb=0b187729ac99d3e9e9bb9d2be8cb8600a783be6c;hp=399e200dd5766204081c2c95c5947f93a3317c3a;hpb=de8da643a7f441fb2154818cde04b7b24ca76bb4;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/Swig/MEDLoaderCouplingTrainingSession.py b/src/MEDLoader/Swig/MEDLoaderCouplingTrainingSession.py index 399e200dd..730772680 100644 --- a/src/MEDLoader/Swig/MEDLoaderCouplingTrainingSession.py +++ b/src/MEDLoader/Swig/MEDLoaderCouplingTrainingSession.py @@ -1,10 +1,10 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2013 CEA/DEN, EDF R&D +# Copyright (C) 2007-2015 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either -# version 2.1 of the License. +# version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -17,11 +17,11 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# Author Anthony GEAY (CEA/DEN/DM2S/STMF/LGLS) +# Author : Anthony GEAY (CEA/DEN/DM2S/STMF/LGLS) from MEDLoader import * from MEDCouplingRemapper import * -import math +import math, os d=DataArrayDouble.New(6,2) d[:,0]=3. @@ -480,8 +480,13 @@ print "IntegralGlobConstraint %lf == %lf"%(srcField.getArray().accumulate()[0],t from numpy import * from math import acos -med_root_dir=os.getenv("MED_ROOT_DIR") -agitateur_file=os.path.join(os.getenv("MED_ROOT_DIR"),"share","salome","resources","med","agitateur.med") +med_root_dir=os.getenv("MEDCOUPLING_ROOT_DIR") +if med_root_dir: + agitateur_file = os.path.join(os.getenv("MEDCOUPLING_ROOT_DIR"),"share","resources","med","agitateur.med") + if not os.path.exists(agitateur_file): + current_dir = os.path.dirname(os.path.realpath(__file__)) + agitateur_file=os.path.join(current_dir, "..", "..", "..", "resources","agitateur.med") + pass data=MEDFileData(agitateur_file) ts=data.getFields()[0].getTimeSteps() print ts