Salome HOME
add test on filter module
authorsecher <secher>
Tue, 22 Jan 2008 14:04:31 +0000 (14:04 +0000)
committersecher <secher>
Tue, 22 Jan 2008 14:04:31 +0000 (14:04 +0000)
src/FILTER/test_filter.py [new file with mode: 0644]

diff --git a/src/FILTER/test_filter.py b/src/FILTER/test_filter.py
new file mode 100644 (file)
index 0000000..ad06ffe
--- /dev/null
@@ -0,0 +1,44 @@
+# Copyright (C) 2005  OPEN CASCADE, CEA, EDF R&D, LEG
+#           PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
+# 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.
+# 
+# This library is distributed in the hope that it will be useful 
+# but WITHOUT ANY WARRANTY; without even the implied warranty of 
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+# Lesser General Public License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public  
+# License along with this library; if not, write to the Free Software 
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# 
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# 
+# Author: Bernard Secher 2008 january
+#
+import os
+import salome
+import SALOME_FILTER
+import libSALOME_LifeCycleCORBA
+lcc=libSALOME_LifeCycleCORBA.SALOME_LifeCycleCORBA()
+filter=lcc.FindOrLoad_Component("FactoryServer","FILTER")
+inputFile=os.getenv("FILTER_ROOT_DIR")+"/share/salome/resources/filter/xx.aa.med"
+inputMesh="MeshFromEnsight"
+inputField="FieldFromEnsight"
+inputTS=0
+nbth=1
+fth=2.2
+sth=0.0
+flag=True
+rf=SALOME_FILTER.F_FIELD
+outputFile="filtered.med"
+filter.loadMED(inputFile)
+filter.readReferenceField(inputMesh,inputField,inputTS)
+filter.generateCriteria(nbth,fth,sth,flag,rf)
+filter.createEnsightInputFiles()
+filter.filtering()
+filter.projectFieldsOnDecimateMesh()
+filter.createMedOutputFile(outputFile)
+filter.unloadMED()