From db35f3537e309b5b6681a4ae8d270afee833c188 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Tue, 1 Dec 2015 10:24:38 +0100 Subject: [PATCH] update doc and options --- medtool/CMakeLists.txt | 5 +- medtool/doc/tutorial/CMakeLists.txt | 9 +- medtool/doc/tutorial/conf.py.in | 4 +- .../doc/tutorial/medcoupling_umesh1_en.rst | 124 +++++++++--------- medtool/doc/user/doxygen/CMakeLists.txt | 33 +++-- medtool/doc/user/doxygen/Doxyfile_med_user.in | 8 +- .../doxygen/doxfiles/appendix/install.dox | 2 +- medtool/doc/user/doxygen/doxfiles/gui.dox | 6 +- medtool/doc/user/doxygen/doxfiles/index.dox | 14 +- .../user/doxygen/doxy2swig/doxy2swig.cmake | 24 ++-- .../doc/user/doxygen/static/header.html.in | 2 +- ...salome_extra.css => medcoupling_extra.css} | 0 .../ExprEval/InterpKernelExprParser.cxx | 6 +- medtool/src/MEDLoader/Swig/CaseWriter.py | 18 +-- .../ParaMEDMEMTest_NonCoincidentDEC.cxx | 88 ++++++------- .../ParaMEDMEM_Swig/test_InterpKernelDEC.py | 18 +-- .../ParaMEDMEM_Swig/test_NonCoincidentDEC.py | 10 +- .../test_StructuredCoincidentDEC.py | 16 +-- 18 files changed, 193 insertions(+), 194 deletions(-) rename medtool/doc/user/doxygen/static/{salome_extra.css => medcoupling_extra.css} (100%) diff --git a/medtool/CMakeLists.txt b/medtool/CMakeLists.txt index a640015e2..61a9cb333 100644 --- a/medtool/CMakeLists.txt +++ b/medtool/CMakeLists.txt @@ -78,7 +78,8 @@ IF(NOT MEDTOOL_MED_MICROMED) FIND_PACKAGE(XDR REQUIRED) ELSE(NOT WIN32) IF(MEDTOOL_MED_MEDLOADER_USE_XDR) - FIND_PACKAGE(SalomeXDR REQUIRED) + #FIND_PACKAGE(SalomeXDR REQUIRED) + FIND_PACKAGE(XDR REQUIRED) ENDIF(MEDTOOL_MED_MEDLOADER_USE_XDR) ENDIF(NOT WIN32) # End of XDR Stuff @@ -140,7 +141,7 @@ IF(MEDTOOL_MED_ENABLE_RENUMBER) SET(Boost_USE_MULTITHREADED ON) SET(Boost_USE_STATIC_RUNTIME OFF) SET(Boost_NO_BOOST_CMAKE ON) - SET(SalomeBoost_FIND_COMPONENTS filesystem regex signals system thread date_time chrono) + #SET(SalomeBoost_FIND_COMPONENTS filesystem regex signals system thread date_time chrono) FIND_PACKAGE(Boost) ENDIF(MEDTOOL_MED_ENABLE_RENUMBER) diff --git a/medtool/doc/tutorial/CMakeLists.txt b/medtool/doc/tutorial/CMakeLists.txt index 5cc2cb60a..d7110e393 100644 --- a/medtool/doc/tutorial/CMakeLists.txt +++ b/medtool/doc/tutorial/CMakeLists.txt @@ -17,18 +17,17 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SALOME_CONFIGURE_FILE(conf.py.in conf.py) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py) SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} html) -SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}") ADD_CUSTOM_TARGET(tutorial_doc COMMAND ${_cmd}) ADD_DEPENDENCIES(usr_docs tutorial_doc) #INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target tutorial_doc)") -INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${SALOME_INSTALL_DOC}/gui/MED/tutorial) -INSTALL(DIRECTORY images/ DESTINATION ${SALOME_INSTALL_DOC}/gui/MED/tutorial/images) -INSTALL(DIRECTORY data/ DESTINATION ${SALOME_INSTALL_DOC}/gui/MED/tutorial/data) +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${MEDTOOL_INSTALL_DOC}/gui/MED/tutorial) +INSTALL(DIRECTORY images/ DESTINATION ${MEDTOOL_INSTALL_DOC}/gui/MED/tutorial/images) +INSTALL(DIRECTORY data/ DESTINATION ${MEDTOOL_INSTALL_DOC}/gui/MED/tutorial/data) SET(make_clean_files html doctrees) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}") diff --git a/medtool/doc/tutorial/conf.py.in b/medtool/doc/tutorial/conf.py.in index 420f4006b..0b0bad675 100644 --- a/medtool/doc/tutorial/conf.py.in +++ b/medtool/doc/tutorial/conf.py.in @@ -46,9 +46,9 @@ copyright = u'2015, Geay, Bruneton' # built documents. # # The short X.Y version. -version = '@SALOMEMED_VERSION@' +version = '@MEDTOOL_VERSION@' # The full version, including alpha/beta/rc tags. -release = '@SALOMEMED_VERSION@' +release = '@MEDTOOL_VERSION@' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/medtool/doc/tutorial/medcoupling_umesh1_en.rst b/medtool/doc/tutorial/medcoupling_umesh1_en.rst index 62d39c88d..c7c319f39 100644 --- a/medtool/doc/tutorial/medcoupling_umesh1_en.rst +++ b/medtool/doc/tutorial/medcoupling_umesh1_en.rst @@ -2,7 +2,7 @@ Playing with unstructured mesh ------------------------------ -Unstructured meshes are the most used mesh type. MEDCouplingUMesh is the name of the class representing unstuctured meshes in MEDCoupling. MEDCouplingUMesh inherits from the MEDCouplingPointSet class that deals with all methods handling coordinates only. +Unstructured meshes are the most used mesh type. MEDCouplingUMesh is the name of the class representing unstuctured meshes in MEDCoupling. MEDCouplingUMesh inherits from the MEDCouplingPointSet class that deals with all methods handling coordinates only. MEDCouplingUMesh adds two more attributes : * nodal connectivity * nodal connectivity index @@ -25,13 +25,13 @@ Implementation start Import the MEDCoupling Python module. :: - from MEDCoupling import * + from MEDCoupling import * We now build a mesh containing artificially two types of cell (NORM_HEXA8 and NORM_POLYHED) to highlight the possibility to work with non-homogeneous cell types. mesh3D is an extruded mesh containing 18 cells composed into 3 levels along Z of 6 cells. Copy paste the following lines. :: - coords=[0.,0.,0., 1.,1.,0., 1.,1.25,0., 1.,0.,0., 1.,1.5,0., 2.,0.,0., 2.,1.,0., 1.,2.,0., 0.,2.,0., 3.,1.,0., + coords=[0.,0.,0., 1.,1.,0., 1.,1.25,0., 1.,0.,0., 1.,1.5,0., 2.,0.,0., 2.,1.,0., 1.,2.,0., 0.,2.,0., 3.,1.,0., 3.,2.,0., 0.,1.,0., 1.,3.,0., 2.,2.,0., 2.,3.,0., 0.,0.,1., 1.,1.,1., 1.,1.25,1., 1.,0.,1., 1.,1.5,1., 2.,0.,1., 2.,1.,1., 1.,2.,1., 0.,2.,1., 3.,1.,1., 3.,2.,1., 0.,1.,1., 1.,3.,1., 2.,2.,1., 2.,3.,1., @@ -39,34 +39,34 @@ Copy paste the following lines. :: 3.,2.,2., 0.,1.,2., 1.,3.,2., 2.,2.,2., 2.,3.,2., 0.,0.,3., 1.,1.,3., 1.,1.25,3., 1.,0.,3., 1.,1.5,3., 2.,0.,3., 2.,1.,3., 1.,2.,3., 0.,2.,3., 3.,1.,3., 3.,2.,3., 0.,1.,3., 1.,3.,3., 2.,2.,3., 2.,3.,3.] - conn=[0,11,1,3,15,26,16,18, 1,2,4,7,13,6,-1,1,16,21,6,-1,6,21,28,13,-1,13,7,22,28,-1,7,4,19,22,-1,4,2,17,19,-1,2,1,16,17,-1,16,21,28,22,19,17, + conn=[0,11,1,3,15,26,16,18, 1,2,4,7,13,6,-1,1,16,21,6,-1,6,21,28,13,-1,13,7,22,28,-1,7,4,19,22,-1,4,2,17,19,-1,2,1,16,17,-1,16,21,28,22,19,17, 1,6,5,3,16,21,20,18, 13,10,9,6,28,25,24,21, 11,8,7,4,2,1,-1,11,26,16,1,-1,1,16,17,2,-1,2,17,19,4,-1,4,19,22,7,-1,7,8,23,22,-1,8,11,26,23,-1,26,16,17,19,22,23, 7,12,14,13,22,27,29,28, 15,26,16,18,30,41,31,33, 16,17,19,22,28,21,-1,16,31,36,21,-1,21,36,43,28,-1,28,22,37,43,-1,22,19,34,37,-1,19,17,32,34,-1,17,16,31,32,-1,31,36,43,37,34,32, 16,21,20,18,31,36,35,33, 28,25,24,21,43,40,39,36, 26,23,22,19,17,16,-1,26,41,31,16,-1,16,31,32,17,-1,17,32,34,19,-1,19,34,37,22,-1,22,23,38,37,-1,23,26,41,38,-1,41,31,32,34,37,38, 22,27,29,28,37,42,44,43, 30,41,31,33,45,56,46,48, 31,32,34,37,43,36,-1,31,46,51,36,-1,36,51,58,43,-1,43,37,52,58,-1,37,34,49,52,-1,34,32,47,49,-1,32,31,46,47,-1,46,51,58,52,49,47, 31,36,35,33,46,51,50,48, 43,40,39,36,58,55,54,51, 41,38,37,34,32,31,-1,41,56,46,31,-1,31,46,47,32,-1,32,47,49,34,-1,34,49,52,37,-1,37,38,53,52,-1,38,41,56,53,-1,56,46,47,49,52,53, 37,42,44,43,52,57,59,58] - mesh3D=MEDCouplingUMesh.New("mesh3D",3) - mesh3D.allocateCells(18) - mesh3D.insertNextCell(NORM_HEXA8,conn[0:8]); mesh3D.insertNextCell(NORM_POLYHED,conn[8:51]); mesh3D.insertNextCell(NORM_HEXA8,conn[51:59]); mesh3D.insertNextCell(NORM_HEXA8,conn[59:67]); mesh3D.insertNextCell(NORM_POLYHED,conn[67:110]); mesh3D.insertNextCell(NORM_HEXA8,conn[110:118]); - mesh3D.insertNextCell(NORM_HEXA8,conn[118:126]); mesh3D.insertNextCell(NORM_POLYHED,conn[126:169]); mesh3D.insertNextCell(NORM_HEXA8,conn[169:177]); mesh3D.insertNextCell(NORM_HEXA8,conn[177:185]); mesh3D.insertNextCell(NORM_POLYHED,conn[185:228]); mesh3D.insertNextCell(NORM_HEXA8,conn[228:236]); - mesh3D.insertNextCell(NORM_HEXA8,conn[236:244]); mesh3D.insertNextCell(NORM_POLYHED,conn[244:287]); mesh3D.insertNextCell(NORM_HEXA8,conn[287:295]); mesh3D.insertNextCell(NORM_HEXA8,conn[295:303]); mesh3D.insertNextCell(NORM_POLYHED,conn[303:346]); mesh3D.insertNextCell(NORM_HEXA8,conn[346:354]); - myCoords=DataArrayDouble.New(coords,60,3) - myCoords.setInfoOnComponents(["X [m]","Y [m]","Z [m]"]) - mesh3D.setCoords(myCoords) - mesh3D.orientCorrectlyPolyhedrons() - mesh3D.sortCellsInMEDFileFrmt() - mesh3D.checkCoherency() - renum=DataArrayInt.New(60) ; renum[:15]=range(15,30) ; renum[15:30]=range(15) ; renum[30:45]=range(45,60) ; renum[45:]=range(30,45) - mesh3D.renumberNodes(renum,60) - + mesh3D=MEDCouplingUMesh.New("mesh3D",3) + mesh3D.allocateCells(18) + mesh3D.insertNextCell(NORM_HEXA8,conn[0:8]); mesh3D.insertNextCell(NORM_POLYHED,conn[8:51]); mesh3D.insertNextCell(NORM_HEXA8,conn[51:59]); mesh3D.insertNextCell(NORM_HEXA8,conn[59:67]); mesh3D.insertNextCell(NORM_POLYHED,conn[67:110]); mesh3D.insertNextCell(NORM_HEXA8,conn[110:118]); + mesh3D.insertNextCell(NORM_HEXA8,conn[118:126]); mesh3D.insertNextCell(NORM_POLYHED,conn[126:169]); mesh3D.insertNextCell(NORM_HEXA8,conn[169:177]); mesh3D.insertNextCell(NORM_HEXA8,conn[177:185]); mesh3D.insertNextCell(NORM_POLYHED,conn[185:228]); mesh3D.insertNextCell(NORM_HEXA8,conn[228:236]); + mesh3D.insertNextCell(NORM_HEXA8,conn[236:244]); mesh3D.insertNextCell(NORM_POLYHED,conn[244:287]); mesh3D.insertNextCell(NORM_HEXA8,conn[287:295]); mesh3D.insertNextCell(NORM_HEXA8,conn[295:303]); mesh3D.insertNextCell(NORM_POLYHED,conn[303:346]); mesh3D.insertNextCell(NORM_HEXA8,conn[346:354]); + myCoords=DataArrayDouble.New(coords,60,3) + myCoords.setInfoOnComponents(["X [m]","Y [m]","Z [m]"]) + mesh3D.setCoords(myCoords) + mesh3D.orientCorrectlyPolyhedrons() + mesh3D.sortCellsInMEDFileFrmt() + mesh3D.checkCoherency() + renum=DataArrayInt.New(60) ; renum[:15]=range(15,30) ; renum[15:30]=range(15) ; renum[30:45]=range(45,60) ; renum[45:]=range(30,45) + mesh3D.renumberNodes(renum,60) + Convert coordinate unit from meters to centimeters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It might seem stupid, but this comes up regularly when coupling... :: - mesh3D.getCoords()[:]*=100. - mesh3D.getCoords().setInfoOnComponents(["X [cm]","Y [cm]","Z [cm]"]) + mesh3D.getCoords()[:]*=100. + mesh3D.getCoords().setInfoOnComponents(["X [cm]","Y [cm]","Z [cm]"]) .. note:: It is important to keep the DataArrayDouble instance up-to-date about the physical units to avoid ambiguity. The INTERP_KERNEL library includes a physical unit processor. @@ -75,9 +75,9 @@ Find the different Z levels in mesh3D and sort in increasing order DataArrayDouble.getDifferentValues and DataArrayDouble.sort can help you! :: - zLev=mesh3D.getCoords()[:,2] - zLev=zLev.getDifferentValues(1e-12) - zLev.sort() + zLev=mesh3D.getCoords()[:,2] + zLev=zLev.getDifferentValues(1e-12) + zLev.sort() Extract the 6 cells of the second row along Oz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -90,16 +90,16 @@ Simple method but a little costly. To do that simply define a plane having direc going through point [0.,0.,(zLev[1]+zLev[2])/2]. This method retrieves 2 things : the slicemesh containing the result slicing mesh3D and foreach 2D cell in slicemesh, the corresponding cell id into mesh3D. :: - tmp,cellIdsSol1=mesh3D.buildSlice3D([0.,0.,(zLev[1]+zLev[2])/2],[0.,0.,1.],1e-12) + tmp,cellIdsSol1=mesh3D.buildSlice3D([0.,0.,(zLev[1]+zLev[2])/2],[0.,0.,1.],1e-12) -* Using Barycenter of cells of mesh3D : +* Using Barycenter of cells of mesh3D : Firstly, compute the barycenters of the 3D cells. Then select the 2nd component of the barycenter of the cells. Finally select the tuple ids (corresponding to cell ids) falling in the range [zLev[1],zLev[2]]. :: - bary=mesh3D.getBarycenterAndOwner() - baryZ=bary[:,2] - cellIdsSol2=baryZ.getIdsInRange(zLev[1],zLev[2]) + bary=mesh3D.getBarycenterAndOwner() + baryZ=bary[:,2] + cellIdsSol2=baryZ.getIdsInRange(zLev[1],zLev[2]) * Using MEDCouplingExtrudedMesh : @@ -109,45 +109,45 @@ lying on the same coordinates, from which the extrusion will be computed. Let's begin with the build of the 2D mesh. We build it from all the nodes on a plane going through point [0.,0.,zLev[0]] and with normal vector [0.,0.,1.] (MEDCouplingUMesh.findNodesOnPlane()). Then invoke MEDCouplingUMesh.buildFacePartOfMySelfNode to build mesh2D (read the documentation of buildFacePartOfMySelfNode()). :: - nodeIds=mesh3D.findNodesOnPlane([0.,0.,zLev[0]],[0.,0.,1.],1e-10) - mesh2D=mesh3D.buildFacePartOfMySelfNode(nodeIds,True) + nodeIds=mesh3D.findNodesOnPlane([0.,0.,zLev[0]],[0.,0.,1.],1e-10) + mesh2D=mesh3D.buildFacePartOfMySelfNode(nodeIds,True) Then it is possible to compute an extrusion from mesh3D and mesh2D. :: - extMesh=MEDCouplingExtrudedMesh.New(mesh3D,mesh2D,0) + extMesh=MEDCouplingExtrudedMesh.New(mesh3D,mesh2D,0) Then simply request the 2nd row. :: - cellIdsSol3=extMesh.getMesh3DIds()[mesh2D.getNumberOfCells():2*mesh2D.getNumberOfCells()] + cellIdsSol3=extMesh.getMesh3DIds()[mesh2D.getNumberOfCells():2*mesh2D.getNumberOfCells()] It is now possible to check that the 3 solutions are the same : :: - for i in xrange(3): - exec("print cellIdsSol%s.getValues()"%(i+1)) + for i in xrange(3): + exec("print cellIdsSol%s.getValues()"%(i+1)) Extract a sub-part of mesh3D ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Use the previously retrieved cell ids in cellIdsSol2 to compute a sub-part of mesh3D. :: - mesh3DPart=mesh3D[cellIdsSol2] # equivalent to mesh3DPart=mesh3D.buildPartOfMySelf(cellIdsSol2,True) + mesh3DPart=mesh3D[cellIdsSol2] # equivalent to mesh3DPart=mesh3D.buildPartOfMySelf(cellIdsSol2,True) .. note:: The geometrical type doesn't play any role here. "mesh3DPart" now contains len(cellIdsSol2) cells. The cell #0 in "mesh3DPart" corresponds to the cell #cellIdsSol2[0] in "mesh3D" and so on ... "cellIdsSol2" can thus be seen as an array "new-to-old". At this point, "mesh3DPart" lies on the same coordinates, so mesh3DPart has 60 nodes whereas only 30 are necessary. To zip the orphan nodes in "mesh3DPart", simply invoke zipCoords(): :: - mesh3DPart.zipCoords() + mesh3DPart.zipCoords() At this point mesh3DPart only contains 30 nodes and 6 cells. To prepare to MED file I/O we have to check if mesh3DPart is ready to be written safely into a MED file (i.e. if the cells are indeed ordered by type). :: - print mesh3DPart.checkConsecutiveCellTypesAndOrder([NORM_HEXA8,NORM_POLYHED]) + print mesh3DPart.checkConsecutiveCellTypesAndOrder([NORM_HEXA8,NORM_POLYHED]) Or: :: - print mesh3DPart.checkConsecutiveCellTypes() + print mesh3DPart.checkConsecutiveCellTypes() You can also print the content of the mesh "mesh3Dpart": :: - print mesh3DPart.advancedRepr() + print mesh3DPart.advancedRepr() We see that mesh3DPart contains 6 cells, 4 HEXA8 then 2 POLYHED. Everything's OK: the cells are grouped by geometrical type. @@ -156,26 +156,26 @@ Extract the 3 cells in mesh3D whose barycenters are along the line (pt=[250.,150 There are 2 solutions to do that. -* using the barycenters of mesh3D again: same principle than above. :: +* using the barycenters of mesh3D again: same principle than above. :: - baryXY=bary[:,[0,1]] - baryXY-=[250.,150.] - magn=baryXY.magnitude() - cellIds2Sol1=magn.getIdsInRange(0.,1e-12) + baryXY=bary[:,[0,1]] + baryXY-=[250.,150.] + magn=baryXY.magnitude() + cellIds2Sol1=magn.getIdsInRange(0.,1e-12) * using extrusion extMesh: starting from the unique cell in mesh2D whose center is at [250.,150.,0.] MEDCouplingExtrudedMesh.getMesh3DIds retrieves the cell IDs sorted by slice. :: - bary2=mesh2D.getBarycenterAndOwner()[:,[0,1]] - bary2-=[250.,150.] - magn=bary2.magnitude() - ids=magn.getIdsInRange(0.,1e-12) - idStart=int(ids) # ids is assumed to contain only one value, if not an exception is thrown - cellIds2Sol2=extMesh.getMesh3DIds()[range(idStart,mesh3D.getNumberOfCells(),mesh2D.getNumberOfCells())] + bary2=mesh2D.getBarycenterAndOwner()[:,[0,1]] + bary2-=[250.,150.] + magn=bary2.magnitude() + ids=magn.getIdsInRange(0.,1e-12) + idStart=int(ids) # ids is assumed to contain only one value, if not an exception is thrown + cellIds2Sol2=extMesh.getMesh3DIds()[range(idStart,mesh3D.getNumberOfCells(),mesh2D.getNumberOfCells())] Now, build the sub-part of mesh3D using cell IDs in cellIds2Sol1. :: - mesh3DSlice2=mesh3D[cellIds2Sol1] - mesh3DSlice2.zipCoords() + mesh3DSlice2=mesh3D[cellIds2Sol1] + mesh3DSlice2.zipCoords() Duplicate "mesh3DSlice2" and translate it ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,11 +185,11 @@ This part of the exercise shows how to perform copy and aggregation. This can be Perform a deep copy of mesh3DSlice2. On this copy perform a translation v=[0.,1000.,0.]. Then aggregate mesh3DSlice2 with its translated copy, using MEDCouplingUMesh.MergeUMeshes. :: - mesh3DSlice2bis=mesh3DSlice2.deepCpy() - mesh3DSlice2bis.translate([0.,1000.,0.]) - mesh3DSlice2All=MEDCouplingUMesh.MergeUMeshes([mesh3DSlice2,mesh3DSlice2bis]) + mesh3DSlice2bis=mesh3DSlice2.deepCpy() + mesh3DSlice2bis.translate([0.,1000.,0.]) + mesh3DSlice2All=MEDCouplingUMesh.MergeUMeshes([mesh3DSlice2,mesh3DSlice2bis]) -.. note:: My apologies for the name of the method MEDCouplingUMesh.MergeUMeshes. In Salome 7 it will be called AggregateUMeshes. For information, to merge two (or more) unstructured meshes, one has to invoke MergeUMeshes(), then mergeNodes() on the result, and finally zipConnectivity(). +.. note:: My apologies for the name of the method MEDCouplingUMesh.MergeUMeshes. In future version it will be called AggregateUMeshes. For information, to merge two (or more) unstructured meshes, one has to invoke MergeUMeshes(), then mergeNodes() on the result, and finally zipConnectivity(). Descending connectivity @@ -201,12 +201,12 @@ The method MEDCoupling.buildDescendingConnectivity builds this mesh and also ret A face from "mesh3DSurf" is said to be internal if and only if it is shared by more than one 3D cell in "mesh3D" (see reverse descending connectivity (out parameter 3 et 4)). :: - mesh3DSurf,desc,descIndx,revDesc,revDescIndx=mesh3D.buildDescendingConnectivity() - numberOf3DCellSharing=revDescIndx.deltaShiftIndex() - cellIds=numberOf3DCellSharing.getIdsNotEqual(1) - mesh3DSurfInside=mesh3DSurf[cellIds] - mesh3DSurfInside.writeVTK("mesh3DSurfInside.vtu") - + mesh3DSurf,desc,descIndx,revDesc,revDescIndx=mesh3D.buildDescendingConnectivity() + numberOf3DCellSharing=revDescIndx.deltaShiftIndex() + cellIds=numberOf3DCellSharing.getIdsNotEqual(1) + mesh3DSurfInside=mesh3DSurf[cellIds] + mesh3DSurfInside.writeVTK("mesh3DSurfInside.vtu") + .. image:: images/mesh3DSurfInside.jpg Solution diff --git a/medtool/doc/user/doxygen/CMakeLists.txt b/medtool/doc/user/doxygen/CMakeLists.txt index 2b5209f9c..1cd560449 100644 --- a/medtool/doc/user/doxygen/CMakeLists.txt +++ b/medtool/doc/user/doxygen/CMakeLists.txt @@ -17,17 +17,16 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SALOME_CONFIGURE_FILE(Doxyfile_med_user.in Doxyfile_med_user) -SALOME_CONFIGURE_FILE(static/header.html.in static/header.html) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile_med_user.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_med_user) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html) - -IF(SALOME_MED_ENABLE_PYTHON) - INCLUDE(doxy2swig/doxy2swig.cmake) +IF(MEDTOOL_MED_ENABLE_PYTHON) + INCLUDE(doxy2swig/doxy2swig.cmake) FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/tmp/medcouplingexamples.in" input) FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/BuildPyExamplesFromCPP.py" pythondocexamplesgenerator) FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" output) - + # :TRICKY: For ease of maintenance, documentation for code examples is # splitted in several files. We here splice to a single file before running # Doxygen. @@ -63,14 +62,14 @@ IF(SALOME_MED_ENABLE_PYTHON) VERBATIM WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - + # Create dummy target gathering the generation of all .i files: ADD_CUSTOM_TARGET(swig_ready) ADD_DEPENDENCIES(swig_ready usr_docs) - - SALOME_MED_SWIG_DOCSTRING_CONFIGURE(usr_docs swig_ready MEDCoupling) - SALOME_MED_SWIG_DOCSTRING_CONFIGURE(usr_docs swig_ready MEDLoader) - + + MEDTOOL_MED_SWIG_DOCSTRING_CONFIGURE(usr_docs swig_ready MEDCoupling) + MEDTOOL_MED_SWIG_DOCSTRING_CONFIGURE(usr_docs swig_ready MEDLoader) + SET(doxyfile_med_user ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_med_user) FILE(STRINGS ${doxyfile_med_user} enabled_sections REGEX "ENABLED_SECTIONS") IF(enabled_sections) @@ -78,13 +77,13 @@ IF(SALOME_MED_ENABLE_PYTHON) STRING(REPLACE ${enabled_sections} "${enabled_sections} ENABLE_EXAMPLES" new_doxy_file ${doxy_file}) FILE(WRITE ${doxyfile_med_user} ${new_doxy_file}) ELSE() - FILE(APPEND ${doxyfile_med_user} + FILE(APPEND ${doxyfile_med_user} "#Temporary variable to enable python documentation sections\nENABLED_SECTIONS = ENABLE_EXAMPLES") ENDIF() - + # Swig generation to have docstrings correctly populated: INCLUDE(doxy2swig/doxy2swig.cmake) - + ELSE() ADD_CUSTOM_TARGET(usr_docs ALL COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile_med_user @@ -92,10 +91,10 @@ ELSE() WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) ENDIF() - + #INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)") -INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc_ref_user/html/ DESTINATION ${SALOME_INSTALL_DOC}/gui/MED) -INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/MED) +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc_ref_user/html/ DESTINATION ${MEDTOOL_INSTALL_DOC}/gui/MED) +INSTALL(FILES images/head.png DESTINATION ${MEDTOOL_INSTALL_DOC}/gui/MED) SET(MAKE_CLEAN_FILES doc_ref_user tmp) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${MAKE_CLEAN_FILES}") diff --git a/medtool/doc/user/doxygen/Doxyfile_med_user.in b/medtool/doc/user/doxygen/Doxyfile_med_user.in index dbb6c5596..4d56fe163 100644 --- a/medtool/doc/user/doxygen/Doxyfile_med_user.in +++ b/medtool/doc/user/doxygen/Doxyfile_med_user.in @@ -22,7 +22,7 @@ # General configuration options #--------------------------------------------------------------------------- # -PROJECT_NAME = "SALOME MED Users' Guide" +PROJECT_NAME = "MEDCoupling Users' Guide" PROJECT_NUMBER = OUTPUT_DIRECTORY = doc_ref_user OUTPUT_LANGUAGE = English @@ -85,7 +85,7 @@ INPUT = @CMAKE_CURRENT_SOURCE_DIR@/doxfiles/index.dox \ @CMAKE_CURRENT_SOURCE_DIR@/doxfiles/reference/cpp \ @CMAKE_CURRENT_SOURCE_DIR@/doxfiles/reference/distrib \ @CMAKE_CURRENT_SOURCE_DIR@/doxfiles/reference/misc \ - @CMAKE_CURRENT_SOURCE_DIR@/doxfiles/examples/examples.dox \ + @CMAKE_CURRENT_SOURCE_DIR@/doxfiles/examples/examples.dox \ @CMAKE_CURRENT_BINARY_DIR@/medcouplingexamplesPY.dox \ @CMAKE_CURRENT_BINARY_DIR@/medcouplingexamplesCPP.dox \ @CMAKE_CURRENT_SOURCE_DIR@/doxfiles/appendix \ @@ -96,7 +96,7 @@ INPUT = @CMAKE_CURRENT_SOURCE_DIR@/doxfiles/index.dox \ @PROJECT_SOURCE_DIR@/src/INTERP_KERNEL/Geometric2D \ @PROJECT_SOURCE_DIR@/src/MEDCoupling \ @PROJECT_SOURCE_DIR@/src/MEDLoader \ - @PROJECT_SOURCE_DIR@/src/MEDCouplingCorba + @PROJECT_SOURCE_DIR@/src/MEDCouplingCorba FILE_PATTERNS = InterpKernelDEC.* \ OverlapDEC.* \ @@ -195,7 +195,7 @@ GENERATE_HTML = YES HTML_OUTPUT = html HTML_HEADER = @CMAKE_CURRENT_BINARY_DIR@/static/header.html HTML_FOOTER = @CMAKE_CURRENT_SOURCE_DIR@/static/footer.html -HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/static/salome_extra.css +HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/static/medcoupling_extra.css GENERATE_HTMLHELP = NO GENERATE_CHI = YES BINARY_TOC = NO diff --git a/medtool/doc/user/doxygen/doxfiles/appendix/install.dox b/medtool/doc/user/doxygen/doxfiles/appendix/install.dox index 5386739c5..7a91e1556 100644 --- a/medtool/doc/user/doxygen/doxfiles/appendix/install.dox +++ b/medtool/doc/user/doxygen/doxfiles/appendix/install.dox @@ -2,7 +2,7 @@ /*! \page install Configuring and Installing MED from sources -The install procedure of the %MED SALOME module can handle a variety of configurations +The install procedure of %MEDCoupling can handle a variety of configurations to suit the needs of its user. Instructions for configuring and installing the module can be found here. Partitioning and parallel functionalities are optional. diff --git a/medtool/doc/user/doxygen/doxfiles/gui.dox b/medtool/doc/user/doxygen/doxfiles/gui.dox index 6b0a53bf7..fe63dd880 100644 --- a/medtool/doc/user/doxygen/doxfiles/gui.dox +++ b/medtool/doc/user/doxygen/doxfiles/gui.dox @@ -8,16 +8,16 @@ you deal with the most standard use cases of field manipulation. The user guide can be found here: - User guide of the MED Graphical Interface + href="${MED_ROOT_DIR}/share/doc/salome/dev/MED/medcalc-userguide-gui.html">User guide of the MED Graphical Interface You could also be interested to read the software specifications and requirements for this graphical module, and even the technical considerations for development: - Software + href="${MED_ROOT_DIR}/share/doc/salome/dev/MED/medcalc-specifications.html">Software specifications and requirements of the MED Graphical Interface (in french) - Developer guide of the MED Graphical Interface (in french) + href="${MED_ROOT_DIR}/share/doc/salome/dev/MED/medcalc-develguide.html">Developer guide of the MED Graphical Interface (in french) */ diff --git a/medtool/doc/user/doxygen/doxfiles/index.dox b/medtool/doc/user/doxygen/doxfiles/index.dox index e737c424e..fd9b49a8e 100644 --- a/medtool/doc/user/doxygen/doxfiles/index.dox +++ b/medtool/doc/user/doxygen/doxfiles/index.dox @@ -1,20 +1,20 @@ /*! -\mainpage Welcome to the SALOME MED module! +\mainpage Welcome to MEDCoupling! -The MED module gathers several powerful functionalities around the input and output data of -simulation codes (meshes and fields mainly). +The MED module gathers several powerful functionalities around the input and output data of +simulation codes (meshes and fields mainly). \image html projectionHQ_600.png "Example of a field interpolation between two 3D surfacic meshes" The most common usage is to write dedicated code (C++ or Python) linking to the library, however a \ref gui "graphical user interface" is also available. -- If you don't know where to start, reading the \ref start "getting started" section and then +- If you don't know where to start, reading the \ref start "getting started" section and then taking a look at the tutorial is probably a good way to go. - If you are looking for a very specific point (how can I build a mesh from scratch, how do I write my data to a file, etc ...), taking a look at the \ref faq "FAQ" or at the numerous - \ref examples "code examples" might help. + \ref examples "code examples" might help. - Finally people looking for the reference documentation of a given function (in C++ or Python) should take a look at the \ref ParaMEDMEM "API documentation". Only the C++ functions are documented, but the Python API has been designed to be used in a very similar fashion, provided you are aware of the @@ -45,11 +45,11 @@ This documentation is organized as follows: - \ref medcouplingcppexamples \endif -- \ref appendix +- \ref appendix - \ref glossary - \ref med-file - \ref install - + - \ref ParaMEDMEM "MEDCoupling (and other parallel classes) API documentation" - \ref MEDLoader "MEDLoader API documentation" diff --git a/medtool/doc/user/doxygen/doxy2swig/doxy2swig.cmake b/medtool/doc/user/doxygen/doxy2swig/doxy2swig.cmake index b497ef358..d7f83809a 100644 --- a/medtool/doc/user/doxygen/doxy2swig/doxy2swig.cmake +++ b/medtool/doc/user/doxygen/doxy2swig/doxy2swig.cmake @@ -56,22 +56,22 @@ SET(_classes_MEDLoader ## \param[in] target_swig dummy target encompassing the final build of all SWIG files ## \param[in] cls_list list of classes for which to generate SWIG files ## \param[in] swig_main_file main SWIG file including the other generated SWIG files -## \param[out] swig_files list of generated SWIG files +## \param[out] swig_files list of generated SWIG files ## -MACRO(SALOME_MED_SWIG_DOCSTRING_GENERATE target_doc target_swig cls_list swig_main_file swig_files) +MACRO(MEDTOOL_MED_SWIG_DOCSTRING_GENERATE target_doc target_swig cls_list swig_main_file swig_files) # List of generated SWIG files (.i) for doc purposes only: SET(${swig_files}) FOREACH(_cls IN LISTS ${cls_list}) SET(_xml_file "${CMAKE_CURRENT_BINARY_DIR}/../doxygen/doc_ref_user/xml/class${_cls}.xml") SET(_swig_file_base "${_SWIG_DOC_SUFFIX}${_cls}.i") SET(_swig_file "${PROJECT_BINARY_DIR}/doc/${_swig_file_base}" ) - + # SWIG doc files will always be generated *after* Doxygen is run: ### WARNING: ADD_CUSTOM_COMMAND(TARGET xxx POST_BUILD ...) command ### must be in exactly the same subdir as the initial target construction command. ### That's why this file is included with an INCLUDE() rather than using ADD_SUBDIRECTORY - # Note: we touch the main .i file to be sure to retrigger swig when the doc in a included - # class changes. + # Note: we touch the main .i file to be sure to retrigger swig when the doc in a included + # class changes. ADD_CUSTOM_COMMAND(OUTPUT ${_swig_file} COMMAND ${PYTHON_EXECUTABLE} ${_DOXY2SWIG} "-n" ${_xml_file} ${_swig_file} COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${swig_main_file} @@ -82,13 +82,13 @@ MACRO(SALOME_MED_SWIG_DOCSTRING_GENERATE target_doc target_swig cls_list swig_ma ADD_CUSTOM_TARGET(${_swig_file_base} DEPENDS ${_swig_file}) # The doxy2swig script is executed once the doxygen documentation has been generated ... ADD_DEPENDENCIES(${_swig_file_base} ${target_doc}) - # ... and the meta target 'swig_ready' (here ${target_swig}) is ready when all .i files + # ... and the meta target 'swig_ready' (here ${target_swig}) is ready when all .i files # have been generated: ADD_DEPENDENCIES(${target_swig} ${_swig_file_base}) - + LIST(APPEND ${swig_files} ${_swig_file_base}) ENDFOREACH() -ENDMACRO(SALOME_MED_SWIG_DOCSTRING_GENERATE) +ENDMACRO(MEDTOOL_MED_SWIG_DOCSTRING_GENERATE) ## @@ -98,16 +98,16 @@ ENDMACRO(SALOME_MED_SWIG_DOCSTRING_GENERATE) ## \param[in] target_doc main target for the stantard doxygen generation ## \param[in] target_swig dummy target encompassing the final build of all SWIG files ## \param[in] root_name either 'MEDCoupling' or 'MEDLoader' -## -MACRO(SALOME_MED_SWIG_DOCSTRING_CONFIGURE target_doc target_swig root_name) +## +MACRO(MEDTOOL_MED_SWIG_DOCSTRING_CONFIGURE target_doc target_swig root_name) SET(_all_swig_docs) SET(_swig_include_set) SET(_in_file doxy2swig/${root_name}_doc.i.in) SET(_out_file ${PROJECT_BINARY_DIR}/doc/${root_name}_doc.i) - SALOME_MED_SWIG_DOCSTRING_GENERATE(${target_doc} ${target_swig} _classes_${root_name} ${_out_file} _all_swig_docs) + MEDTOOL_MED_SWIG_DOCSTRING_GENERATE(${target_doc} ${target_swig} _classes_${root_name} ${_out_file} _all_swig_docs) FOREACH(f IN LISTS _all_swig_docs) SET(_swig_include_set "${_swig_include_set}\n%include \"${f}\"") ENDFOREACH() CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY) -ENDMACRO(SALOME_MED_SWIG_DOCSTRING_CONFIGURE) +ENDMACRO(MEDTOOL_MED_SWIG_DOCSTRING_CONFIGURE) diff --git a/medtool/doc/user/doxygen/static/header.html.in b/medtool/doc/user/doxygen/static/header.html.in index 5b289ac9d..191bb9a5f 100755 --- a/medtool/doc/user/doxygen/static/header.html.in +++ b/medtool/doc/user/doxygen/static/header.html.in @@ -19,5 +19,5 @@ $extrastylesheet
-
Version: @SALOMEMED_VERSION@
+
Version: @MEDTOOL_VERSION@
diff --git a/medtool/doc/user/doxygen/static/salome_extra.css b/medtool/doc/user/doxygen/static/medcoupling_extra.css similarity index 100% rename from medtool/doc/user/doxygen/static/salome_extra.css rename to medtool/doc/user/doxygen/static/medcoupling_extra.css diff --git a/medtool/src/INTERP_KERNEL/ExprEval/InterpKernelExprParser.cxx b/medtool/src/INTERP_KERNEL/ExprEval/InterpKernelExprParser.cxx index e1cce1a91..1c213b796 100644 --- a/medtool/src/INTERP_KERNEL/ExprEval/InterpKernelExprParser.cxx +++ b/medtool/src/INTERP_KERNEL/ExprEval/InterpKernelExprParser.cxx @@ -81,7 +81,7 @@ void LeafExprVal::replaceValues(const std::vector& valuesInExpr) int pos=(int)_value; int lgth=(int)valuesInExpr.size(); if(pos>=lgth || pos<0) - throw INTERP_KERNEL::Exception("LeafExprVal::replaceValues : Big Problem detected ! Send expression to Salome support with expression !"); + throw INTERP_KERNEL::Exception("LeafExprVal::replaceValues : Big Problem detected !"); _value=valuesInExpr[pos]; } @@ -528,7 +528,7 @@ void ExprParser::parseUnaryFunc() { if(_expr[_expr.length()-1]!=')') return ; - //at this level of code _expr + //at this level of code _expr std::size_t pos1=_expr.find_first_of('('); std::size_t pos4=FindCorrespondingOpenBracket(_expr,_expr.length()-1); if(pos4!=pos1) @@ -569,7 +569,7 @@ void ExprParser::parseUnaryFunc() /*! * This method has the responsability to see if this->_expr is interpretable without any recursion. * \return true if no recursion needed, false if this->_expr is too complex to be interpreted at this level. - * \throw exception if this->_expr is simple enough to try to interprate this and this expression contains an error. + * \throw exception if this->_expr is simple enough to try to interprate this and this expression contains an error. */ bool ExprParser::tryToInterpALeaf() { diff --git a/medtool/src/MEDLoader/Swig/CaseWriter.py b/medtool/src/MEDLoader/Swig/CaseWriter.py index 73112ad65..cb80579b5 100644 --- a/medtool/src/MEDLoader/Swig/CaseWriter.py +++ b/medtool/src/MEDLoader/Swig/CaseWriter.py @@ -30,7 +30,7 @@ class CaseWriter(CaseIO): """ Converting MED file format in memory to a the Case file format (Ensight). A new file with the same base name and the .case extension is created with its depencies (.geo ...). """ - + header="""FORMAT type: ensight gold GEOMETRY @@ -45,7 +45,7 @@ filename increment: 1 time values: %(TimeValues)s """ - + @classmethod def New(cls): """ Static constructor. """ @@ -70,7 +70,7 @@ time values: assert(isinstance(status,bool)) self.__export_groups=status pass - + def write(self,fileName): """ Write into the specified fileName series the result """ @@ -95,7 +95,7 @@ time values: self._real_written_file_name.append(realWrittenCaseFileNameForCurMesh) pass return self._real_written_file_name - + def __writeMeshesPart(self,mdm,meshfn): try: os.remove(meshfn) @@ -107,7 +107,7 @@ time values: assert(isinstance(mdm,MEDFileUMesh)) ms2=[[mdm.getMeshAtLevel(lev) for lev in mdm.getNonEmptyLevels()[:1]]] if self.__export_groups: - for grpnm in mdm.getGroupsNames(): + for grpnm in mdm.getGroupsNames(): ms3=[] for lev in mdm.getGrpNonEmptyLevels(grpnm)[:1]: m=mdm.getGroup(lev,grpnm) ; m.zipCoords() @@ -124,7 +124,7 @@ time values: a=np.memmap(f,dtype='byte',mode='w+',offset=0,shape=(sz,)) ; a.flush() # truncate to set the size of the file mm=mmap.mmap(f.fileno(),offset=0,length=0) mm.write(self.__str80("C Binary")) - mm.write(self.__str80("Exported from MEDCoupling/MEDLoader SALOME version %s"%(MEDCouplingVersionStr()))) + mm.write(self.__str80("Exported from MEDCoupling/MEDLoader version %s"%(MEDCouplingVersionStr()))) mm.write(self.__str80("Conversion using CaseWriter class")) mm.write(self.__str80("node id off")) mm.write(self.__str80("element id off")) @@ -194,7 +194,7 @@ time values: pass pass pass - + def __writeFieldsPart(self,mdfs): if not mdfs: return "" @@ -314,13 +314,13 @@ time values: headerPart+=htp pass return headerPart - + @classmethod def __str80(cls,st): if len(st)>79: raise Exception("String \"%s\" is too long (>79) !"%(st)) return st.ljust(79)+"\n" - + def __computeSizeOfGeoFile(self,listOfMeshes,nn): sz=0 for m in listOfMeshes: diff --git a/medtool/src/ParaMEDMEMTest/ParaMEDMEMTest_NonCoincidentDEC.cxx b/medtool/src/ParaMEDMEMTest/ParaMEDMEMTest_NonCoincidentDEC.cxx index 6ab7130df..0648200b4 100644 --- a/medtool/src/ParaMEDMEMTest/ParaMEDMEMTest_NonCoincidentDEC.cxx +++ b/medtool/src/ParaMEDMEMTest/ParaMEDMEMTest_NonCoincidentDEC.cxx @@ -33,7 +33,7 @@ #include "ParaFIELD.hxx" #include "UnstructuredParaSUPPORT.hxx" #include "ICoCoMEDField.hxx" - + #include // use this define to enable lines, execution of which leads to Segmentation Fault @@ -46,7 +46,7 @@ using namespace std; using namespace ParaMEDMEM; using namespace MEDMEM; - + /* * Check methods defined in InterpKernelDEC.hxx * @@ -66,30 +66,30 @@ void ParaMEDMEMTest::testNonCoincidentDEC_2D() //the test is meant to run on five processors if (size !=5) return ; - - testNonCoincidentDEC( "/share/salome/resources/med/square1_split", + + testNonCoincidentDEC( "square1_split", "Mesh_2", - "/share/salome/resources/med/square2_split", + "square2_split", "Mesh_3", 3, 1e-6); -} +} void ParaMEDMEMTest::testNonCoincidentDEC_3D() { int size; MPI_Comm_size(MPI_COMM_WORLD,&size); - + //the test is meant to run on five processors if (size !=4) return ; - - testNonCoincidentDEC( "/share/salome/resources/med/blade_12000_split2", + + testNonCoincidentDEC( "blade_12000_split2", "Mesh_1", - "/share/salome/resources/med/blade_3000_split2", + "blade_3000_split2", "Mesh_1", 2, 1e4); -} +} void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, const string& meshname1, @@ -102,23 +102,23 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, int rank; MPI_Comm_size(MPI_COMM_WORLD,&size); MPI_Comm_rank(MPI_COMM_WORLD,&rank); - + set self_procs; set procs_source; set procs_target; - + for (int i=0; i* field; ParaMEDMEM::ParaMESH* paramesh; ParaMEDMEM::ParaFIELD* parafield; - + string filename_xml1 = getResourceFile(filename1); - string filename_xml2 = getResourceFile(filename2); + string filename_xml2 = getResourceFile(filename2); //string filename_seq_wr = makeTmpFile(""); //string filename_seq_med = makeTmpFile("myWrField_seq_pointe221.med"); - + // To remove tmp files from disk ParaMEDMEMTest_TmpFilesRemover aRemover; //aRemover.Register(filename_seq_wr); @@ -146,22 +146,22 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, if (source_group->containsMyRank()) { string master = filename_xml1; - + ostringstream strstream; strstream <getNumberOfElements(MED_EN::MED_ALL_ELEMENTS); double * value= new double[nb_local]; for(int ielem=0; ielemgetField()->setValue(value); icocofield=new ICoCo::MEDField(paramesh,parafield); - + dec.attachLocalField(icocofield); delete [] value; } - + //loading the geometry for the target group if (target_group->containsMyRank()) { @@ -182,34 +182,34 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, strstream << master<<(rank-nproc_source+1)<<".med"; ostringstream meshname ; meshname<< meshname2<<"_"<getNumberOfElements(MED_EN::MED_ALL_ELEMENTS); double * value= new double[nb_local]; for(int ielem=0; ielemgetField()->setValue(value); icocofield=new ICoCo::MEDField(paramesh,parafield); - + dec.attachLocalField(icocofield); delete [] value; } - - - //attaching a DEC to the source group + + + //attaching a DEC to the source group double field_before_int; double field_after_int; - + if (source_group->containsMyRank()) - { + { field_before_int = parafield->getVolumeIntegral(1); MPI_Bcast(&field_before_int, 1,MPI_DOUBLE, 0,MPI_COMM_WORLD); dec.synchronize(); @@ -218,29 +218,29 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, dec.sendData(); // paramesh->write(MED_DRIVER,"./sourcesquarenc"); - //parafield->write(MED_DRIVER,"./sourcesquarenc","boundary"); - - + //parafield->write(MED_DRIVER,"./sourcesquarenc","boundary"); + + } - + //attaching a DEC to the target group if (target_group->containsMyRank()) { MPI_Bcast(&field_before_int, 1,MPI_DOUBLE, 0,MPI_COMM_WORLD); - + dec.synchronize(); dec.setOption("ForcedRenormalization",false); dec.recvData(); //paramesh->write(MED_DRIVER, "./targetsquarenc"); //parafield->write(MED_DRIVER, "./targetsquarenc", "boundary"); field_after_int = parafield->getVolumeIntegral(1); - + } MPI_Bcast(&field_before_int,1,MPI_DOUBLE,0,MPI_COMM_WORLD); MPI_Bcast(&field_after_int, 1,MPI_DOUBLE, size-1,MPI_COMM_WORLD); - + CPPUNIT_ASSERT_DOUBLES_EQUAL(field_before_int, field_after_int, epsilon); - + delete source_group; delete target_group; delete self_group; @@ -251,6 +251,6 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, delete parasupport; delete mesh; MPI_Barrier(MPI_COMM_WORLD); - + } #endif diff --git a/medtool/src/ParaMEDMEM_Swig/test_InterpKernelDEC.py b/medtool/src/ParaMEDMEM_Swig/test_InterpKernelDEC.py index 0d6d6cdb6..f2e0720df 100755 --- a/medtool/src/ParaMEDMEM_Swig/test_InterpKernelDEC.py +++ b/medtool/src/ParaMEDMEM_Swig/test_InterpKernelDEC.py @@ -35,27 +35,27 @@ class ParaMEDMEMBasicsTest(unittest.TestCase): nproc_source = 3 procs_source = range( nproc_source ) procs_target = range( size - nproc_source + 1, size) - + interface = CommInterface() target_group = MPIProcessorGroup(interface, procs_target) source_group = MPIProcessorGroup(interface, procs_source) dec = InterpKernelDEC(source_group, target_group) - + mesh =0 support =0 paramesh =0 parafield =0 icocofield =0 - data_dir = os.environ['MED_ROOT_DIR'] + data_dir = os.environ['MEDTOOL_ROOT_DIR'] tmp_dir = os.environ['TMP'] - + if not tmp_dir or len(tmp_dir)==0: tmp_dir = "/tmp" pass - - filename_xml1 = os.path.join(data_dir, "share/salome/resources/med/square1_split") - filename_xml2 = os.path.join(data_dir, "share/salome/resources/med/square2_split") - + + filename_xml1 = os.path.join(data_dir, "share/resources/med/square1_split") + filename_xml2 = os.path.join(data_dir, "share/resources/med/square2_split") + MPI_Barrier(MPI_COMM_WORLD) if source_group.containsMyRank(): filename = filename_xml1 + str(rank+1) + ".med" @@ -87,7 +87,7 @@ class ParaMEDMEMBasicsTest(unittest.TestCase): dec.setMethod("P0") dec.attachLocalField(icocofield) pass - + if source_group.containsMyRank(): field_before_int = parafield.getVolumeIntegral(0,True) dec.synchronize() diff --git a/medtool/src/ParaMEDMEM_Swig/test_NonCoincidentDEC.py b/medtool/src/ParaMEDMEM_Swig/test_NonCoincidentDEC.py index acf78aa5e..49398f55b 100755 --- a/medtool/src/ParaMEDMEM_Swig/test_NonCoincidentDEC.py +++ b/medtool/src/ParaMEDMEM_Swig/test_NonCoincidentDEC.py @@ -50,17 +50,17 @@ icocofield = 0 dec = NonCoincidentDEC(source_group, target_group) -data_dir = os.environ['MED_ROOT_DIR'] +data_dir = os.environ['MEDTOOL_ROOT_DIR'] tmp_dir = os.environ['TMP'] if tmp_dir == '': tmp_dir = "/tmp" pass -filename_xml1 = data_dir + "/share/salome/resources/med/square1_split" -filename_xml2 = data_dir + "/share/salome/resources/med/square2_split" +filename_xml1 = data_dir + "/share/resources/med/square1_split" +filename_xml2 = data_dir + "/share/resources/med/square2_split" MPI_Barrier(MPI_COMM_WORLD) - + if source_group.containsMyRank(): filename = filename_xml1 + str(rank+1) + ".med" @@ -119,7 +119,7 @@ if source_group.containsMyRank(): dec.sendData() pass - + if target_group.containsMyRank(): MPI_Bcast(field_before_int, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD) diff --git a/medtool/src/ParaMEDMEM_Swig/test_StructuredCoincidentDEC.py b/medtool/src/ParaMEDMEM_Swig/test_StructuredCoincidentDEC.py index 90c9aad2f..5b51d080b 100755 --- a/medtool/src/ParaMEDMEM_Swig/test_StructuredCoincidentDEC.py +++ b/medtool/src/ParaMEDMEM_Swig/test_StructuredCoincidentDEC.py @@ -47,17 +47,17 @@ class ParaMEDMEMBasicsTest2(unittest.TestCase): comptopo = 0 icocofield= 0 # - data_dir = os.environ['MED_ROOT_DIR'] + data_dir = os.environ['MEDTOOL_ROOT_DIR'] tmp_dir = os.environ['TMP'] if tmp_dir == '': tmp_dir = "/tmp" pass - - filename_xml1 = data_dir + "/share/salome/resources/med/square1_split" - filename_2 = data_dir + "/share/salome/resources/med/square1.med" + + filename_xml1 = data_dir + "/share/resources/med/square1_split" + filename_2 = data_dir + "/share/resources/med/square1.med" filename_seq_wr = tmp_dir + "/" filename_seq_med = tmp_dir + "/myWrField_seq_pointe221.med" - + dec = StructuredCoincidentDEC(source_group, target_group) MPI_Barrier(MPI_COMM_WORLD) if source_group.containsMyRank(): @@ -78,8 +78,8 @@ class ParaMEDMEMBasicsTest2(unittest.TestCase): pass parafield.getField().setValues(value) icocofield = ICoCoMEDField(mesh,parafield.getField()) - dec.setMethod("P0") - dec.attachLocalField(parafield) + dec.setMethod("P0") + dec.attachLocalField(parafield) dec.synchronize() dec.sendData() pass @@ -124,5 +124,5 @@ class ParaMEDMEMBasicsTest2(unittest.TestCase): print "End of test StructuredCoincidentDEC" pass - + unittest.main() -- 2.39.2