Salome HOME
ad06ffe5a3229ebc76a3e3a6ed7c424c408dc997
[modules/filter.git] / src / FILTER / test_filter.py
1 # Copyright (C) 2005  OPEN CASCADE, CEA, EDF R&D, LEG
2 #           PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either 
6 # version 2.1 of the License.
7
8 # This library is distributed in the hope that it will be useful 
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 # Lesser General Public License for more details.
12
13 # You should have received a copy of the GNU Lesser General Public  
14 # License along with this library; if not, write to the Free Software 
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18
19 # Author: Bernard Secher 2008 january
20 #
21 import os
22 import salome
23 import SALOME_FILTER
24 import libSALOME_LifeCycleCORBA
25 lcc=libSALOME_LifeCycleCORBA.SALOME_LifeCycleCORBA()
26 filter=lcc.FindOrLoad_Component("FactoryServer","FILTER")
27 inputFile=os.getenv("FILTER_ROOT_DIR")+"/share/salome/resources/filter/xx.aa.med"
28 inputMesh="MeshFromEnsight"
29 inputField="FieldFromEnsight"
30 inputTS=0
31 nbth=1
32 fth=2.2
33 sth=0.0
34 flag=True
35 rf=SALOME_FILTER.F_FIELD
36 outputFile="filtered.med"
37 filter.loadMED(inputFile)
38 filter.readReferenceField(inputMesh,inputField,inputTS)
39 filter.generateCriteria(nbth,fth,sth,flag,rf)
40 filter.createEnsightInputFiles()
41 filter.filtering()
42 filter.projectFieldsOnDecimateMesh()
43 filter.createMedOutputFile(outputFile)
44 filter.unloadMED()