# Level 1 prerequisites:
SET_AND_CHECK(MED_ROOT_DIR_EXP "@PACKAGE_MED_ROOT_DIR@")
-# For all prerequisites, load the corresponding targets if the package was used
+# For all prerequisites, load the corresponding targets if the package was used
# in CONFIG mode. This ensures dependent projects link correctly
# without having to set LD_LIBRARY_PATH:
-SET(_PREREQ @_PREREQ_LIST@)
-SET(_PREREQ_CONFIG_DIR @_PREREQ_DIR_LIST@)
-SET(_PREREQ_COMPONENTS "@_PREREQ_COMPO_LIST@")
-LIST(LENGTH _PREREQ_CONFIG_DIR _list_len)
-IF(NOT _list_len EQUAL 0)
+SET(_PREREQ_@PROJECT_NAME@ @_PREREQ_LIST@)
+SET(_PREREQ_@PROJECT_NAME@_CONFIG_DIR @_PREREQ_DIR_LIST@)
+SET(_PREREQ_@PROJECT_NAME@_COMPONENTS "@_PREREQ_COMPO_LIST@")
+LIST(LENGTH _PREREQ_@PROJECT_NAME@_CONFIG_DIR _list_len_@PROJECT_NAME@)
+IF(NOT _list_len_@PROJECT_NAME@ EQUAL 0)
# Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
- MATH(EXPR _range "${_list_len}-1")
- FOREACH(_p RANGE ${_range})
- LIST(GET _PREREQ ${_p} _pkg )
- LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir)
- LIST(GET _PREREQ_COMPONENTS ${_p} _pkg_compo)
- MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...")
- IF(NOT _pkg_compo)
- FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE
- PATHS "${_pkg_dir}"
- NO_DEFAULT_PATH)
- ELSE()
- STRING(REPLACE "," ";" _compo_lst "${_pkg_compo}")
- MESSAGE(STATUS "===> (components: ${_pkg_compo})")
- FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE
- COMPONENTS ${_compo_lst}
- PATHS "${_pkg_dir}"
- NO_DEFAULT_PATH)
+ MATH(EXPR _range_@PROJECT_NAME@ "${_list_len_@PROJECT_NAME@}-1")
+ FOREACH(_p_@PROJECT_NAME@ RANGE ${_range_@PROJECT_NAME@})
+ LIST(GET _PREREQ_@PROJECT_NAME@ ${_p_@PROJECT_NAME@} _pkg_@PROJECT_NAME@ )
+ LIST(GET _PREREQ_@PROJECT_NAME@_CONFIG_DIR ${_p_@PROJECT_NAME@} _pkg_dir_@PROJECT_NAME@)
+ LIST(GET _PREREQ_@PROJECT_NAME@_COMPONENTS ${_p_@PROJECT_NAME@} _pkg_compo_@PROJECT_NAME@)
+ IF(NOT OMIT_DETECT_PACKAGE_${_pkg_@PROJECT_NAME@})
+ MESSAGE(STATUS "===> Reloading targets from ${_pkg_@PROJECT_NAME@} ...")
+ IF(NOT _pkg_compo_@PROJECT_NAME@)
+ FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
+ PATHS "${_pkg_dir_@PROJECT_NAME@}"
+ NO_DEFAULT_PATH)
+ ELSE()
+ STRING(REPLACE "," ";" _compo_lst_@PROJECT_NAME@ "${_pkg_compo_@PROJECT_NAME@}")
+ MESSAGE(STATUS "===> (components: ${_pkg_compo_@PROJECT_NAME@})")
+ FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
+ COMPONENTS ${_compo_lst_@PROJECT_NAME@}
+ PATHS "${_pkg_dir_@PROJECT_NAME@}"
+ NO_DEFAULT_PATH)
+ ENDIF()
ENDIF()
ENDFOREACH()
ENDIF()
SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@")
# Include MED targets if they were not already loaded:
-IF(NOT (TARGET medcoupling))
+IF(NOT (TARGET medcalculator))
INCLUDE("${MED_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE}/SalomeMEDTargets.cmake")
ENDIF()
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#CALCULATOR_TEST_WITHOUTIHM.py
-#
-from omniORB import CORBA
+import os
+
+import MED_ORB
+import CALCULATOR_ORB
import salome
-import SALOME
-import SALOME_MED
-import SALOMEDS
-from MEDCouplingCorba import *
from MEDCoupling import *
from MEDLoader import *
+from MEDCouplingCorba import *
+from MEDCouplingClient import *
-import os
-host = os.getenv( 'HOST' )
-orb, lcc, naming_service, contmgr = salome.salome_kernel.salome_kernel_init()
-
-################ GET A MED FIELD FROM FILE pointe.med ###################
-#
# This test program is based on the field named fieldcelldoublevector in
-# med file $MED_ROOT_DIR/share/salome/resources/pointe.med
-#filePath=os.environ["MED_ROOT_DIR"]
-filePath=os.environ["DATA_DIR"]
-#filePath=filePath+"/share/salome/resources/med/"
-filePath=filePath+"/MedFiles/"
-medFile=filePath+"pointe.med"
-fieldname = "fieldcelldoublevector"
-meshname = "maa1"
-
-# Launch the Med Component and use it to load into memory the test field
-print "Launch the Med Component: "
-med_comp = lcc.FindOrLoadComponent("FactoryServer", "MED")
-
-# Get a Corba field proxy on the distant field (located in the med_comp server).
-try:
- #TODO
- #Manager = obj._narrow(SALOMEDS.StudyManager)
- #print "studyManager found"
- #myStudy = myStudyManager.NewStudy('CALCULATOR_TEST')
- #studynameId = myStudy._get_StudyId()
- #studyname = myStudy._get_Name()
- #print "We are working in the study ",studyname," with the ID ",studynameId
- print "Read field ",fieldname
-
- f = MEDLoader.ReadFieldCell(medFile,meshname,0,fieldname,-1,-1)
- fieldcelldouble=MEDCouplingFieldDoubleServant._this(f)
-except SALOME.SALOME_Exception, ex:
- print ex.details
- print ex.details.type
- print ex.details.text
- print ex.details.sourceFile
- print ex.details.lineNumber
- raise
-
-print "Description of Field : "
+# med file ${DATA_DIR}/MedFiles/pointe.med
+medFile = os.path.join(os.environ["DATA_DIR"], "MedFiles", "pointe.med")
+meshName = "maa1"
+fieldName = "fieldcelldoublevector"
+
+# init SALOME session
+salome.salome_init()
+
+# Get MED component
+print "[CALC] Get reference to MED component ..."
+med = salome.lcc.FindOrLoadComponent("FactoryServer", "MED")
+print "[CALC] ---"
+
+# Get CALCULATOR component
+print "[CALC] Get reference to CALCULATOR component ..."
+calculator = salome.lcc.FindOrLoadComponent("FactoryServer", "CALCULATOR")
+print "[CALC] ---"
+
+# Get a CORBA field proxy on the distant field (located in the med server)
+print "[CALC] Read field %s ..." % fieldName
+f = MEDLoader.ReadFieldCell(medFile, meshName, 0, fieldName, -1, -1)
+fieldcelldouble = MEDCouplingFieldDoubleServant._this(f)
+
+print "[CALC] -> fieldcelldouble is:"
print f
print f.getName()
print f.getDescription()
print f.getNumberOfComponents()
+print "[CALC] ---"
-#
-#
-############## Load Calculator Component ###################
-# Calculator Component must be in the Container of MED
-#
-print "Load Calculator Component "
-# we need to import CALCULATOR_ORB to get a typed object (to perform narrowing)
-import CALCULATOR_ORB
-calculator = lcc.FindOrLoadComponent("FactoryServer", "CALCULATOR")
-
-#
-#
-############## Test Calculator Component ###################
-#
-#
-print "Appel cloneField : fieldcelldoublevector -> f1,f2,f3,f4"
-(f1,f2,f3,f4)=calculator.cloneField(fieldcelldouble) # fieldcelldouble is consumed
-#
-f1.Register()
+print "[CALC] Clone field: fieldcelldoublevector -> f1,f2,f3,f4 ..."
+(f1,f2,f3,f4) = calculator.cloneField(fieldcelldouble)
+print "[CALC] -> f1 is:"
calculator.printField(f1)
-print "Add fields f2+f3"
-f_add=calculator.add(f2, f3)
-f_add.Register()
-calculator.printField( f_add ) # f_add is consumed
+print "[CALC] ---"
-#
-print "Apply linear function"
-f_lin=calculator.applyLin(f4,2.0,1.0)
-f_lin.Register()
-calculator.printField( f_lin ) # f_lin is consumed
-#
-print "Appel Norme Max "
-f_lin.Register()
-norme=calculator.normMax(f_lin) # f_lin is consumed
-print " -> norme = ",norme
-#
+print "[CALC] Add fields f2+f3 ..."
+f_add = calculator.add(f2, f3)
+print "[CALC] -> f_add is:"
+calculator.printField(f_add)
+print "[CALC] ---"
+
+print "[CALC] Apply linear function to f4 ..."
+f_lin = calculator.applyLin(f4, 2.0, 1.0)
+print "[CALC] -> f_add is:"
+calculator.printField(f_lin)
+print "[CALC] ---"
+
+print "[CALC] Apply Norm Max to f_lin ..."
+norm = calculator.normMax(f_lin)
+print "[CALC] -> norm is ", norm
+print "[CALC] ---"
+
+print "[CALC] Clone fields created by Calculator via client classes ..."
+f_addLocal = MEDCouplingFieldDoubleClient.New(f_add)
+f_addLocal.setName(f_addLocal.getName() + "add")
+f_linLocal = MEDCouplingFieldDoubleClient.New(f_lin)
+f_linLocal.setName(f_linLocal.getName() + "lin")
+print "[CALC] -> f_addLocal is ", f_addLocal
+print "[CALC] -> f_linLocal is ", f_linLocal
+print "[CALC] ---"
+
+print "[CALC] Get information from the local copy of the distant mesh"
+meshLocal = f_addLocal.getMesh()
+print "[CALC] -> meshLocal is", meshLocal
+print "[CALC] ---"
+
+print "[CALC] Write mesh and fields to MED file ..."
+import tempfile
+outfile = tempfile.NamedTemporaryFile(prefix="Calculator_pointe_", suffix=".med")
+outfile.close()
+MEDLoader.WriteUMesh(outfile.name, meshLocal, True)
+MEDLoader.WriteFieldUsingAlreadyWrittenMesh(outfile.name, f_addLocal)
+MEDLoader.WriteFieldUsingAlreadyWrittenMesh(outfile.name, f_linLocal)
+os.remove(outfile.name)
+print "[CALC] ---"
-print "End of Calculator Test!"
+print "[CALC] End of Calculator Test!"
+++ /dev/null
-# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# 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, 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
-# 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
-#
-
-import string
-
-import salome
-
-import SALOME_MED
-
-#CCRTfrom libSALOME_Swig import *
-#CCRTsg = SALOMEGUI_Swig()
-
-#CCRT :
-import SALOMEDS
-
-import os
-host = os.getenv( 'HOST' )
-orb, lcc, naming_service, contmgr = salome.salome_kernel.salome_kernel_init()
-obj = naming_service.Resolve('myStudyManager')
-myStudyManager = obj._narrow(SALOMEDS.StudyManager)
-print "studyManager found"
-myStudy = myStudyManager.NewStudy('medClient_withoutIHM_test')
-studynameId = myStudy._get_StudyId()
-studyname = myStudy._get_Name()
-print "We are working in the study ",studyname," with the ID ",studynameId
-#endCCRT
-
-def print_ord(i):
- if i == 0:
- return 'first'
- elif i == 1:
- return 'second'
- elif i == 2:
- return 'third'
- else:
- return `(i+1)`+'th'
-
-def changeBlankToUnderScore(stringWithBlank):
- blank = ' '
- underscore = '_'
- decompString = string.split(stringWithBlank,blank)
- length = len(decompString)
- stringWithUnderScore = decompString[0]
- for i in range(1,length):
- stringWithUnderScore += underscore
- stringWithUnderScore += decompString[i]
- return stringWithUnderScore
-
-def getMedObjectFromStudy(file):
- objNameInStudy = "MED_OBJECT_FROM_FILE_"+file
- compNameInStudy= "MED"
- #CCRTlistOfSO = salome.myStudy.FindObjectByName(objNameInStudy,compNameInStudy)
- listOfSO = myStudy.FindObjectByName(objNameInStudy,compNameInStudy)
- listLength = len(listOfSO)
- if (listLength == 0) :
- print "getMedObjectFromStudy",objNameInStudy," cannot be found in the Study under the component ",compNameInStudy
- return None
- elif (listLength > 1) :
- print "there are more than one instance of ",objNameInStudy," in the Study under the component ",compNameInStudy
- return None
- mySO = listOfSO[0]
- if (mySO == None) :
- print "getMedObjectFromStudy",objNameInStudy," cannot be found in the Study"
- return mySO
- else:
- anAttr = mySO.FindAttribute("AttributeIOR")[1]
- #CCRTobj = salome.orb.string_to_object(anAttr.Value())
- obj = orb.string_to_object(anAttr.Value())
- myObj = obj._narrow(SALOME_MED.MED)
- if (myObj == None) :
- print objNameInStudy," has been found in the Study but with the wrong type"
- return myObj
-
-def getMeshObjectFromStudy(meshName):
- objNameInStudy = "/Med/MEDMESH/"+meshName
- #CCRTmySO = salome.myStudy.FindObjectByPath(objNameInStudy)
- mySO = myStudy.FindObjectByPath(objNameInStudy)
- if (mySO == None) :
- print "getMeshObjectFromStudy",objNameInStudy," cannot be found in the Study"
- return mySO
- else:
- anAttr = mySO.FindAttribute("AttributeIOR")[1]
- #CCRTobj = salome.orb.string_to_object(anAttr.Value())
- obj = orb.string_to_object(anAttr.Value())
- myObj = obj._narrow(SALOME_MED.MESH)
- if (myObj == None) :
- print objNameInStudy," has been found in the Study but with the wrong type"
- return myObj
-
-def getSupportObjectFromStudy(meshName,supportName):
- meshNameStudy = changeBlankToUnderScore(meshName)
- objNameInStudy = "/Med/MEDMESH/MEDSUPPORTS_OF_"+meshNameStudy+"/"+supportName
- #CCRTmySO = salome.myStudy.FindObjectByPath(objNameInStudy)
- mySO = myStudy.FindObjectByPath(objNameInStudy)
- if (mySO == None) :
- print "getSupportObjectFromStudy",objNameInStudy," cannot be found in the Study"
- print "/Med/MEDMESH/MEDSUPPORTS_OF_"+meshNameStudy,":",myStudy.GetObjectNames("/Med/MEDMESH/MEDSUPPORTS_OF_"+meshNameStudy)
- return mySO
- else:
- anAttr = mySO.FindAttribute("AttributeIOR")[1]
- #CCRTobj = salome.orb.string_to_object(anAttr.Value())
- obj = orb.string_to_object(anAttr.Value())
- myObj = obj._narrow(SALOME_MED.SUPPORT)
- if (myObj == None) :
- print objNameInStudy," has been found in the Study but with the wrong type"
- return myObj
-
-def getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName):
- type = -1
- meshNameStudy = changeBlankToUnderScore(meshName)
- objNameInStudy = "/Med/MEDFIELD/"+fieldName+"/("+str(dt)+","+str(it)+")_ON_"+supportName+"_OF_"+meshNameStudy
- #CCRTmySO = salome.myStudy.FindObjectByPath(objNameInStudy)
- mySO = myStudy.FindObjectByPath(objNameInStudy)
- if (mySO == None) :
- print "getFieldObjectFromStudy",objNameInStudy," cannot be found in the Study"
- print "/Med/MEDFIELD/"+fieldName,":",myStudy.GetObjectNames("/Med/MEDFIELD/"+fieldName)
- return -1,-1
- else:
- anAttr = mySO.FindAttribute("AttributeIOR")[1]
- #CCRTobj = salome.orb.string_to_object(anAttr.Value())
- obj = orb.string_to_object(anAttr.Value())
- myObj = obj._narrow(SALOME_MED.FIELDINT)
- type = 0
- if (myObj == None):
- myObj = obj._narrow(SALOME_MED.FIELDDOUBLE)
- type = 1
- if (myObj == None) :
- print objNameInStudy," has been found in the Study but with the wrong type"
- return myObj,type
-
-
-fileName = "pointe.med"
-
-from MEDCoupling import *
-from MEDLoader import *
-from MEDCouplingCorba import *
-from MEDCouplingClient import *
-import MEDCouplingCorbaServant_idl
-
-#CCRTmedComp=salome.lcc.FindOrLoadComponent("FactoryServer", "MED")
-medComp=lcc.FindOrLoadComponent("FactoryServer", "MED")
-
-import os
-
-filePath=os.environ["MED_ROOT_DIR"]
-filePath=filePath+"/share/salome/resources/med/"
-
-filePathName = filePath + fileName
-
-print "Reading the .med file ",filePathName," and pushing corba objects in the SALOME study"
-#CCRTmedComp.readStructFileWithFieldType(filePathName,salome.myStudyName)
-##medComp.readStructFileWithFieldType(filePathName,studyname)
-#CCRTsg.updateObjBrowser(1)
-
-##print "getting the MED object from the study"
-##medObj = getMedObjectFromStudy(fileName)
-
-meshNames = MEDLoader.GetMeshNames(filePathName)
-nbOfMeshes = len(meshNames)#medObj.getNumberOfMeshes()
-
-print "in this med file there is(are) ",nbOfMeshes," mesh(es):"
-
-meshName = meshNames[0]
-
-#meshObj = medObj.getMeshByName(meshName)
-meshObj3D = MEDLoader.ReadUMeshFromFile(filePathName,meshName,0)
-
-fieldName = "fieldcelldoublevector"
-fieldTypedObj = MEDLoader.ReadFieldCell(filePathName,meshName,0,fieldName,-1,-1)
-fieldTypedObjCORBA=MEDCouplingFieldDoubleServant._this(fieldTypedObj)
-
-############## Load Calculator Component ###################
-# Calculator Component must be in the Container of MED
-#
-print "Load Calculator Component "
-# we need to import CALCULATOR_ORB to get a typed object (to perform narrowing)
-import CALCULATOR_ORB
-#CCRTcalculator = salome.lcc.FindOrLoadComponent("FactoryServer", "CALCULATOR")
-calculator = lcc.FindOrLoadComponent("FactoryServer", "CALCULATOR")
-#
-
-#calculator.printField(fieldTypedObj)
-
-#
-#
-############## Test Calculator Component ###################
-#
-#
-print "Appel cloneField : fieldTypedObj -> f1,f2,f3,f4"
-#fieldTypedObj.Register()
-(f1,f2,f3,f4)=calculator.cloneField(fieldTypedObjCORBA) # fieldTypedObj is consumed
-#
-##f1.Register()
-##calculator.printField(f1)
-print "Add fields f2+f3"
-f_add=calculator.add(f2, f3)
-##f_add.Register()
-##calculator.printField( f_add ) # f_add is consumed
-
-#
-print "Apply linear function"
-f_lin=calculator.applyLin(f4,2.0,1.0)
-##f_lin.Register()
-##calculator.printField( f_lin ) # f_lin is consumed
-#
-print "Appel Norme Max "
-#f_lin.Register()
-norme=calculator.normMax(f_lin) # f_lin is consumed
-print " -> norme = ",norme
-#
-
-#
-#
-############ Creation of a MED file with fields created by Caculator #################
-# via Client classes
-#
-f_addLocal=MEDCouplingFieldDoubleClient.New(f_add)
-f_add.UnRegister()
-f_addLocal.setName(fieldName+"add")
-f_linLocal=MEDCouplingFieldDoubleClient.New(f_lin)
-f_lin.UnRegister()
-f_linLocal.setName(fieldName+"lin")
-
-meshLocal = f_addLocal.getMesh()
-
-print " getting information from the local copy of the distant mesh"
-name = meshLocal.getName()
-spaceDimension = meshLocal.getSpaceDimension()
-meshDimension = meshLocal.getMeshDimension()
-numberOfNodes = meshLocal.getNumberOfNodes()
-print " Name = ", name, " space Dim = ", spaceDimension, " mesh Dim = ", meshDimension, " Nb of Nodes = ", numberOfNodes
-
-
-#Warning : OutputMedFiles are removed here after =================================
-#Outmed21File="OutCalculatorpointe21_V3.2.0b1.med"
-#os.system( 'rm -fr ' + Outmed21File )
-Outmed22File="OutCalculatorpointe22_V3.2.0b1.med"
-os.system( 'rm -fr ' + Outmed22File )
-
-MEDLoader.WriteUMesh(Outmed22File,meshLocal,True)
-MEDLoader.WriteFieldUsingAlreadyWrittenMesh(Outmed22File,f_addLocal)
-MEDLoader.WriteFieldUsingAlreadyWrittenMesh(Outmed22File,f_linLocal)
-
-print ""
-print "END of the Pyhton script ..... Ctrl D to exit"
+++ /dev/null
-# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# 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, 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
-# 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
-#
-
-#CALCULATOR_TEST_WITHOUTIHM.py
-#
-from omniORB import CORBA
-
-import salome
-import SALOME
-import SALOME_MED
-import SALOMEDS
-
-from MEDCouplingCorba import *
-from MEDCoupling import *
-from MEDLoader import *
-
-
-import os
-host = os.getenv( 'HOST' )
-orb, lcc, naming_service, contmgr = salome.salome_kernel.salome_kernel_init()
-
-################ GET A MED FIELD FROM FILE pointe.med ###################
-#
-# This test program is based on the field named fieldcelldoublevector in
-# med file $MED_ROOT_DIR/share/salome/resources/med/pointe.med
-#filePath=os.environ["MED_ROOT_DIR"]
-filePath=os.environ["DATA_DIR"]
-filePath=filePath+"/MedFiles/"
-#filePath=filePath+"/share/salome/resources/med/"
-medFile=filePath+"pointe.med"
-fieldname = "fieldcelldoublevector"
-meshname = "maa1"
-
-# Launch the Med Component and use it to load into memory the test field
-print "Launch the Med Component: "
-med_comp = lcc.FindOrLoadComponent("FactoryServer", "MED")
-
-# Get a Corba field proxy on the distant field (located in the med_comp server).
-try:
- #TODO
- #obj = naming_service.Resolve('myStudyManager')
- #myStudyManager = obj._narrow(SALOMEDS.StudyManager)
- #print "studyManager found"
- #myStudy = myStudyManager.NewStudy('CALCULATOR_TEST_WITHOUTIHM')
- #studynameId = myStudy._get_StudyId()
- #studyname = myStudy._get_Name()
- #print "We are working in the study ",studyname," with the ID ",studynameId
- print "Read field ",fieldname
- f = MEDLoader.ReadFieldCell(medFile,meshname,0,fieldname,-1,-1)
- fieldcelldouble=MEDCouplingFieldDoubleServant._this(f)
-except SALOME.SALOME_Exception, ex:
- print ex.details
- print ex.details.type
- print ex.details.text
- print ex.details.sourceFile
- print ex.details.lineNumber
- raise
-
-print "Description of Field : "
-print f
-print f.getName()
-print f.getDescription()
-print f.getNumberOfComponents()
-
-#
-#
-############## Load Calculator Component ###################
-# Calculator Component must be in the Container of MED
-#
-print "Load Calculator Component "
-# we need to import CALCULATOR_ORB to get a typed object (to perform narrowing)
-import CALCULATOR_ORB
-calculator = lcc.FindOrLoadComponent("FactoryServer", "CALCULATOR")
-
-#
-#
-############## Test Calculator Component ###################
-#
-#
-print "Appel cloneField : fieldcelldoublevector -> f1,f2,f3,f4"
-(f1,f2,f3,f4)=calculator.cloneField(fieldcelldouble) # fieldcelldouble is consumed
-#
-##f1.Register()
-##calculator.printField(f1)
-print "Add fields f2+f3"
-f_add=calculator.add(f2, f3)
-##f_add.Register()
-##calculator.printField( f_add ) # f_add is consumed
-
-#
-print "Apply linear function"
-f_lin=calculator.applyLin(f4,2.0,1.0)
-##f_lin.Register()
-##calculator.printField( f_lin ) # f_lin is consumed
-#
-print "Appel Norme Max "
-f_lin.Register()
-norme=calculator.normMax(f_lin) # f_lin is consumed
-print " -> norme = ",norme
-#
-
-#
-#
-############ Creation of a MED file with fields created by Caculator #################
-# via Client classes
-#
-#from libMEDClient import *
-from MEDCouplingClient import *
-import MEDCouplingCorbaServant_idl
-
-f_addLocal=MEDCouplingFieldDoubleClient.New(f_add)
-f_addLocal.setName(f_addLocal.getName()+"add")
-f_add.UnRegister()
-
-f_linLocal=MEDCouplingFieldDoubleClient.New(f_lin)
-f_linLocal.setName(f_linLocal.getName()+"lin")
-f_lin.UnRegister()
-
-
-
-OutmedFile22="Calculatorpointe_V22.med"
-#os.system( 'rm -fr ' + OutmedFile22 )
-MEDLoader.WriteField(OutmedFile22,f_addLocal,True)
-MEDLoader.WriteFieldUsingAlreadyWrittenMesh(OutmedFile22,f_linLocal)
-
-
-print "End of Calculator Test!"
# scripts / static
SET(_bin_SCRIPTS
CALCULATOR_TEST.py
- CALCULATOR_TEST_WITHOUTIHM.py
- CALCULATOR_TEST_STUDY_WITHOUTIHM.py
graphe1.py
)
SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON})
-INSTALL(FILES ${CALCULATOR_RESOURCES} DESTINATION ${SALOME_CALCULATOR_INSTALL_RES_DATA})
\ No newline at end of file
+INSTALL(FILES ${CALCULATOR_RESOURCES} DESTINATION ${SALOME_CALCULATOR_INSTALL_RES_DATA})