pointe_import22.med \
TimeStamps_import22.med \
poly3D.med \
+Darcy3_3D_H_10x10x10_2.med \
+elle_3D_HPr_10x10x10_2.med \
+elle_3D_HPr_2x2x2_2.med \
+elle_3D_HPr_4x4x4_2.med \
Darcy3_3D_H_10x10x10.sauve \
dx200_dy1_avec_2couches.sauve \
elle_2D_QT_10x10.sauve \
-THIS IS SALOME - MED VERSION: 3.0.2
+THIS IS SALOME - MED VERSION: 3.0.3
#include "MEDMEM_Field.hxx"
using namespace MEDMEM;
+using namespace MED_EN ;
int main (int argc, char ** argv) {
#include "MEDMEM_Field.hxx"
using namespace MEDMEM;
+using namespace MED_EN ;
int main (int argc, char ** argv) {
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_Med.hxx"
+using namespace MEDMEM ;
+using namespace MED_EN ;
+
main () {
const char * fileName = "pointe.med";
#include "MEDMEM_Field.hxx"
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_Med.hxx"
+#include "MEDMEM_MedMedDriver.hxx"
+#include "MEDMEM_MedMeshDriver.hxx"
+
+using namespace MEDMEM ;
+using namespace MED_EN ;
main () {
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_Med.hxx"
+using namespace MEDMEM ;
+using namespace MED_EN ;
+
main () {
const char * fileName = "pointe.med";
#include "MEDMEM_Meshing.hxx"
#include "MEDMEM_Group.hxx"
+using namespace MEDMEM ;
+using namespace MED_EN ;
+
using namespace std;
int main (int argc, char ** argv) {
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_CellModel.hxx"
+using namespace MEDMEM ;
+using namespace MED_EN ;
+
int main (int argc, char ** argv) {
const string MedFile = "pointe.med" ;
#include "MEDMEM_Mesh.hxx"
+using namespace MEDMEM ;
+using namespace MED_EN ;
+
int main (int argc, char ** argv) {
const string MedFile = "pointe.med" ;
// MED interface
- interface MED {
+ interface MED : SALOME::GenericObj {
/*!
returns the number of meshes in the %MED object.
*/
listOfSO = salome.myStudy.FindObjectByName(objNameInStudy,compNameInStudy)
listLength = len(listOfSO)
if (listLength == 0) :
- print "PROBLEME ",objNameInStudy," cannot be found in the Study under the component ",compNameInStudy
+ print objNameInStudy," cannot be found in the Study under the component ",compNameInStudy
return None
elif (listLength > 1) :
- print "PROBLEME there are more than one instance of ",objNameInStudy," in the Study under the component ",compNameInStudy
+ 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 "PROBLEM ",objNameInStudy," cannot be found in the Study"
+ print objNameInStudy," cannot be found in the Study"
return mySO
else:
anAttr = mySO.FindAttribute("AttributeIOR")[1]
obj = salome.orb.string_to_object(anAttr.Value())
myObj = obj._narrow(SALOME_MED.MED)
if (myObj == None) :
- print "PROBLEM ",objNameInStudy," has been found in the Study but with the wrong type"
+ print objNameInStudy," has been found in the Study but with the wrong type"
return myObj
def getMeshObjectFromStudy(meshName):
objNameInStudy = "/Med/MEDMESH/"+meshName
mySO = salome.myStudy.FindObjectByPath(objNameInStudy)
if (mySO == None) :
- print "PROBLEM ",objNameInStudy," cannot be found in the Study"
+ print objNameInStudy," cannot be found in the Study"
return mySO
else:
anAttr = mySO.FindAttribute("AttributeIOR")[1]
obj = salome.orb.string_to_object(anAttr.Value())
myObj = obj._narrow(SALOME_MED.MESH)
if (myObj == None) :
- print "PROBLEM ",objNameInStudy," has been found in the Study but with the wrong type"
+ print objNameInStudy," has been found in the Study but with the wrong type"
return myObj
def getSupportObjectFromStudy(meshName,supportName):
objNameInStudy = "/Med/MEDMESH/MEDSUPPORTS_OF_"+meshNameStudy+"/"+supportName
mySO = salome.myStudy.FindObjectByPath(objNameInStudy)
if (mySO == None) :
- print "PROBLEM ",objNameInStudy," cannot be found in the Study"
+ print objNameInStudy," cannot be found in the Study"
return mySO
else:
anAttr = mySO.FindAttribute("AttributeIOR")[1]
obj = salome.orb.string_to_object(anAttr.Value())
myObj = obj._narrow(SALOME_MED.SUPPORT)
if (myObj == None) :
- print "PROBLEM ",objNameInStudy," has been found in the Study but with the wrong type"
+ print objNameInStudy," has been found in the Study but with the wrong type"
return myObj
def getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName):
objNameInStudy = "/Med/MEDFIELD/"+fieldName+"/("+str(dt)+","+str(it)+")_ON_"+supportName+"_OF_"+meshNameStudy
mySO = salome.myStudy.FindObjectByPath(objNameInStudy)
if (mySO == None) :
- print "PROBLEM ",objNameInStudy," cannot be found in the Study"
+ print objNameInStudy," cannot be found in the Study"
return mySO
else:
anAttr = mySO.FindAttribute("AttributeIOR")[1]
if (myObj == None):
myObj = obj._narrow(SALOME_MED.FIELDDOUBLE)
if (myObj == None) :
- print "PROBLEM ",objNameInStudy," has been found in the Study but with the wrong type"
+ print objNameInStudy," has been found in the Study but with the wrong type"
return myObj
fileName = "cube_hexa8_quad4.med"
buildAllGroups(_ptrMesh->_groupNode,_ptrMesh->_familyNode) ;
// on cell
buildAllGroups(_ptrMesh->_groupCell,_ptrMesh->_familyCell) ;
- // on face
- buildAllGroups(_ptrMesh->_groupFace,_ptrMesh->_familyFace) ;
- // on edge
- buildAllGroups(_ptrMesh->_groupEdge,_ptrMesh->_familyEdge) ;
+
+ if (_ptrMesh->_meshDimension == 3)
+ // on face
+ buildAllGroups(_ptrMesh->_groupFace,_ptrMesh->_familyFace) ;
+ else if (_ptrMesh->_meshDimension == 2)
+ // on edge
+ buildAllGroups(_ptrMesh->_groupEdge,_ptrMesh->_familyEdge) ;
// MESSAGE(LOC<<"Checking of CellModel !!!!!!!");
buildAllGroups(_ptrMesh->_groupNode,_ptrMesh->_familyNode) ;
// on cell
buildAllGroups(_ptrMesh->_groupCell,_ptrMesh->_familyCell) ;
- // on face
- buildAllGroups(_ptrMesh->_groupFace,_ptrMesh->_familyFace) ;
- // on edge
- buildAllGroups(_ptrMesh->_groupEdge,_ptrMesh->_familyEdge) ;
+
+ if (_ptrMesh->_meshDimension == 3)
+ // on face
+ buildAllGroups(_ptrMesh->_groupFace,_ptrMesh->_familyFace) ;
+ else if (_ptrMesh->_meshDimension == 2)
+ // on edge
+ buildAllGroups(_ptrMesh->_groupEdge,_ptrMesh->_familyEdge) ;
// MESSAGE(LOC<<"Checking of CellModel !!!!!!!");
#include "MEDMEM_Exception.hxx"
#include "MEDMEM_Med.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
void usage(char * name)
}
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
if (argc != 3) usage(argv[0]);
string filenameIN = argv[1] ;
#include "MEDMEM_MedMedDriver.hxx"
#include "MEDMEM_MedMeshDriver.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
string filenameIN = argv[1] ;
string filenameOUT = argv[2] ;
#include "MEDMEM_Field.hxx"
#include "MEDMEM_VtkMedDriver.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
void usage(char * name)
}
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
if (argc != 3) usage(argv[0]);
string filenameIN = argv[1] ;
#include "MEDMEM_MedFieldDriver.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
}
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
int read;
if ((argc !=3) && (argc != 4)) {
#include "utilities.h"
#include "MEDMEM_Array.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
int SpaceDimension = 3 ;
int NumberOfNodes = 4 ;
MEDARRAY<int> * myArray = new MEDARRAY<int>(SpaceDimension,NumberOfNodes,MED_EN::MED_FULL_INTERLACE) ;
#include "MEDMEM_CellModel.hxx"
#include "MEDMEM_DriversDef.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
list<medGeometryElement> geomList = meshEntities[MED_CELL] ;
list<medGeometryElement>::iterator itGeomList ;
for(itGeomList=geomList.begin();itGeomList!=geomList.end();itGeomList++) {
#include "MEDMEM_Group.hxx"
#include "MEDMEM_Field.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
exit(-1);
}
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
// filename to save the generated MESH
string filenameRoot = argv[1] ;
#include "MEDMEM_Meshing.hxx"
#include "MEDMEM_Field.hxx"
-#include "LocalTraceCollector.hxx"
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
int main (int argc, char ** argv) {
- LocalTraceCollector::instance();
-
double Coordinates[57] = {
2.0, 3.0, 2.0,
3.0, 2.0, 2.0,
#include "MEDMEM_ModulusArray.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
using namespace std ;
int array[5]={0,1,2,1,4} ;
#include "MEDMEM_Connectivity.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
int main(void)
{
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
CONNECTIVITY myNodalConnectivity;
CONNECTIVITY myDescendingConnectivity;
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_MedMeshDriver.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
exit(-1);
}
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
string filename = argv[1];
string meshname = argv[2];
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_MedMeshDriver.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
exit(-1);
}
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
string filename = argv[1];
string meshname = argv[2];
#include "MEDMEM_PolyhedronArray.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
int main(void)
{
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
POLYHEDRONARRAY myPArray(2,11,40);
med_int polyhedronindex[2] = {1,7};
med_int facesindex[11] = {1,5,9,13,17,21,25,28,31,34,37};
#include "utilities.h"
#include "MEDMEM_SkyLineArray.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
int NumberOfCell = 3 ; // 1 triangle,1 quadrangle,1 triangle
int Size = 10 ; // 10 nodes
#include "MEDMEM_Field.hxx"
#include "MEDMEM_ModulusArray.hxx"
#include "MEDMEM_MedMeshDriver.hxx"
-#include "LocalTraceCollector.hxx"
#include <vector>
#define MESHNAME "poly3D"
int main (int argc, char ** argv)
{
- LocalTraceCollector::instance();
if (argc<2) // after 2, ignored !
{
cerr << "Usage : " << argv[0] << " poly3D.med typically in ../../share/salome/resources" << endl << endl;
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
/*
if ((argc !=3) && (argc != 4)) {
cerr << "Usage : " << argv[0]
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
exit(-1);
}
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
string filename = argv[1] ;
string meshname = argv[2] ;
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
/*
if ((argc !=3) && (argc != 4)) {
cerr << "Usage : " << argv[0]
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
}
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
int read;
if (argc <3) { // after 3, ignored !
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
}
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
// int read; !! UNUSED VARIABLE !!
if ((argc !=3) && (argc != 4)) {
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace MEDMEM;
using namespace MED_EN;
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
// int read; !! UNUSED VARIABLE !!
if ((argc !=3) && (argc != 4)) {
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
}
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
int read;
if (argc <3) { // after 3, ignored !
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
/*
if ((argc !=3) && (argc != 4)) {
cerr << "Usage : " << argv[0]
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
int read;
if (argc <3) { // after 3, ignored !
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
}
int main (int argc, char ** argv) {
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
int read;
if (argc <3) { // after 3, ignored !
#include "MEDMEM_GibiMeshDriver.hxx"
#include "MEDMEM_Mesh.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv)
exit(-1);
}
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
string gibifilename = argv[1];
// Construction des noms de fichier
#include "MEDMEM_Grid.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace MEDMEM;
using namespace MED_EN;
if (argc != 3)
usage(argv[0]);
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
const int SpaceDimension=atoi(argv[1]);
const int nbMaille=atoi(argv[2]);
if(SpaceDimension>3 || SpaceDimension<1 || nbMaille<1)
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
double myfunction1(double x)
{
return 0.25*(x-1.0);
exit(-1);
}
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
string filename = argv[verbose+1];
string meshname = argv[verbose+2];
string fieldname = argv[verbose+3];
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace MEDMEM;
using namespace MED_EN;
exit(-1);
}
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
string filename = argv[1] ;
string meshname = argv[2] ;
string fieldname = argv[3];
#include "MEDMEM_PorflowMeshDriver.hxx"
#include "MEDMEM_Mesh.hxx"
-#ifdef _DEBUG_
-#include "LocalTraceCollector.hxx"
-#endif /* ifdef _DEBUG_*/
-
using namespace std;
using namespace MEDMEM;
using namespace MED_EN;
exit(-1);
}
-#ifdef _DEBUG_
- LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
string porflowfilename = argv[1];
// Construction des noms de fichier
delete [] supportEntryPath;
delete [] fieldEntryName;
+ // register the Corba pointer: increase the referrence count
+ MESSAGE("Registering of the Corba Field pointer");
+ Register();
+
MESSAGE("FIELD_i::addInStudy");
//END_OF("FIELD_i::addInStudy");
_medId = newObj->GetID();
myBuilder->CommitCommand();
+ // register the Corba pointer: increase the referrence count
+ MESSAGE("Registering of the Corba Med pointer");
+ Register();
+
END_OF("Med_i::addInStudy(SALOMEDS::Study_ptr myStudy)");
}
// delete [] medObjName1;
+ // register the Corba pointer: increase the referrence count
+ MESSAGE("Registering of the Corba Med pointer");
+ Register();
+
END_OF("Med_i::addInStudy(myStudy, myIor, medObjName)");
}
-
#include <SALOMEconfig.h>
+#include "SALOME_GenericObj_i.hh"
#include CORBA_SERVER_HEADER(MED)
#include CORBA_SERVER_HEADER(SALOMEDS)
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
namespace MEDMEM {
typedef map<DT_IT_, SALOME_MED::FIELD_ptr, LT_DT_IT_ > MAP_IOR_DT_IT_;
-class MED_i: public POA_SALOME_MED::MED
+class MED_i: public POA_SALOME_MED::MED,
+ public SALOME::GenericObj_i
{
private :
_meshId = newObj->GetID();
myBuilder->CommitCommand();
+ // register the Corba pointer: increase the referrence count
+ MESSAGE("Registering of the Corba Mesh pointer");
+ Register();
+
END_OF("Mesh_i::addInStudy(SALOMEDS::Study_ptr myStudy)");
}
//=============================================================================
_meshId = newObj->GetID();
myBuilder->CommitCommand();
+ // register the Corba pointer: increase the referrence count
+ MESSAGE("Registering of the Corba Mesh pointer");
+ Register();
+
END_OF("Mesh_i::addInStudy(SALOMEDS::Study_ptr myStudy)");
}
//=============================================================================
SALOME_MED::long_array_var myseq= new SALOME_MED::long_array;
try
{
- MESSAGE ("Nombre d'elements mis de façon stupide a MED_ALL_ELEMENTS");
+ MESSAGE ("Nombre d'elements mis de façon stupide a MED_ALL_ELEMENTS");
int nbelements=_support->getNumberOfElements(::MED_ALL_ELEMENTS);
myseq->length(nbelements);
const int * numbers=_support->getNumberIndex();
SALOME::SenderInt_ptr ret;
try
{
- MESSAGE ("Nombre d'elements mis de façon stupide a MED_ALL_ELEMENTS");
+ MESSAGE ("Nombre d'elements mis de façon stupide a MED_ALL_ELEMENTS");
int nbelements=_support->getNumberOfElements(::MED_ALL_ELEMENTS);
const int * numbers=_support->getNumberIndex();
ret=SenderFactory::buildSender(*this,numbers,nbelements);
delete [] medsupfatherName;
delete [] supportEntryPath;
+ // register the Corba pointer: increase the referrence count
+ MESSAGE("Registering of the Corba Support pointer");
+ Register();
+
END_OF(LOC);
}
-
##files.append("TimeStamps.med")
##meshNameFiles.append("dom")
+files.append("Darcy3_3D_H_10x10x10_2.med")
+meshNameFiles.append("Darcy3_3D_H_10x10x10")
+
+files.append("elle_3D_HPr_10x10x10_2.med")
+meshNameFiles.append("elle_3D_HPr_10x10x10")
+
+files.append("elle_3D_HPr_2x2x2_2.med")
+meshNameFiles.append("elle_3D_HPr_2x2x2")
+
+files.append("elle_3D_HPr_4x4x4_2.med")
+meshNameFiles.append("elle_3D_HPr_4x4x4")
+
#
# Castem or Gibi file list
#
print " Norme 2 : ", fieldint.norm2()
print " Norme Max : ", fieldint.normMax()
- if fielddouble.getSupport().getEntity()!=MED_NODE:
+ if fieldint.getSupport().getEntity()!=MED_NODE:
fieldint_vol=fieldint.getSupport().getMesh().getVolume(fieldint.getSupport())
print " Norme L1 : ", fieldint.normL1()
print " Norme L2 : ", fieldint.normL2()
print " Name:",compName
print " Description:",compDesc
print " Unit:",compUnit
- if fielddouble.getSupport().getEntity()!=MED_NODE:
+ if fieldint.getSupport().getEntity()!=MED_NODE:
print " Norme L1 : ", fieldint.normL1(kp1)
print " Norme L2 : ", fieldint.normL2(kp1)
print " Norme L2(vol) : ", fieldint.normL2(kp1,fieldint_vol)
FIELDClient<T>::FIELDClient(typename MapCppFieldServ<T>::FieldPtrType ptrCorba,MEDMEM::SUPPORT * S):_fieldPtr(MapCppFieldServ<T>::FieldGlobalType::_duplicate(ptrCorba)),_refCounter(1)
{
if (!S)
- MEDMEM::FIELD<T>::_support=new MEDMEM::SUPPORTClient(_fieldPtr->getSupport());
+ {
+ SCRUTE(_fieldPtr);
+ SCRUTE(_fieldPtr->getSupport());
+ MEDMEM::FIELD<T>::_support=new MEDMEM::SUPPORTClient(_fieldPtr->getSupport());
+ }
else
MEDMEM::FIELD<T>::setSupport(S);
SWIG_DEF = libMEDClient.i
endif
-EXPORT_PYSCRIPTS = libMEDClient.py
+EXPORT_PYSCRIPTS = libMEDClient.py \
+ medClient_test.py
# Libraries targets
%include "libMedCorba_Swig.i"
%include "libMEDMEM_Swig.i"
+%typecheck(SWIG_TYPECHECK_POINTER) SALOME_MED::FIELDDOUBLE_ptr, SALOME_MED::FIELDINT_ptr
+{
+ $1 = ($input != 0);
+}
+
class MESHClient : public MESH {
public:
--- /dev/null
+####################################################################################################
+#
+# Test the MedClient classes: mounting in Memory a .med file and using this file as a client of
+# the MED component we try
+#
+####################################################################################################
+from libMEDClient import *
+
+import string
+
+import salome
+
+import SALOME_MED
+
+from libSALOME_Swig import *
+sg = SALOMEGUI_Swig()
+
+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"
+ listOfSO = salome.myStudy.FindObjectByName(objNameInStudy,compNameInStudy)
+ listLength = len(listOfSO)
+ if (listLength == 0) :
+ print 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 objNameInStudy," cannot be found in the Study"
+ return mySO
+ else:
+ anAttr = mySO.FindAttribute("AttributeIOR")[1]
+ obj = salome.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
+ mySO = salome.myStudy.FindObjectByPath(objNameInStudy)
+ if (mySO == None) :
+ print objNameInStudy," cannot be found in the Study"
+ return mySO
+ else:
+ anAttr = mySO.FindAttribute("AttributeIOR")[1]
+ obj = salome.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
+ mySO = salome.myStudy.FindObjectByPath(objNameInStudy)
+ if (mySO == None) :
+ print objNameInStudy," cannot be found in the Study"
+ return mySO
+ else:
+ anAttr = mySO.FindAttribute("AttributeIOR")[1]
+ obj = salome.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
+ mySO = salome.myStudy.FindObjectByPath(objNameInStudy)
+ if (mySO == None) :
+ print objNameInStudy," cannot be found in the Study"
+ return -1,-1
+ else:
+ anAttr = mySO.FindAttribute("AttributeIOR")[1]
+ obj = salome.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 = "cube_hexa8_quad4.med"
+
+#fileName = "carre_en_quad4_seg2.med"
+
+medComp=salome.lcc.FindOrLoadComponent("FactoryServer", "MED")
+
+import os
+
+filePath=os.environ["MED_ROOT_DIR"]
+filePath=filePath+"/share/salome/resources/"
+
+filePathName = filePath + fileName
+
+print "Reading the .med file ",filePathName," and pushing corba objects in the SALOME study"
+medComp.readStructFileWithFieldType(filePathName,salome.myStudyName)
+sg.updateObjBrowser(1)
+
+print "getting the MED object from the study"
+medObj = getMedObjectFromStudy(fileName)
+
+nbOfMeshes = medObj.getNumberOfMeshes()
+meshNames = medObj.getMeshNames()
+
+print "in this med file there is(are) ",nbOfMeshes," mesh(es):"
+for i in range(nbOfMeshes):
+ meshName = meshNames[i]
+ print " - the ",print_ord(i)," mesh is named ",meshName
+ print " getting the distant MESH object using the API of the corba object MED"
+ meshObj = medObj.getMeshByName(meshName)
+
+
+
+ print " getting mesh information using the API of the corba object MESH but corba objects are obtained from the Study"
+ for entity in [SALOME_MED.MED_NODE,SALOME_MED.MED_CELL,
+ SALOME_MED.MED_FACE,SALOME_MED.MED_EDGE]:
+ nbFam = meshObj.getNumberOfFamilies(entity)
+ nbGrp = meshObj.getNumberOfGroups(entity)
+ if (entity == SALOME_MED.MED_NODE):
+ print " this mesh has ",nbFam," Node Family(ies) and ",nbGrp," Node Group(s)"
+ elif (entity == SALOME_MED.MED_CELL):
+ print " ",nbFam," Cell Family(ies) and ",nbGrp," Cell Group(s)"
+ elif (entity == SALOME_MED.MED_FACE):
+ print " ",nbFam," Face Family(ies) and ",nbGrp," Face Group(s)"
+ elif (entity == SALOME_MED.MED_EDGE):
+ print " ",nbFam," Edge Family(ies) and ",nbGrp," Cell Group(s)"
+
+ if nbFam > 0:
+ for j in range(nbFam):
+ familyName = (meshObj.getFamily(entity,j+1)).getName()
+ familyObj = getSupportObjectFromStudy(meshName,familyName)
+ print familyObj
+
+ if nbGrp > 0:
+ for j in range(nbGrp):
+ groupName = (meshObj.getGroup(entity,j+1)).getName()
+ groupObj = getSupportObjectFromStudy(meshName,groupName)
+ print groupObj
+
+ print "let's get other SUPPORT object from the Study"
+ for entity in [SALOME_MED.MED_NODE,SALOME_MED.MED_CELL,
+ SALOME_MED.MED_FACE,SALOME_MED.MED_EDGE]:
+
+ if entity == SALOME_MED.MED_NODE :
+ entitySupport = "MED_NOEUD"
+ elif entity == SALOME_MED.MED_CELL :
+ entitySupport = "MED_MAILLE"
+ elif entity == SALOME_MED.MED_FACE :
+ entitySuppor = "MED_FACE"
+ elif entity == SALOME_MED.MED_EDGE :
+ entitySupport = "MED_ARETE"
+
+ supportName = "SupportOnAll_"+entitySupport
+ supportObj = getSupportObjectFromStudy(meshName,supportName)
+
+
+
+
+
+ meshLocalCopy = MESHClient(meshObj)
+ print " getting information from the local copy of the distant mesh"
+ name = meshLocalCopy.getName()
+ spaceDimension = meshLocalCopy.getSpaceDimension()
+ meshDimension = meshLocalCopy.getMeshDimension()
+ numberOfNodes = meshLocalCopy.getNumberOfNodes()
+ print " Name = ", name, " space Dim = ", spaceDimension, " mesh Dim = ", meshDimension, " Nb of Nodes = ", numberOfNodes
+ coordSyst = meshLocalCopy.getCoordinatesSystem()
+ print " The coordinates system is",coordSyst
+ print " The Coordinates :"
+ coordNames = []
+ coordUnits = []
+ for isd in range(spaceDimension):
+ coordNames.append(meshLocalCopy.getCoordinateName(isd))
+ coordUnits.append(meshLocalCopy.getCoordinateUnit(isd))
+
+ print " names:", coordNames
+ print " units", coordUnits
+ print " values:"
+ coordinates = meshLocalCopy.getCoordinates(MED_FULL_INTERLACE)
+ for k in range(numberOfNodes):
+ kp1 = k+1
+ print " ---- ", coordinates[k*spaceDimension:(kp1*spaceDimension)]
+ print ""
+ print " The Cell Nodal Connectivity of the Cells:"
+ nbTypesCell = meshLocalCopy.getNumberOfTypes(MED_CELL)
+ print ""
+ if (nbTypesCell>0):
+ print " The Mesh has",nbTypesCell,"Type(s) of Cell"
+ types = meshLocalCopy.getTypes(MED_CELL)
+ for k in range(nbTypesCell):
+ type = types[k]
+ nbElemType = meshLocalCopy.getNumberOfElements(MED_CELL,type)
+ print " For the type:",type,"there is(are)",nbElemType,"elemnt(s)"
+ connectivity = meshLocalCopy.getConnectivity(MED_FULL_INTERLACE,MED_NODAL,MED_CELL,type)
+ nbNodesPerCell = type%100
+ for j in range(nbElemType):
+ print " Element",(j+1)," ",connectivity[j*nbNodesPerCell:(j+1)*nbNodesPerCell]
+
+
+nbOfFields = medObj.getNumberOfFields()
+print "in the considered .med file there is(are) ",nbOfFields," field(s):"
+fieldNames = medObj.getFieldNames()
+for i in range(nbOfFields):
+ fieldName = fieldNames[i]
+ nbOfIt = medObj.getFieldNumberOfIteration(fieldName)
+ print " - the ",print_ord(i)," field is name ",fieldName," and has ",nbOfIt," iteration(s)"
+ for j in range(nbOfIt):
+ dtitfield = medObj.getFieldIteration(fieldName,j)
+ dt = dtitfield[0]
+ it = dtitfield[1]
+ print " * Iteration:",dt,"Order number:",it
+ meshName = meshNames[0]
+ for entity in [SALOME_MED.MED_NODE,SALOME_MED.MED_CELL,
+ SALOME_MED.MED_FACE,SALOME_MED.MED_EDGE]:
+ if entity == SALOME_MED.MED_NODE :
+ entitySupport = "MED_NOEUD"
+ elif entity == SALOME_MED.MED_CELL :
+ entitySupport = "MED_MAILLE"
+ elif entity == SALOME_MED.MED_FACE :
+ entitySuppor = "MED_FACE"
+ elif entity == SALOME_MED.MED_EDGE :
+ entitySupport = "MED_ARETE"
+ supportName = "SupportOnAll_"+entitySupport
+ print " getting a corba object Field from the study iteration ",dt," order number ",it," on the support ",supportName," from the mesh ",meshName
+ fieldObj,type = getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName)
+ print fieldObj
+
+ if ((fieldObj != None) and (fieldObj != -1)):
+ if(type == 1):
+ fieldTyped = FIELDDOUBLEClient(fieldObj)
+ elif (type == 0):
+ fieldTyped = FIELDINTClient(fieldObj)
+
+ type = fieldTyped.getValueType()
+ print " * Iteration:",dt,"Order number:",it,"Type:",type
+ name = fieldTyped.getName()
+ desc = fieldTyped.getDescription()
+ nbOfComp = fieldTyped.getNumberOfComponents()
+ print " Field",name," : ",desc
+ print " Number Of Components:",nbOfComp
+ iterationNb = fieldTyped.getIterationNumber()
+ orderNb = fieldTyped.getOrderNumber()
+ time = fieldTyped.getTime()
+ print " Iteration Number",iterationNb
+ print " Order Number",orderNb
+ print " Time",time
+ support = fieldTyped.getSupport()
+ nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
+ print " Values:",nbOf
+ for k in range(nbOf):
+ valueI = fieldTyped.getValueI(MED_FULL_INTERLACE,k+1)
+ print " *",valueI[:nbOfComp]
+
+
+
+
+
+
+
+
+
+
+
+
+print ""
+print "END of the Pyhton script ..... Ctrl D to exit"