From: ageay Date: Wed, 9 Mar 2011 07:10:21 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: FirstStepOK1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=12d79e2f33e6221f25043930a65e8d2efa9f0259;p=tools%2Fmedcoupling.git *** empty log message *** --- diff --git a/doc/MEDMEM/FIELDcreate.cxx b/doc/MEDMEM/FIELDcreate.cxx index c511feb34..a579b80a7 100644 --- a/doc/MEDMEM/FIELDcreate.cxx +++ b/doc/MEDMEM/FIELDcreate.cxx @@ -34,7 +34,6 @@ int main (int argc, char ** argv) { /* read MESH */ MESH * myMesh = new MESH(MED_DRIVER,MedFile,MeshName) ; - // myMesh->read() ; // we need a support : SUPPORT * mySupport = new SUPPORT(myMesh,"Support on all CELLs",MED_CELL); @@ -75,7 +74,7 @@ int main (int argc, char ** argv) { myField.setTime(Time) ; // Value : - int NumberOfValue = mySupport->getNumberOfElements(MED_ALL_ELEMENTS); + int NumberOfValue = mySupport->getNumberOfElements(MEDMEM_ALL_ELEMENTS); for(int i=1; i<=NumberOfValue; i++) // i^th element for (int j=1; j<=NumberOfCompoennts; j++) { // j^th component double myValue = (i+j) * 0.1 ; @@ -83,7 +82,7 @@ int main (int argc, char ** argv) { } // save this new field - int id = myField.addDriver(MED_DRIVER) ; + myField.write(MED_DRIVER,filename) ; return 0 ; } diff --git a/doc/MEDMEM/FIELDcreate.py b/doc/MEDMEM/FIELDcreate.py index 944843076..c2dc59c37 100644 --- a/doc/MEDMEM/FIELDcreate.py +++ b/doc/MEDMEM/FIELDcreate.py @@ -34,7 +34,7 @@ meshName = "maa1" myMesh = MESH(MED_DRIVER,MedFile,meshName) -mySupport = myMesh.getSupportOnAll(MED_CELL) +mySupport = SUPPORT(myMesh,"Support on all CELLs",MED_CELL) numberOfComponents = 3 myField = FIELDDOUBLE(mySupport,numberOfComponents) @@ -66,7 +66,7 @@ myField.setOrderNumber(orderNumber) time = 3.435678 myField.setTime(time) -numberOfValue = mySupport.getNumberOfElements(MED_ALL_ELEMENTS) +numberOfValue = mySupport.getNumberOfElements(MEDMEM_ALL_ELEMENTS) for i in range(numberOfValue): ip1 = i+1 diff --git a/doc/MEDMEM/FIELDgeneral.cxx b/doc/MEDMEM/FIELDgeneral.cxx index ee63c79f0..0b9178de4 100644 --- a/doc/MEDMEM/FIELDgeneral.cxx +++ b/doc/MEDMEM/FIELDgeneral.cxx @@ -68,7 +68,7 @@ int main (int argc, char ** argv) { " (and order number " << OrderNumber << ")" << endl ; // How many Value : - int NumberOfValue = mySupport->getNumberOfElements(MED_ALL_ELEMENTS); + int NumberOfValue = mySupport->getNumberOfElements(MEDMEM_ALL_ELEMENTS); // Value const double * Value = myField.getValue(); for(int i=0; iremoveReference(); + myMesh->removeReference(); return 0 ; } diff --git a/doc/MEDMEM/FIELDgeneral.py b/doc/MEDMEM/FIELDgeneral.py index bbb9efa34..c2bd995a8 100644 --- a/doc/MEDMEM/FIELDgeneral.py +++ b/doc/MEDMEM/FIELDgeneral.py @@ -35,7 +35,7 @@ fieldName = "fieldcelldoublescalar" myMesh = MESH(MED_DRIVER,MedFile,meshName) -mySupport = myMesh.getSupportOnAll(MED_CELL) +mySupport = SUPPORT(myMesh,"Support on CELLs",MED_CELL) myField = FIELDDOUBLE(mySupport,MED_DRIVER,MedFile,fieldName,-1,-1) @@ -58,7 +58,7 @@ time = myField.getTime() print "Iteration ",iterationNumber," at time ",time,\ " (and order number ",orderNumber,")" -numberOfValue = mySupport.getNumberOfElements(MED_ALL_ELEMENTS) +numberOfValue = mySupport.getNumberOfElements(MEDMEM_ALL_ELEMENTS) value = myField.getValue() for i in range(numberOfValue): diff --git a/doc/MEDMEM/MEDMEM_Content.tex.in b/doc/MEDMEM/MEDMEM_Content.tex.in index 109e8bc66..db50cff9a 100644 --- a/doc/MEDMEM/MEDMEM_Content.tex.in +++ b/doc/MEDMEM/MEDMEM_Content.tex.in @@ -220,25 +220,25 @@ available types are linear and quadratic elements (consult \cite{RefManualMedMemory}). The entries of the enum are quite self-explanatory~: \begin{itemize} -\item \verb+MED_NONE+ -\item \verb+MED_POINT1+ -\item \verb+MED_SEG2+ -\item \verb+MED_SEG3+ -\item \verb+MED_TRIA3+ -\item \verb+MED_QUAD4+ -\item \verb+MED_TRIA6+ -\item \verb+MED_QUAD8+ -\item \verb+MED_TETRA4+ -\item \verb+MED_PYRA5+ -\item \verb+MED_PENTA6+ -\item \verb+MED_HEXA8+ -\item \verb+MED_TETRA10+ -\item \verb+MED_PYRA13+ -\item \verb+MED_PENTA15+ -\item \verb+MED_HEXA20+ -\item \verb+MED_POLYGON+ -\item \verb+MED_POLYHEDRA+ -\item \verb+MED_ALL_ELEMENTS+ +\item \verb+MEDMEM_NONE+ +\item \verb+MEDMEM_POINT1+ +\item \verb+MEDMEM_SEG2+ +\item \verb+MEDMEM_SEG3+ +\item \verb+MEDMEM_TRIA3+ +\item \verb+MEDMEM_QUAD4+ +\item \verb+MEDMEM_TRIA6+ +\item \verb+MEDMEM_QUAD8+ +\item \verb+MEDMEM_TETRA4+ +\item \verb+MEDMEM_PYRA5+ +\item \verb+MEDMEM_PENTA6+ +\item \verb+MEDMEM_HEXA8+ +\item \verb+MEDMEM_TETRA10+ +\item \verb+MEDMEM_PYRA13+ +\item \verb+MEDMEM_PENTA15+ +\item \verb+MEDMEM_HEXA20+ +\item \verb+MEDMEM_POLYGON+ +\item \verb+MEDMEM_POLYHEDRA+ +\item \verb+MEDMEM_ALL_ELEMENTS+ \end{itemize} \item an enum which contains the different mesh entities, \verb+medEntityMesh+, the @@ -385,7 +385,7 @@ type of this entity. \textbf{C++ Example~:} -\verb+int NumberOfTriangle = myMesh.getNumberOfElements(MED_FACE,MED_TRIA3);+ +\verb+int NumberOfTriangle = myMesh.getNumberOfElements(MED_FACE,MEDMEM_TRIA3);+ \verb+int NumberOfFace = myMesh.getNumberOfElements(MED_FACE,MED_ALL_ELEMENT);+ @@ -408,18 +408,18 @@ return an array with connectivity values. \textbf{C++ Example~:} \begin{verbatim} -int NumberOfTetrahedron = myMesh.getNumberOfElements(MED_CELL,MED_TETRA4); +int NumberOfTetrahedron = myMesh.getNumberOfElements(MED_CELL,MEDMEM_TETRA4); const int * TetrahedronConnectivity = myMesh.getConnectivity(MED_FULL_ENTERLACE, MED_NODAL, MED_CELL, - MED_TETRA4); + MEDMEM_TETRA4); \end{verbatim} \verb+TetrahedronConnectivity+ contain nodal connectivity of tetrahedron in mesh. It is arranged in full enterlace mode and its size is \verb+NumberOfTetrahedron x 4+. -If you want to get connectivity of all elements (with \verb+Type=MED_ALL_ELEMENTS+), +If you want to get connectivity of all elements (with \verb+Type=MEDMEM_ALL_ELEMENTS+), you must use the index array (return by \method{getConnectivityIndex}) to get connectivity for each elements (see example \myref{MESHconnectivities.cxx}). @@ -434,30 +434,6 @@ int myNumber = myMesh.getElementNumber(MED_NODAL,MED_CELL, myElementConnectivity); \end{verbatim} -%%%%%%%%%%% WITH POLY METHODS %%%%%%%%%%%% - -\item The listed above methods do not take into account information about - \verb+polygonal+ and \verb+polyhedral+ cells contained in a MESH object. To get - full information about cell types, use the same methods with - \verb+WithPoly+ postfix: -\begin{itemize} -\item use \method{getNumberOfTypesWithPoly} to get the number of - geometric types for a mesh entity; -\item use \method{getTypesWithPoly} to get all geometric types for a mesh entity; -\item use \method{getNumberOfElementsWithPoly} to get the number of cells; -\item use \method{getElementTypeWithPoly} to get the geometric type of - one element. -\end{itemize} -There are separate methods to get number of polygons and polyhedrons: -\method{getNumberOfPolygons} and \method{getNumberOfPolyhedron} - -To get connectivity of polygonal elements, use \method{getPolygonsConnectivity} along with -\method{getPolygonsConnectivityIndex} (see example \myref{MESHconnectivities.cxx}). - -To get nodal connectivity of polyhedral elements, it is necessary use together -3 methods: \method{getPolyhedronConnectivity}, \method{getPolyhedronFacesIndex} -and \method{getPolyhedronIndex} (see example \myref{MESHconnectivities.cxx}). - \end{enumerate} Here is a small C++ example program which the Python version may be found in @@ -700,8 +676,7 @@ in increasing order of number of nodes for this type ; \item \method{setNumberOfElements} to set the number of elements for each geometric type. This method allocates connectivities array ; \item \method{setConnectivity} to set the connectivity in MED\_FULL\_INTERLACE -mode for each geometric type (use \method{setPolygonsConnectivity} and -\method{setPolyhedraConnectivity} for poly elements); +mode for each geometric type; \end{itemize} \textbf{C++ Example~:} @@ -710,10 +685,10 @@ MESHING myMeshing ; myMeshing.setCoordinates(SpaceDimension,NumberOfNodes,Coordinates,System,Mode); myMeshing.setNumberOfTypes(2,MED_CELL); -myMeshing.setTypes({MED_TRIA3,MED_QUAD4},MED_CELL); -myMeshing.setNumberOfElements({3,2},MED_CELL); // 3 MED_TRIA3 and 2 MED_QUAD4 -myMeshing.setConnectivity({1,2,3,6,8,9,4,5,6},MED_CELL,MED_TRIA3); -myMeshing.setConnectivity({1,3,4,5,4,5,7,8},MED_CELL,MED_QUAD4); +myMeshing.setTypes({MEDMEM_TRIA3,MEDMEM_QUAD4},MED_CELL); +myMeshing.setNumberOfElements({3,2},MED_CELL); // 3 MEDMEM_TRIA3 and 2 MEDMEM_QUAD4 +myMeshing.setConnectivity({1,2,3,6,8,9,4,5,6},MED_CELL,MEDMEM_TRIA3); +myMeshing.setConnectivity({1,3,4,5,4,5,7,8},MED_CELL,MEDMEM_QUAD4); \end{verbatim} diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx b/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx index 3ae53a608..8fe5c483e 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx +++ b/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx @@ -25,7 +25,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_Mesh.hxx" -#include "MEDMEM_Med.hxx" using namespace MEDMEM ; using namespace MED_EN ; @@ -33,24 +32,21 @@ using namespace MED_EN ; main () { const char * fileName = "pointe.med"; - const char * fieldName = "fieldcelldouble"; + const char * fieldName = "fieldcelldoublescalar"; const char * meshName = "maa1"; try { // Test creation of drivers at object Creation time - //This test failed due to inadequate Support implementation - // FIELD myField (MED_DRIVER,fileName,fieldName); + FIELD myField (MED_DRIVER,fileName,fieldName); MESH myMesh (MED_DRIVER,fileName,meshName); - MED myMed (MED_DRIVER,fileName); // Test removal of drivers - //myField.rmDriver(); + myField.rmDriver(); myMesh.rmDriver (); - myMed.rmDriver (); } catch (MEDEXCEPTION& ex){ - MESSAGE(ex.what()) ; + MESSAGE_MED(ex.what()) ; } } diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.py b/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.py index d6c56cb89..939395bc1 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.py +++ b/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.py @@ -37,15 +37,9 @@ try: print "Creation of MESH object" myMesh = MESH(MED_DRIVER,medFile,meshName) - print "Creation of MED object" - myMed = MED(MED_DRIVER,medFile) - - print "Test the driver removal dor MESH" + print "Test the driver removal for MESH" myMesh.rmDriver() - print "Test the driver removal dor MED" - myMed.rmDriver() - print "End of Python script" except: diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx index 2c3240a13..2ec038ab6 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx +++ b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx @@ -25,8 +25,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_Mesh.hxx" -#include "MEDMEM_Med.hxx" -#include "MEDMEM_MedMedDriver.hxx" #include "MEDMEM_MedMeshDriver.hxx" using namespace MEDMEM ; @@ -84,25 +82,9 @@ main () { delete myMesh; } - { - MED * myMed = new MED(); - MED_MED_RDONLY_DRIVER myRdOnlyDriver(fileName,myMed); - myRdOnlyDriver.open(); - myRdOnlyDriver.readFileStruct(); - myRdOnlyDriver.close(); - myMed->updateSupport(); // DOIT ETRE SUPPRIMEE - // myRdOnlyDriver.read(); - // try { myRdOnlyDriver.write(); } catch (MEDEXCEPTION& ex) - // { MESSAGE(ex.what()); } - //MED_MED_WRONLY_DRIVER myWrOnlyDriver(fileName3,myMed); - //myWrOnlyDriver.open(); - //myWrOnlyDriver.write(); // Not implemented yet. - //myWrOnlyDriver.close(); - delete myMed; - } } catch (MEDEXCEPTION& ex){ cout << "MAIN BLOCK EXCEPTION" << endl; - MESSAGE(ex.what()) ; + MESSAGE_MED(ex.what()) ; } } diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.py b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.py index ea1316c7b..714c93803 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.py +++ b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.py @@ -31,7 +31,7 @@ from libMEDMEM_Swig import * medFile = "pointe.med" medFile2 = "Field&MeshGeneratedPointe.med" -fieldName = "fieldcelldouble" +fieldName = "fieldcelldoublescalar" meshName = "maa1" try: @@ -53,17 +53,17 @@ except : try: myMesh = MESH() - myRdOnlyDriver = MED_MESH_RDONLY_DRIVER(medFile,myMesh) myRdOnlyDriver.setMeshName(meshName) myRdOnlyDriver.open() myRdOnlyDriver.read() myRdOnlyDriver.close() - myWrOnlyDriver = MED_MESH_WRONLY_DRIVER(medFile2,myMesh) + myWrOnlyDriver = MED_MESH_WRONLY_DRIVER(medFile,myMesh) myWrOnlyDriver.setMeshName(meshName) myWrOnlyDriver.open() myWrOnlyDriver.write() + myWrOnlyDriver.close() print "Invoking mesh drivers OK" @@ -71,15 +71,3 @@ except : print "there is a problem in invoking mesh drivers !!" print "Please consult the error standart output of the python execution !!" -try: - myMed = MED() - myRdOnlyDriver = MED_MED_RDONLY_DRIVER(medFile,myMed) - myRdOnlyDriver.open() - myRdOnlyDriver.readFileStruct() - myRdOnlyDriver.close() - myMed.updateSupport() - - print "Invoking Med drivers OK" -except : - print "There is a problem in invoking MED drivers !!" - print "Please consult the error standart output of the python execution !!" diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx b/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx index 01ea3d2ce..8fb7cf3dc 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx +++ b/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx @@ -25,7 +25,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_Mesh.hxx" -#include "MEDMEM_Med.hxx" using namespace MEDMEM ; using namespace MED_EN ; @@ -34,7 +33,7 @@ main () { const char * fileName = "pointe.med"; const char * fileName2 = "fieldCellDoubleOfpointe.med"; - const char * fieldName = "fieldcelldouble"; + const char * fieldName = "fieldcelldoublescalar"; const char * meshName = "maa1"; try { @@ -55,16 +54,11 @@ main () { myMesh->read(); myMesh->rmDriver(); - MED * myMed = new MED(); - int myDriver4 = myMed->addDriver(MED_DRIVER, fileName); - myMed->readFileStruct(); - myMed->rmDriver(); - delete myField; - delete myMesh; - delete myMed; + myMesh->removeReference(); + myField->removeReference(); } catch (MEDEXCEPTION& ex){ - MESSAGE(ex.what()) ; + MESSAGE_MED(ex.what()) ; } } diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.py b/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.py index c1d870b51..aafefdeee 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.py +++ b/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.py @@ -30,8 +30,8 @@ from libMEDMEM_Swig import * medFile = "pointe.med" -medFile2 = "fieldCellDoubleOfpointe.med" -fieldName = "fieldcelldouble" +medFile2 = "fieldCellDoubleOfpointe.me" +fieldName = "fieldcelldoublescalar" meshName = "maa1" try: @@ -48,10 +48,6 @@ try: myMesh.read() myMesh.rmDriver() - myMed = MED(MED_DRIVER,medFile) - myMed.readFileStruct() - myMed.rmDriver() - except: print "There is a problem somewhere !!" print "Please consult the error standart output of the python execution !!" diff --git a/doc/MEDMEM/MEDMEM_MedAddingAnExistingObject.cxx b/doc/MEDMEM/MEDMEM_MedAddingAnExistingObject.cxx index f3794fbe1..e5558d0bc 100644 --- a/doc/MEDMEM/MEDMEM_MedAddingAnExistingObject.cxx +++ b/doc/MEDMEM/MEDMEM_MedAddingAnExistingObject.cxx @@ -25,14 +25,13 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_Mesh.hxx" -#include "MEDMEM_Med.hxx" main () { const char * fileName = "pointe.med"; const char * fileName2 = "Field&MeshGeneratedPointe.med"; const char * fileName3 = "MedGeneratedPointe.med"; - const char * fieldName1 = "fieldcelldouble"; + const char * fieldName1 = "fieldcelldoublescalar"; const char * fieldName2 = "fieldcelldoublebis"; const char * meshName1 = "maa1"; const char * meshName2 = "maa1bis"; @@ -45,15 +44,9 @@ main () { myMesh.setName(meshName2); myMesh.rmDriver(); - MED myMed(MED_DRIVER,fileName); - myMed.read(); - myMed.addMesh(&myMesh); - int myMedDriver = myMed.addDriver(MED_DRIVER,fileName3); - myMed.write(myMedDriver); - // FAIRE LE TEST AVEC LES CHAMPS AUSSI !. } catch (MEDEXCEPTION& ex){ - MESSAGE(ex.what()) ; + MESSAGE_MED(ex.what()) ; } } diff --git a/doc/MEDMEM/MEDMEM_UsersGuide.lyx b/doc/MEDMEM/MEDMEM_UsersGuide.lyx index e0008ba8c..77a677e17 100644 --- a/doc/MEDMEM/MEDMEM_UsersGuide.lyx +++ b/doc/MEDMEM/MEDMEM_UsersGuide.lyx @@ -488,7 +488,7 @@ C++ Example\SpecialChar ~ \latex latex \backslash -verb+int NumberOfTriangle = myMesh.getNumberOfElements(MED_FACE,MED_TRIA3);+ +verb+int NumberOfTriangle = myMesh.getNumberOfElements(MED_FACE,MEDMEM_TRIA3);+ \layout Standard @@ -574,7 +574,7 @@ C++ Example\SpecialChar ~ \backslash begin{verbatim} \newline -int NumberOfTetrahedron = myMesh.getNumberOfElements(MED_CELL,MED_TETRA4); +int NumberOfTetrahedron = myMesh.getNumberOfElements(MED_CELL,MEDMEM_TETRA4); \newline int * TetrahedronConnectivity = \newline @@ -584,7 +584,7 @@ int * TetrahedronConnectivity = \newline MED_CELL, \newline - MED_TETRA4); + MEDMEM_TETRA4); \newline \backslash @@ -606,7 +606,7 @@ If you want to get connectivity of all elements (with \latex latex \backslash -verb+Type=MED_ALL_ELEMENTS+ +verb+Type=MEDMEM_ALL_ELEMENTS+ \latex default ), you must use the index array (return by \latex latex diff --git a/doc/MEDMEM/MESHINGexample.cxx b/doc/MEDMEM/MESHINGexample.cxx index 4a4fdc7d0..3c85ce73e 100644 --- a/doc/MEDMEM/MESHINGexample.cxx +++ b/doc/MEDMEM/MESHINGexample.cxx @@ -33,8 +33,8 @@ int main (int argc, char ** argv) { // filename to save the generated MESH string filename = "meshing.med" ; - MESHING myMeshing ; - myMeshing.setName("meshing") ; + MESHING* myMeshing = new MESHING; + myMeshing->setName("meshing") ; // define coordinates @@ -62,25 +62,25 @@ int main (int argc, char ** argv) { 0.0, 0.0, 5.0 }; - myMeshing.setCoordinates(SpaceDimension,NumberOfNodes,Coordinates,"CARTESIAN",MED_FULL_INTERLACE); + myMeshing->setCoordinates(SpaceDimension,NumberOfNodes,Coordinates,"CARTESIAN",MED_FULL_INTERLACE); string Names[3] = { "X","Y","Z" } ; - myMeshing.setCoordinatesNames(Names); + myMeshing->setCoordinatesNames(Names); string Units[3] = { "cm","cm","cm" } ; - myMeshing.setCoordinatesUnits(Units) ; + myMeshing->setCoordinatesUnits(Units) ; // define conectivities // cell part const int NumberOfTypes = 3 ; - medGeometryElement Types[NumberOfTypes] = {MED_TETRA4,MED_PYRA5,MED_HEXA8} ; + medGeometryElement Types[NumberOfTypes] = {MEDMEM_TETRA4,MEDMEM_PYRA5,MEDMEM_HEXA8} ; const int NumberOfElements[NumberOfTypes] = {12,2,2} ; - myMeshing.setNumberOfTypes(NumberOfTypes,MED_CELL); - myMeshing.setTypes(Types,MED_CELL); - myMeshing.setNumberOfElements(NumberOfElements,MED_CELL); + myMeshing->setNumberOfTypes(NumberOfTypes,MED_CELL); + myMeshing->setTypes(Types,MED_CELL); + myMeshing->setNumberOfElements(NumberOfElements,MED_CELL); const int sizeTetra = 12*4 ; int ConnectivityTetra[sizeTetra]= @@ -99,7 +99,7 @@ int main (int argc, char ** argv) { 2,10,6,9 }; - myMeshing.setConnectivity(ConnectivityTetra,MED_CELL,MED_TETRA4); + myMeshing->setConnectivity(MED_CELL,MEDMEM_TETRA4,ConnectivityTetra); int ConnectivityPyra[2*5]= { @@ -107,7 +107,7 @@ int main (int argc, char ** argv) { 15,18,17,16,19 }; - myMeshing.setConnectivity(ConnectivityPyra,MED_CELL,MED_PYRA5); + myMeshing->setConnectivity(MED_CELL,MEDMEM_PYRA5,ConnectivityPyra); int ConnectivityHexa[2*8]= { @@ -115,17 +115,17 @@ int main (int argc, char ** argv) { 15,16,17,18,11,12,13,14 }; - myMeshing.setConnectivity(ConnectivityHexa,MED_CELL,MED_HEXA8); + myMeshing->setConnectivity(MED_CELL,MEDMEM_HEXA8,ConnectivityHexa); // face part const int NumberOfFacesTypes = 2 ; - medGeometryElement FacesTypes[NumberOfFacesTypes] = {MED_TRIA3,MED_QUAD4} ; + medGeometryElement FacesTypes[NumberOfFacesTypes] = {MEDMEM_TRIA3,MEDMEM_QUAD4} ; const int NumberOfFacesElements[NumberOfFacesTypes] = {4,4} ; - myMeshing.setNumberOfTypes(NumberOfFacesTypes,MED_FACE); - myMeshing.setTypes(FacesTypes,MED_FACE); - myMeshing.setNumberOfElements(NumberOfFacesElements,MED_FACE); + myMeshing->setNumberOfTypes(NumberOfFacesTypes,MED_FACE); + myMeshing->setTypes(FacesTypes,MED_FACE); + myMeshing->setNumberOfElements(NumberOfFacesElements,MED_FACE); const int sizeTria = 3*4 ; int ConnectivityTria[sizeTria]= @@ -136,7 +136,7 @@ int main (int argc, char ** argv) { 1,3,6 }; - myMeshing.setConnectivity(ConnectivityTria,MED_FACE,MED_TRIA3); + myMeshing->setConnectivity(MED_FACE,MEDMEM_TRIA3,ConnectivityTria); int ConnectivityQua[4*4]= { @@ -146,7 +146,7 @@ int main (int argc, char ** argv) { 12,8,9,13 }; - myMeshing.setConnectivity(ConnectivityQua,MED_FACE,MED_QUAD4); + myMeshing->setConnectivity(MED_FACE,MEDMEM_QUAD4,ConnectivityQua); // edge part @@ -156,49 +156,51 @@ int main (int argc, char ** argv) { // Node : { - GROUP myGroup ; - myGroup.setName("SomeNodes"); - myGroup.setMesh(&myMeshing); - myGroup.setEntity(MED_NODE); - myGroup.setNumberOfGeometricType(1); - medGeometryElement myTypes[1] = {MED_NONE}; - myGroup.setGeometricType(myTypes); + GROUP* myGroup = new GROUP; + myGroup->setName("SomeNodes"); + myGroup->setMesh(myMeshing); + myGroup->setEntity(MED_NODE); + myGroup->setNumberOfGeometricType(1); + medGeometryElement myTypes[1] = {MEDMEM_NONE}; + myGroup->setGeometricType(myTypes); const int myNumberOfElements[1] = {4} ; - myGroup.setNumberOfElements(myNumberOfElements); + myGroup->setNumberOfElements(myNumberOfElements); const int index[1+1] = {1,5} ; const int value[4]= { 1,4,5,7} ; - myGroup.setNumber(index,value); + myGroup->setNumber(index,value); - myMeshing.addGroup(myGroup); + myMeshing->addGroup(*myGroup); + myGroup->removeReference(); } { - GROUP myGroup ; - myGroup.setName("OtherNodes"); - myGroup.setMesh(&myMeshing); - myGroup.setEntity(MED_NODE); - myGroup.setNumberOfGeometricType(1); - medGeometryElement myTypes[1] = {MED_NONE}; - myGroup.setGeometricType(myTypes); + GROUP* myGroup = new GROUP; + myGroup->setName("OtherNodes"); + myGroup->setMesh(myMeshing); + myGroup->setEntity(MED_NODE); + myGroup->setNumberOfGeometricType(1); + medGeometryElement myTypes[1] = {MEDMEM_NONE}; + myGroup->setGeometricType(myTypes); const int myNumberOfElements[1] = {3} ; - myGroup.setNumberOfElements(myNumberOfElements); + myGroup->setNumberOfElements(myNumberOfElements); const int index[1+1] = {1,4} ; const int value[3]= { 2,3,6} ; - myGroup.setNumber(index,value); + myGroup->setNumber(index,value); - myMeshing.addGroup(myGroup); + myMeshing->addGroup(*myGroup); + myGroup->removeReference(); } // Cell : { - GROUP myGroup ; - myGroup.setName("SomeCells"); - myGroup.setMesh(&myMeshing); - myGroup.setEntity(MED_CELL); - myGroup.setNumberOfGeometricType(3); - medGeometryElement myTypes[3] = {MED_TETRA4,MED_PYRA5,MED_HEXA8}; - myGroup.setGeometricType(myTypes); + GROUP* myGroup = new GROUP; + myGroup->setName("SomeCells"); + myGroup->setMesh(myMeshing); + myGroup->setEntity(MED_CELL); + myGroup->setNumberOfGeometricType(3); + medGeometryElement myTypes[3] = {MEDMEM_TETRA4,MEDMEM_PYRA5,MEDMEM_HEXA8}; + myGroup->setGeometricType(myTypes); const int myNumberOfElements[3] = {4,1,2} ; - myGroup.setNumberOfElements(myNumberOfElements); + myGroup->setNumberOfElements(myNumberOfElements); const int index[3+1] = {1,5,6,8} ; const int value[4+1+2]= { @@ -206,75 +208,79 @@ int main (int argc, char ** argv) { 13, 15,16 }; - myGroup.setNumber(index,value); + myGroup->setNumber(index,value); - myMeshing.addGroup(myGroup); + myMeshing->addGroup(*myGroup); + myGroup->removeReference(); } { - GROUP myGroup ; - myGroup.setName("OtherCells"); - myGroup.setMesh(&myMeshing); - myGroup.setEntity(MED_CELL); - myGroup.setNumberOfGeometricType(2); - medGeometryElement myTypes[] = {MED_TETRA4,MED_PYRA5}; - myGroup.setGeometricType(myTypes); + GROUP* myGroup = new GROUP; + myGroup->setName("OtherCells"); + myGroup->setMesh(myMeshing); + myGroup->setEntity(MED_CELL); + myGroup->setNumberOfGeometricType(2); + medGeometryElement myTypes[] = {MEDMEM_TETRA4,MEDMEM_PYRA5}; + myGroup->setGeometricType(myTypes); const int myNumberOfElements[] = {4,1} ; - myGroup.setNumberOfElements(myNumberOfElements); + myGroup->setNumberOfElements(myNumberOfElements); const int index[3+1] = {1,5,6} ; const int value[4+1]= { 3,4,5,9, 14 }; - myGroup.setNumber(index,value); + myGroup->setNumber(index,value); - myMeshing.addGroup(myGroup); + myMeshing->addGroup(*myGroup); + myGroup->removeReference(); } // Face : { - GROUP myGroup ; - myGroup.setName("SomeFaces"); - myGroup.setMesh(&myMeshing); - myGroup.setEntity(MED_FACE); - myGroup.setNumberOfGeometricType(2); - medGeometryElement myTypes[2] = {MED_TRIA3,MED_QUAD4}; - myGroup.setGeometricType(myTypes); + GROUP* myGroup = new GROUP; + myGroup->setName("SomeFaces"); + myGroup->setMesh(myMeshing); + myGroup->setEntity(MED_FACE); + myGroup->setNumberOfGeometricType(2); + medGeometryElement myTypes[2] = {MEDMEM_TRIA3,MEDMEM_QUAD4}; + myGroup->setGeometricType(myTypes); const int myNumberOfElements[2] = {2,3} ; - myGroup.setNumberOfElements(myNumberOfElements); + myGroup->setNumberOfElements(myNumberOfElements); const int index[2+1] = {1,3,6} ; const int value[2+3]= { 2,4, 5,6,8 } ; - myGroup.setNumber(index,value); + myGroup->setNumber(index,value); - myMeshing.addGroup(myGroup); + myMeshing->addGroup(*myGroup); + myGroup->removeReference(); } { - GROUP myGroup ; - myGroup.setName("OtherFaces"); - myGroup.setMesh(&myMeshing); - myGroup.setEntity(MED_FACE); - myGroup.setNumberOfGeometricType(1); - medGeometryElement myTypes[1] = {MED_TRIA3}; - myGroup.setGeometricType(myTypes); + GROUP* myGroup = new GROUP; + myGroup->setName("OtherFaces"); + myGroup->setMesh(myMeshing); + myGroup->setEntity(MED_FACE); + myGroup->setNumberOfGeometricType(1); + medGeometryElement myTypes[1] = {MEDMEM_TRIA3}; + myGroup->setGeometricType(myTypes); const int myNumberOfElements[1] = {2} ; - myGroup.setNumberOfElements(myNumberOfElements); + myGroup->setNumberOfElements(myNumberOfElements); const int index[1+1] = {1,3} ; const int value[2]= { 1,3 } ; - myGroup.setNumber(index,value); + myGroup->setNumber(index,value); - myMeshing.addGroup(myGroup); + myMeshing->addGroup(*myGroup); + myGroup->removeReference(); } // all rigtht, we save it ! - int id = myMeshing.addDriver(MED_DRIVER,filename,myMeshing.getName()); - myMeshing.write(id) ; - + int id = myMeshing->addDriver(MED_DRIVER,filename,myMeshing->getName()); + myMeshing->write(id) ; + myMeshing->removeReference(); } diff --git a/doc/MEDMEM/MESHINGexample.py b/doc/MEDMEM/MESHINGexample.py index 77694b2fc..a05a00319 100644 --- a/doc/MEDMEM/MESHINGexample.py +++ b/doc/MEDMEM/MESHINGexample.py @@ -49,84 +49,26 @@ spaceDimension = 3 numberOfNodes = 19 -coordinates = [] - -coordinate = [0.0, 0.0, 0.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [0.0, 0.0, 1.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [2.0, 0.0, 1.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [0.0, 2.0, 1.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [-2.0, 0.0, 1.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [0.0, -2.0, 1.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [1.0, 1.0, 2.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [-1.0, 1.0, 2.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [-1.0, -1.0, 2.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [1.0, -1.0, 2.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [1.0, 1.0, 3.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [-1.0, 1.0, 3.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [-1.0, -1.0, 3.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [1.0, -1.0, 3.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [1.0, 1.0, 4.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [-1.0, 1.0, 4.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [-1.0, -1.0, 4.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [1.0, -1.0, 4.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) -coordinate = [0.0, 0.0, 5.0] -coordinates.append(coordinate[0]) -coordinates.append(coordinate[1]) -coordinates.append(coordinate[2]) +coordinates = [ + 0.0, 0.0, 0.0 , + 0.0, 0.0, 1.0 , + 2.0, 0.0, 1.0 , + 0.0, 2.0, 1.0 , + -2.0, 0.0, 1.0 , + 0.0, -2.0, 1.0 , + 1.0, 1.0, 2.0 , + -1.0, 1.0, 2.0 , + -1.0, -1.0, 2.0, + 1.0, -1.0, 2.0 , + 1.0, 1.0, 3.0 , + -1.0, 1.0, 3.0 , + -1.0, -1.0, 3.0, + 1.0, -1.0, 3.0 , + 1.0, 1.0, 4.0 , + -1.0, 1.0, 4.0 , + -1.0, -1.0, 4.0, + 1.0, -1.0, 4.0 , + 0.0, 0.0, 5.0] myMeshing.setCoordinates(spaceDimension,numberOfNodes,coordinates,"CARTESIAN",MED_FULL_INTERLACE) @@ -151,121 +93,46 @@ entity = MED_CELL types = [] numberOfElements = [] -types.append(MED_TETRA4) +types.append(MEDMEM_TETRA4) numberOfElements.append(12) -types.append(MED_PYRA5) +types.append(MEDMEM_PYRA5) numberOfElements.append(2) -types.append(MED_HEXA8) +types.append(MEDMEM_HEXA8) numberOfElements.append(2) myMeshing.setNumberOfTypes(numberOfTypes,entity) myMeshing.setTypes(types,entity) myMeshing.setNumberOfElements(numberOfElements,entity) -connectivityTetra = [] - -connectivity = [1,2,3,6] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [1,2,4,3] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [1,2,5,4] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [1,2,6,5] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [2,7,4,3] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [2,8,5,4] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [2,9,6,5] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [2,10,3,6] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [2,7,3,10] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [2,8,4,7] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [2,9,5,8] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) -connectivity = [2,10,6,9] -connectivityTetra.append(connectivity[0]) -connectivityTetra.append(connectivity[1]) -connectivityTetra.append(connectivity[2]) -connectivityTetra.append(connectivity[3]) - -myMeshing.setConnectivity(connectivityTetra,entity,types[0]) - -connectivityPyra = [] -connectivity = [7,8,9,10,2] -connectivityPyra.append(connectivity[0]) -connectivityPyra.append(connectivity[1]) -connectivityPyra.append(connectivity[2]) -connectivityPyra.append(connectivity[3]) -connectivityPyra.append(connectivity[4]) -connectivity = [15,18,17,16,19] -connectivityPyra.append(connectivity[0]) -connectivityPyra.append(connectivity[1]) -connectivityPyra.append(connectivity[2]) -connectivityPyra.append(connectivity[3]) -connectivityPyra.append(connectivity[4]) - -myMeshing.setConnectivity(connectivityPyra,entity,types[1]) - -connectivityHexa = [] -connectivity = [11,12,13,14,7,8,9,10] -connectivityHexa.append(connectivity[0]) -connectivityHexa.append(connectivity[1]) -connectivityHexa.append(connectivity[2]) -connectivityHexa.append(connectivity[3]) -connectivityHexa.append(connectivity[4]) -connectivityHexa.append(connectivity[5]) -connectivityHexa.append(connectivity[6]) -connectivityHexa.append(connectivity[7]) -connectivity = [15,16,17,18,11,12,13,14] -connectivityHexa.append(connectivity[0]) -connectivityHexa.append(connectivity[1]) -connectivityHexa.append(connectivity[2]) -connectivityHexa.append(connectivity[3]) -connectivityHexa.append(connectivity[4]) -connectivityHexa.append(connectivity[5]) -connectivityHexa.append(connectivity[6]) -connectivityHexa.append(connectivity[7]) - -myMeshing.setConnectivity(connectivityHexa,entity,types[2]) +connectivityTetra = [ + 1,2,3,6 , + 1,2,4,3 , + 1,2,5,4 , + 1,2,6,5 , + 2,7,4,3 , + 2,8,5,4 , + 2,9,6,5 , + 2,10,3,6, + 2,7,3,10, + 2,8,4,7 , + 2,9,5,8 , + 2,10,6,9] + +myMeshing.setConnectivity(entity,types[0],connectivityTetra) + +connectivityPyra = [ + 7,8,9,10,2, + 15,18,17,16,19] + +myMeshing.setConnectivity(entity,types[1],connectivityPyra) + +connectivityHexa = [ + 11,12,13,14,7,8,9,10, + 15,16,17,18,11,12,13,14] + +myMeshing.setConnectivity(entity,types[2],connectivityPyra) # face part @@ -275,62 +142,31 @@ entity = MED_FACE types = [] numberOfElements = [] -types.append(MED_TRIA3) +types.append(MEDMEM_TRIA3) numberOfElements.append(4) -types.append(MED_QUAD4) +types.append(MEDMEM_QUAD4) numberOfElements.append(4) myMeshing.setNumberOfTypes(numberOfTypes,entity) myMeshing.setTypes(types,entity) myMeshing.setNumberOfElements(numberOfElements,entity) -connectivityTria = [] -connectivity = [1,4,3] -connectivityTria.append(connectivity[0]) -connectivityTria.append(connectivity[1]) -connectivityTria.append(connectivity[2]) -connectivity = [1,5,4] -connectivityTria.append(connectivity[0]) -connectivityTria.append(connectivity[1]) -connectivityTria.append(connectivity[2]) -connectivity = [1,6,5] -connectivityTria.append(connectivity[0]) -connectivityTria.append(connectivity[1]) -connectivityTria.append(connectivity[2]) -connectivity = [1,3,6] -connectivityTria.append(connectivity[0]) -connectivityTria.append(connectivity[1]) -connectivityTria.append(connectivity[2]) - -myMeshing.setConnectivity(connectivityTria,entity,types[0]) - -connectivityQuad = [] -connectivity = [7,8,9,10] -connectivityQuad.append(connectivity[0]) -connectivityQuad.append(connectivity[1]) -connectivityQuad.append(connectivity[2]) -connectivityQuad.append(connectivity[3]) -connectivity = [11,12,13,14] -connectivityQuad.append(connectivity[0]) -connectivityQuad.append(connectivity[1]) -connectivityQuad.append(connectivity[2]) -connectivityQuad.append(connectivity[3]) -connectivity = [11,7,8,12] -connectivityQuad.append(connectivity[0]) -connectivityQuad.append(connectivity[1]) -connectivityQuad.append(connectivity[2]) -connectivityQuad.append(connectivity[3]) -connectivity = [12,8,9,13] -connectivityQuad.append(connectivity[0]) -connectivityQuad.append(connectivity[1]) -connectivityQuad.append(connectivity[2]) -connectivityQuad.append(connectivity[3]) - -myMeshing.setConnectivity(connectivityQuad,entity,types[1]) - -meshDimension = spaceDimension # because there 3D cells in the mesh -myMeshing.setMeshDimension(meshDimension) +connectivityTria = [ + 1,4,3, + 1,5,4, + 1,6,5, + 1,3,6] + +myMeshing.setConnectivity(entity,types[0],connectivityPyra) + +connectivityQuad = [ + 7,8,9,10 , + 11,12,13,14, + 11,7,8,12 , + 12,8,9,13] + +myMeshing.setConnectivity(entity,types[1],connectivityQuad) # edge part @@ -343,7 +179,7 @@ myGroup.setMesh(myMeshing) myGroup.setEntity(MED_NODE) myGroup.setNumberOfGeometricType(1) -myTypes = [MED_NONE] +myTypes = [MEDMEM_NONE] myGroup.setGeometricType(myTypes) myNumberOfElements = [4] @@ -361,7 +197,7 @@ myGroup.setMesh(myMeshing) myGroup.setEntity(MED_NODE) myGroup.setNumberOfGeometricType(1) -myTypes = [MED_NONE] +myTypes = [MEDMEM_NONE] myGroup.setGeometricType(myTypes) myNumberOfElements = [3] @@ -381,7 +217,7 @@ myGroup.setMesh(myMeshing) myGroup.setEntity(MED_CELL) myGroup.setNumberOfGeometricType(3) -myTypes = [MED_TETRA4,MED_PYRA5,MED_HEXA8] +myTypes = [MEDMEM_TETRA4,MEDMEM_PYRA5,MEDMEM_HEXA8] myGroup.setGeometricType(myTypes) myNumberOfElements = [4,1,2] @@ -403,7 +239,7 @@ myGroup.setMesh(myMeshing) myGroup.setEntity(MED_CELL) myGroup.setNumberOfGeometricType(2) -myTypes = [MED_TETRA4,MED_PYRA5] +myTypes = [MEDMEM_TETRA4,MEDMEM_PYRA5] myGroup.setGeometricType(myTypes) myNumberOfElements = [4,1] @@ -426,7 +262,7 @@ myGroup.setMesh(myMeshing) myGroup.setEntity(MED_FACE) myGroup.setNumberOfGeometricType(2) -myTypes = [MED_TRIA3,MED_QUAD4] +myTypes = [MEDMEM_TRIA3,MEDMEM_QUAD4] myGroup.setGeometricType(myTypes) myNumberOfElements = [2,3] @@ -447,7 +283,7 @@ myGroup.setMesh(myMeshing) myGroup.setEntity(MED_FACE) myGroup.setNumberOfGeometricType(1) -myTypes = [MED_TRIA3] +myTypes = [MEDMEM_TRIA3] myGroup.setGeometricType(myTypes) myNumberOfElements = [2] @@ -461,36 +297,21 @@ myGroup.setNumber(index,values) myMeshing.addGroup(myGroup) -# saving of the generated mesh in MED 2.1, 2.2 and VTK format +# saving of the generated mesh in MED and VTK format -medFileVersion = getMedFileVersionForWriting() -print "Med File Version For Writing ",medFileVersion +myMeshing.write(MED_DRIVER,med22FileName) -if (medFileVersion == V22): - setMedFileVersionForWriting(V21) - -idMedV21 = myMeshing.addDriver(MED_DRIVER,med21FileName,myMeshing.getName()) -myMeshing.write(idMedV21) - -medFileVersion = getMedFileVersionForWriting() -if (medFileVersion == V21): - setMedFileVersionForWriting(V22) - -idMedV22 = myMeshing.addDriver(MED_DRIVER,med22FileName,myMeshing.getName()) -myMeshing.write(idMedV22) - -idVtk = myMeshing.addDriver(VTK_DRIVER,vtkFileName,myMeshing.getName()) -myMeshing.write(idVtk) +myMeshing.write(VTK_DRIVER,vtkFileName) # we build now 8 fields : 4 fields double (integer) : # 2 fields on nodes (cells) : # 1 scalar (vector) -supportOnNodes = myMeshing.getSupportOnAll(MED_NODE) -numberOfNodes = supportOnNodes.getNumberOfElements(MED_ALL_ELEMENTS) +supportOnNodes = SUPPORT(myMeshing,"On_All_Nodes",MED_NODE) +numberOfNodes = supportOnNodes.getNumberOfElements(MEDMEM_ALL_ELEMENTS) -supportOnCells = myMeshing.getSupportOnAll(MED_CELL) -numberOfCells = supportOnCells.getNumberOfElements(MED_ALL_ELEMENTS) +supportOnCells = SUPPORT(myMeshing,"On_All_Cells",MED_CELL) +numberOfCells = supportOnCells.getNumberOfElements(MEDMEM_ALL_ELEMENTS) fieldDoubleScalarOnNodes = FIELDDOUBLE(supportOnNodes,1) fieldDoubleScalarOnNodes.setName("fieldScalarDoubleNode") @@ -634,63 +455,14 @@ for i in range(numberOfCells): fieldIntVectorOnCells.setValueIJ(i+1,2,valueInt2) fieldIntVectorOnCells.setValueIJ(i+1,3,valueInt3) -medFileVersion = getMedFileVersionForWriting() -print "Med File Version For Writing ",medFileVersion - -if (medFileVersion == V22): - setMedFileVersionForWriting(V21) - -idMedV21 = fieldDoubleScalarOnNodes.addDriver(MED_DRIVER,med21FileName,fieldDoubleScalarOnNodes.getName()) -fieldDoubleScalarOnNodes.write(idMedV21) - -idMedV21 = fieldIntScalarOnNodes.addDriver(MED_DRIVER,med21FileName,fieldIntScalarOnNodes.getName()) -fieldIntScalarOnNodes.write(idMedV21) - -idMedV21 = fieldDoubleVectorOnNodes.addDriver(MED_DRIVER,med21FileName,fieldDoubleVectorOnNodes.getName()) -fieldDoubleVectorOnNodes.write(idMedV21) - -idMedV21 = fieldIntVectorOnNodes.addDriver(MED_DRIVER,med21FileName,fieldIntVectorOnNodes.getName()) -fieldIntVectorOnNodes.write(idMedV21) - -idMedV21 = fieldDoubleScalarOnCells.addDriver(MED_DRIVER,med21FileName,fieldDoubleScalarOnCells.getName()) -fieldDoubleScalarOnCells.write(idMedV21) - -idMedV21 = fieldIntScalarOnCells.addDriver(MED_DRIVER,med21FileName,fieldIntScalarOnCells.getName()) -fieldIntScalarOnCells.write(idMedV21) - -idMedV21 = fieldDoubleVectorOnCells.addDriver(MED_DRIVER,med21FileName,fieldDoubleVectorOnCells.getName()) -fieldDoubleVectorOnCells.write(idMedV21) - -idMedV21 = fieldIntVectorOnCells.addDriver(MED_DRIVER,med21FileName,fieldIntVectorOnCells.getName()) -fieldIntVectorOnCells.write(idMedV21) - -medFileVersion = getMedFileVersionForWriting() -if (medFileVersion == V21): - setMedFileVersionForWriting(V22) - -idMedV22 = fieldDoubleScalarOnNodes.addDriver(MED_DRIVER,med22FileName,fieldDoubleScalarOnNodes.getName()) -fieldDoubleScalarOnNodes.write(idMedV22) - -idMedV22 = fieldIntScalarOnNodes.addDriver(MED_DRIVER,med22FileName,fieldIntScalarOnNodes.getName()) -fieldIntScalarOnNodes.write(idMedV22) - -idMedV22 = fieldDoubleVectorOnNodes.addDriver(MED_DRIVER,med22FileName,fieldDoubleVectorOnNodes.getName()) -fieldDoubleVectorOnNodes.write(idMedV22) - -idMedV22 = fieldIntVectorOnNodes.addDriver(MED_DRIVER,med22FileName,fieldIntVectorOnNodes.getName()) -fieldIntVectorOnNodes.write(idMedV22) - -idMedV22 = fieldDoubleScalarOnCells.addDriver(MED_DRIVER,med22FileName,fieldDoubleScalarOnCells.getName()) -fieldDoubleScalarOnCells.write(idMedV22) - -idMedV22 = fieldIntScalarOnCells.addDriver(MED_DRIVER,med22FileName,fieldIntScalarOnCells.getName()) -fieldIntScalarOnCells.write(idMedV22) - -idMedV22 = fieldDoubleVectorOnCells.addDriver(MED_DRIVER,med22FileName,fieldDoubleVectorOnCells.getName()) -fieldDoubleVectorOnCells.write(idMedV22) +fieldIntScalarOnNodes.write(MED_DRIVER,med21FileName) +fieldDoubleVectorOnNodes.write(MED_DRIVER,med21FileName) +fieldIntVectorOnNodes.write(MED_DRIVER,med21FileName) +fieldDoubleScalarOnCells.write(MED_DRIVER,med21FileName) +fieldIntScalarOnCells.write(MED_DRIVER,med21FileName) +fieldDoubleVectorOnCells.write(MED_DRIVER,med21FileName) +fieldIntVectorOnCells.addDriver(MED_DRIVER,med21FileName) -idMedV22 = fieldIntVectorOnCells.addDriver(MED_DRIVER,med22FileName,fieldIntVectorOnCells.getName()) -fieldIntVectorOnCells.write(idMedV22) idVtk = fieldDoubleScalarOnNodes.addDriver(VTK_DRIVER,vtkFileName,fieldDoubleScalarOnNodes.getName()) fieldDoubleScalarOnNodes.writeAppend(idVtk) diff --git a/doc/MEDMEM/MESHconnectivities.cxx b/doc/MEDMEM/MESHconnectivities.cxx index 389546240..8edffe2a2 100644 --- a/doc/MEDMEM/MESHconnectivities.cxx +++ b/doc/MEDMEM/MESHconnectivities.cxx @@ -25,16 +25,15 @@ using namespace MEDMEM ; using namespace MED_EN ; -int main (int argc, char ** argv) { - -// const string MedFile = "polyedres.med" ; -// const string MeshName = "Erreur orientation" ; -// const string MedFile = "polygones.med" ; -// const string MeshName = "Bord" ; +int main (int argc, char ** argv) +{ + // const string MedFile = "polyedres.med" ; + // const string MeshName = "Erreur orientation" ; + // const string MedFile = "polygones.med" ; + // const string MeshName = "Bord" ; const string MedFile = "pointe.med" ; const string MeshName = "maa1" ; MESH myMesh(MED_DRIVER,MedFile,MeshName) ; - myMesh.read() ; cout << "Mesh name : " << myMesh.getName() << endl << endl ; @@ -49,11 +48,7 @@ int main (int argc, char ** argv) { medGeometryElement myType = Types[i] ; int NumberOfElements = myMesh.getNumberOfElements(MED_CELL,myType); int NomberOfNodesPerCell = Types[i]%100 ; - const int * Connectivity = - myMesh.getConnectivity(MED_FULL_INTERLACE, - MED_NODAL, - MED_CELL, - myType); + const int * Connectivity = myMesh.getConnectivity(MED_NODAL,MED_CELL,myType); for (int j=0; j 0 ) - { - cout << "Show Connectivity (Nodal) of POLYGONS:" << endl ; - const int* Connectivity = myMesh.getPolygonsConnectivity(MED_NODAL,MED_CELL); - const int* ConnectivityIndex = myMesh.getPolygonsConnectivityIndex(MED_NODAL,MED_CELL); - for (int j=0; j 0 ) - { - cout << "Show Connectivity (Nodal) of POLYHEDRONS:" << endl ; - const int* Connectivity = myMesh.getPolyhedronConnectivity(MED_NODAL); - const int* FaceIndex = myMesh.getPolyhedronFacesIndex(); - const int* Index = myMesh.getPolyhedronIndex(MED_NODAL); - for (int j=0; j 0 : - print "" - print " Show Connectivity (Nodal) of POLYGONS:" - print "" - connectivity = myMesh.getPolygonsConnectivity(MED_NODAL,MED_CELL) - index = myMesh.getPolygonsConnectivityIndex(MED_NODAL,MED_CELL) - for j in range(nbPolygons): - print " Polygon",(j+1)," ",connectivity[ index[j]-1 : index[j+1]-1 ] - pass - pass - -nbPolyhedrons = myMesh.getNumberOfPolyhedron() -if nbPolyhedrons > 0 : - print "" - print " Show Connectivity (Nodal) of POLYHEDRONS:" - print "" - connectivity = myMesh.getPolyhedronConnectivity(MED_NODAL) - fIndex = myMesh.getPolyhedronFacesIndex() - index = myMesh.getPolyhedronIndex(MED_NODAL) - for j in range(nbPolyhedrons): - print " Polyhedra",(j+1) - iF1, iF2 = index[ j ]-1, index[ j+1 ]-1 - for f in range( iF2 - iF1 ): - iN1, iN2 = fIndex[ iF1+f ]-1, fIndex[ iF1+f+1 ]-1 - print " Face",f+1," ",connectivity[ iN1 : iN2 ] - pass - pass - pass diff --git a/doc/doxygen/figures/UML_light.png b/doc/doxygen/figures/UML_light.png index 8eff5fa9c..08ecacdbb 100644 Binary files a/doc/doxygen/figures/UML_light.png and b/doc/doxygen/figures/UML_light.png differ diff --git a/doc/doxygen/figures/UML_small.png b/doc/doxygen/figures/UML_small.png index 77109ab34..791728fa4 100644 Binary files a/doc/doxygen/figures/UML_small.png and b/doc/doxygen/figures/UML_small.png differ