Merge from V7_main

This commit is contained in:
rnc 2013-07-10 16:22:23 +00:00
parent 4a7fdc05e6
commit fe85768588
227 changed files with 22397 additions and 4775 deletions

View File

@ -28,12 +28,10 @@ if SMESH_ENABLE_GUI
ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
-I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files
else !SMESH_ENABLE_GUI else !SMESH_ENABLE_GUI
ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files
endif endif

View File

@ -46,14 +46,6 @@ fi
# exit # exit
#fi #fi
########################################################################
# Test if the MED_ROOT_DIR is set correctly
if test ! -d "${MED_ROOT_DIR}"; then
echo "failed : MED_ROOT_DIR variable is not correct !"
exit
fi
######################################################################## ########################################################################
# Test if the GEOM_ROOT_DIR is set correctly # Test if the GEOM_ROOT_DIR is set correctly
@ -82,12 +74,10 @@ if test -d "${GUI_ROOT_DIR}"; then
aclocal -I adm_local/unix/config_files \ aclocal -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files || exit 1 -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files || exit 1
else else
aclocal -I adm_local/unix/config_files \ aclocal -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files || exit 1 -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files || exit 1
fi fi

View File

@ -408,14 +408,6 @@ echo
CHECK_GEOM CHECK_GEOM
echo
echo ---------------------------------------------
echo Testing Med
echo ---------------------------------------------
echo
CHECK_MED
CHECK_PLATFORM CHECK_PLATFORM
echo echo
@ -452,11 +444,11 @@ echo
echo Configure echo Configure
if test "${gui_ok}" = "yes"; then if test "${gui_ok}" = "yes"; then
variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok cgns_ok tbb_ok omniORB_ok occ_ok doxygen_ok graphviz_ok sphinx_ok qwt_ok Kernel_ok Geom_ok Med_ok gui_ok" variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok cgns_ok tbb_ok med3_ok omniORB_ok occ_ok doxygen_ok graphviz_ok sphinx_ok qwt_ok Kernel_ok Geom_ok gui_ok"
elif test "${SalomeGUI_need}" != "no"; then elif test "${SalomeGUI_need}" != "no"; then
variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok cgns_ok tbb_ok med3_ok omniORB_ok occ_ok doxygen_ok graphviz_ok sphinx_ok Kernel_ok Geom_ok Med_ok gui_ok" variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok cgns_ok tbb_ok med3_ok omniORB_ok occ_ok doxygen_ok graphviz_ok sphinx_ok Kernel_ok Geom_ok gui_ok"
else else
variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok cgns_ok tbb_ok med3_ok omniORB_ok occ_ok doxygen_ok graphviz_ok sphinx_ok Kernel_ok Geom_ok Med_ok" variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok cgns_ok tbb_ok med3_ok omniORB_ok occ_ok doxygen_ok graphviz_ok sphinx_ok Kernel_ok Geom_ok"
fi fi
for var in $variables for var in $variables
@ -549,6 +541,10 @@ AC_OUTPUT([ \
doc/salome/tui/static/header.html \ doc/salome/tui/static/header.html \
src/Makefile \ src/Makefile \
src/Controls/Makefile \ src/Controls/Makefile \
src/MEDWrapper/Makefile \
src/MEDWrapper/Base/Makefile \
src/MEDWrapper/Factory/Makefile \
src/MEDWrapper/V2_2/Makefile \
src/Driver/Makefile \ src/Driver/Makefile \
src/DriverDAT/Makefile \ src/DriverDAT/Makefile \
src/DriverMED/Makefile \ src/DriverMED/Makefile \
@ -578,6 +574,9 @@ AC_OUTPUT([ \
src/Tools/YamsPlug/Makefile \ src/Tools/YamsPlug/Makefile \
src/Tools/YamsPlug/doc/Makefile \ src/Tools/YamsPlug/doc/Makefile \
src/Tools/YamsPlug/doc/conf.py \ src/Tools/YamsPlug/doc/conf.py \
src/Tools/MGCleanerPlug/Makefile \
src/Tools/MGCleanerPlug/doc/Makefile \
src/Tools/MGCleanerPlug/doc/conf.py \
src/Tools/padder/Makefile \ src/Tools/padder/Makefile \
src/Tools/padder/meshjob/Makefile \ src/Tools/padder/meshjob/Makefile \
src/Tools/padder/meshjob/idl/Makefile \ src/Tools/padder/meshjob/idl/Makefile \

View File

@ -16,23 +16,43 @@ idbox = geompy.addToStudy(box, "box")
# create a mesh # create a mesh
tetra = smesh.Mesh(box, "MeshBox") tetra = smesh.Mesh(box, "MeshBox")
tetra.Segment().NumberOfSegments(7)
algo1D = tetra.Segment() tetra.Triangle()
algo1D.NumberOfSegments(7) tetra.Tetrahedron()
algo2D = tetra.Triangle()
algo2D.MaxElementArea(800.)
algo3D = tetra.Tetrahedron()
algo3D.MaxElementVolume(900.)
# compute the mesh # compute the mesh
tetra.Compute() tetra.Compute()
# export the mesh in a MED file # export the mesh in a MED file
tetra.ExportMED("/tmp/meshMED.med", 0) import tempfile
medFile = tempfile.NamedTemporaryFile(suffix=".med").name
tetra.ExportMED( medFile, 0 )
# export a group in a MED file # export a group in a MED file
face = geompy.SubShapeAll( box, geompy.ShapeType["FACE"])[0] # a box side face = geompy.SubShapeAll( box, geompy.ShapeType["FACE"])[0] # a box side
group = tetra.GroupOnGeom( face, "face group" ) # group of 2D elements on the <face> group = tetra.GroupOnGeom( face, "face group" ) # group of 2D elements on the <face>
tetra.ExportMED("/tmp/groupMED.med", meshPart=group) tetra.ExportMED( medFile, meshPart=group )
# ========================
# autoDimension parameter
# ========================
face = geompy.MakeFaceHW( 10, 10, 1, "rectangle" )
mesh2D = smesh.Mesh( face, "mesh2D" )
mesh2D.AutomaticHexahedralization(0)
import MEDLoader, os
# exported mesh is in 2D space because it is a planar mesh lying
# on XOY plane, and autoDimension=True by default
mesh2D.ExportMED( medFile )
medMesh = MEDLoader.MEDLoader.ReadUMeshFromFile(medFile,mesh2D.GetName(),0)
print "autoDimension==True, exported mesh is in %sD"%medMesh.getSpaceDimension()
# exported mesh is in 3D space, same as in Mesh module,
# thanks to autoDimension=False
mesh2D.ExportMED( medFile, autoDimension=False )
medMesh = MEDLoader.MEDLoader.ReadUMeshFromFile(medFile,mesh2D.GetName(),0)
print "autoDimension==False, exported mesh is in %sD"%medMesh.getSpaceDimension()
os.remove( medFile )

View File

@ -25,6 +25,7 @@ ignoreFaces = [ faces[0], faces[-1]]
geompy.addToStudy( shape, "shape" ) geompy.addToStudy( shape, "shape" )
geompy.addToStudyInFather( shape, face1, "face1") geompy.addToStudyInFather( shape, face1, "face1")
# 3D Viscous layers
mesh = smesh.Mesh(shape, "CFD") mesh = smesh.Mesh(shape, "CFD")
@ -45,3 +46,21 @@ mesh.Compute()
mesh.MakeGroup("Tetras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_TETRA) mesh.MakeGroup("Tetras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_TETRA)
mesh.MakeGroup("Pyras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_PYRAMID) mesh.MakeGroup("Pyras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_PYRAMID)
mesh.MakeGroup("Prims",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_PENTA) mesh.MakeGroup("Prims",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_PENTA)
# 2D Viscous layers
# 3 edges of the 4 edges of face1
edgeIds = geompy.SubShapeAllIDs( face1, geompy.ShapeType["EDGE"])[:-1]
mesh = smesh.Mesh(face1,"VicsousLayers2D")
mesh.Segment().NumberOfSegments( 5 )
# viscous layers should be created on 1 edge, as we set 3 edges to ignore
vlHyp = mesh.Triangle().ViscousLayers2D( 2, 3, 1.5, edgeIds, isEdgesToIgnore=True )
mesh.Compute()
# viscous layers should be created on 3 edges, as we pass isEdgesToIgnore=False
vlHyp.SetEdges( edgeIds, False )
mesh.Compute()

View File

@ -1,13 +1,14 @@
# Duplicate nodes # Duplicate nodes or/and elements
import salome import salome
salome.salome_init() salome.salome_init()
import GEOM import GEOM
from salome.geom import geomBuilder from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy) geompy = geomBuilder.New(salome.myStudy)
import SMESH, SALOMEDS import SMESH
from salome.smesh import smeshBuilder from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy) smesh = smeshBuilder.New(salome.myStudy)
@ -24,7 +25,7 @@ mesh.Hexahedron()
# Compute mesh # Compute mesh
mesh.Compute() mesh.Compute()
# Without the duplication of border elements # Duplicate nodes only
# Nodes to duplicate # Nodes to duplicate
nodes1 = mesh.CreateEmptyGroup( SMESH.NODE, 'nodes1' ) nodes1 = mesh.CreateEmptyGroup( SMESH.NODE, 'nodes1' )
@ -48,7 +49,7 @@ print "Nodes : ", mesh.NbNodes()
print "Edges : ", mesh.NbEdges() print "Edges : ", mesh.NbEdges()
print "Quadrangles : ", mesh.NbQuadrangles() print "Quadrangles : ", mesh.NbQuadrangles()
# With the duplication of border elements # Duplicate nodes and border elements
# Edges to duplicate # Edges to duplicate
edges = mesh.CreateEmptyGroup( SMESH.EDGE, 'edges' ) edges = mesh.CreateEmptyGroup( SMESH.EDGE, 'edges' )
@ -76,6 +77,19 @@ print "Nodes : ", mesh.NbNodes()
print "Edges : ", mesh.NbEdges() print "Edges : ", mesh.NbEdges()
print "Quadrangles : ", mesh.NbQuadrangles() print "Quadrangles : ", mesh.NbQuadrangles()
# Duplicate elements only
# Duplicate all faces and make a group of new faces.
# If a mesh is given to DoubleElements(), all elements of the greatest dimension are duplicated
newFacesGroup = mesh.DoubleElements( mesh, "newFacesGroup" )
# Duplicate edges contained in the group "edges" and add new edges to this group
mesh.DoubleElements( edges, edges.GetName() )
# Duplicate two first edges of the mesh
mesh.DoubleElements([ 1, 2 ])
# Update object browser # Update object browser
if salome.sg.hasDesktop(): if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(0) salome.sg.updateObjBrowser(0)

View File

@ -46,8 +46,6 @@ IF(WINDOWS)
@SET PATH=$ENV{KERNEL_ROOT_DIR}/lib/salome\;%PATH% @SET PATH=$ENV{KERNEL_ROOT_DIR}/lib/salome\;%PATH%
@SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/bin/salome\;%PYTHONPATH% @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/bin/salome\;%PYTHONPATH%
@SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
@SET PYTHONPATH=$ENV{MED_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
@SET PYTHONPATH=$ENV{MED_ROOT_DIR}/bin/salome\;%PYTHONPATH%
@SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
@SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/bin/salome\;%PYTHONPATH% @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/bin/salome\;%PYTHONPATH%
@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
@ -57,8 +55,8 @@ IF(WINDOWS)
SET(EXT "bat") SET(EXT "bat")
SET(CALL_STR "call") SET(CALL_STR "call")
ELSE(WINDOWS) ELSE(WINDOWS)
SET(DOC_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/bin/salome:${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome:${MED_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${GEOM_ROOT_DIR}/bin/salome:${GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${KERNEL_ROOT_DIR}/bin/salome:${KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${OMNIORB_ROOT_USER}/lib/python${PYTHON_VERSION}/site-packages:${OMNIORB_ROOT_USER}/lib64/python${PYTHON_VERSION}/site-packages") SET(DOC_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/bin/salome:${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome:${GEOM_ROOT_DIR}/bin/salome:${GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${KERNEL_ROOT_DIR}/bin/salome:${KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${OMNIORB_ROOT_USER}/lib/python${PYTHON_VERSION}/site-packages:${OMNIORB_ROOT_USER}/lib64/python${PYTHON_VERSION}/site-packages")
SET(DOC_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/lib/salome:${MED_ROOT_DIR}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome") SET(DOC_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome")
SET(SCR "export PYTHONPATH=${DOC_PYTHONPATH}:\${PYTHONPATH} SET(SCR "export PYTHONPATH=${DOC_PYTHONPATH}:\${PYTHONPATH}
export LD_LIBRARY_PATH=${DOC_LD_LIBRARY_PATH}:\${LD_LIBRARY_PATH} export LD_LIBRARY_PATH=${DOC_LD_LIBRARY_PATH}:\${LD_LIBRARY_PATH}
export SMESH_MeshersList=${DOC_SMESH_MeshersList} export SMESH_MeshersList=${DOC_SMESH_MeshersList}

View File

@ -31,8 +31,8 @@ dist_salomescript_PYTHON = collect_mesh_methods.py
guidocdir = $(docdir)/gui/SMESH guidocdir = $(docdir)/gui/SMESH
guidoc_DATA = images/head.png guidoc_DATA = images/head.png
DOC_PYTHONPATH=$(prefix)/bin/salome:$(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(MED_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(GEOM_ROOT_DIR)/bin/salome:$(GEOM_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages DOC_PYTHONPATH=$(prefix)/bin/salome:$(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(GEOM_ROOT_DIR)/bin/salome:$(GEOM_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages
DOC_LD_LIBRARY_PATH=$(prefix)/lib/salome:$(MED_ROOT_DIR)/lib/salome:$(GEOM_ROOT_DIR)/lib/salome:$(KERNEL_ROOT_DIR)/lib/salome DOC_LD_LIBRARY_PATH=$(prefix)/lib/salome:$(GEOM_ROOT_DIR)/lib/salome:$(KERNEL_ROOT_DIR)/lib/salome
DOC_SMESH_MeshersList=StdMeshers DOC_SMESH_MeshersList=StdMeshers
tmp1/smeshBuilder.py: $(top_srcdir)/src/SMESH_SWIG/StdMeshersBuilder.py $(srcdir)/collect_mesh_methods.py tmp1/smeshBuilder.py: $(top_srcdir)/src/SMESH_SWIG/StdMeshersBuilder.py $(srcdir)/collect_mesh_methods.py
@ -80,6 +80,7 @@ uninstall-local:
case $${filen} in \ case $${filen} in \
dummy ) ;; \ dummy ) ;; \
$(DESTDIR)$(guidocdir)/yams ) ;; \ $(DESTDIR)$(guidocdir)/yams ) ;; \
$(DESTDIR)$(guidocdir)/MGCleaner ) ;; \
$(DESTDIR)$(guidocdir)/head.png ) ;; \ $(DESTDIR)$(guidocdir)/head.png ) ;; \
* ) echo "removing $${filen}" && rm -rf $${filen} ;; \ * ) echo "removing $${filen}" && rm -rf $${filen} ;; \
esac ; \ esac ; \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -13,11 +13,10 @@
\anchor max_element_area_anchor \anchor max_element_area_anchor
<h2>Max Element Area</h2> <h2>Max Element Area</h2>
<b>Max Element Area</b> hypothesis is applied for meshing of 2D faces <b>Max Element Area</b> hypothesis is applied for meshing of faces
composing your geometrical object. Definition of this hypothesis composing your geometrical object. Definition of this hypothesis
consists of setting the <b>maximum area</b> of meshing elements (depending on consists of setting the <b>maximum area</b> of mesh elements,
the chosen meshing algorithm it can be <b>triangles</b> or <b>quadrangles</b>), which will compose the mesh of these faces.
which will compose the mesh of these 2D faces.
\image html a-maxelarea.png \image html a-maxelarea.png
@ -33,8 +32,9 @@ operation.
\anchor length_from_edges_anchor \anchor length_from_edges_anchor
<h2>Length from Edges</h2> <h2>Length from Edges</h2>
<b>Length from edges</b> hypothesis builds 2D mesh segments having a <b>Length from edges</b> hypothesis builds 2D mesh elements having a
length calculated as an average edge length for a given wire. maximum linear size calculated as an average segment length for a wire
of a given face.
<b>See Also</b> a sample TUI Script of a <b>See Also</b> a sample TUI Script of a
\ref tui_length_from_edges "Length from Edges" hypothesis operation. \ref tui_length_from_edges "Length from Edges" hypothesis operation.
@ -48,7 +48,7 @@ length calculated as an average edge length for a given wire.
<b>Quadrangle parameters</b> is a hypothesis for Quadrangle (Mapping). <b>Quadrangle parameters</b> is a hypothesis for Quadrangle (Mapping).
<b>Base vertex</b> parameter allows using Quadrangle (Mapping) <b>Base vertex</b> parameter allows using Quadrangle (Mapping)
algorithm for meshing of triangular faces. In this case it is algorithm for meshing of trilateral faces. In this case it is
necessary to select the vertex, which will be used as the fourth edge necessary to select the vertex, which will be used as the fourth edge
(degenerated). (degenerated).
@ -86,13 +86,22 @@ between them. The following types are available:
<i>This type corresponds to <b>Quadrangle Preference</b> <i>This type corresponds to <b>Quadrangle Preference</b>
additional hypothesis, which is obsolete now.</i></li> additional hypothesis, which is obsolete now.</i></li>
<li><b>Quadrangle preference (reversed)</b> works in the same way and <li><b>Quadrangle preference (reversed)</b> works in the same way and
with the same restriction as <b>Quadrangle preference</b>, but with the same restriction as <b>Quadrangle preference</b>, but
the transition area is located along the coarser meshed sides.</li> the transition area is located along the coarser meshed sides.</li>
<li><b>Reduced</b> type forces building only quadrangles and the transition <li><b>Reduced</b> type forces building only quadrangles and the transition
between the sides is made gradually, layer by layer. This type has between the sides is made gradually, layer by layer. This type has
a limitation on the number of segments: one pair of opposite sides must have a limitation on the number of segments: one pair of opposite sides must have
the same number of segments, the other pair must have an even difference the same number of segments, the other pair must have an even difference
between the numbers of segments on the sides.</li> between the numbers of segments on the sides. In addition, number
of rows of faces between sides with different discretization
should be enough for the transition. At the fastest transition
pattern, three segments become one (see the image below), hence
the least number of face rows needed to reduce from Nmax segments
to Nmin segments is log<sub>3</sub>( Nmax / Nmin ). The number of
face rows is equal to number of segments on each of equally
discretized sides.
\image html reduce_three_to_one.png "The fastest transition pattern: 3 to 1"
</li>
</ul> </ul>
<b>See Also</b> a sample TUI Script of a <b>See Also</b> a sample TUI Script of a

View File

@ -5,13 +5,12 @@
\b Hypotheses represent boundary conditions which will be taken into \b Hypotheses represent boundary conditions which will be taken into
account at calculations of meshes or sub-meshes basing on geometrical account at calculations of meshes or sub-meshes basing on geometrical
objects. These hypotheses allow you to manage the level of detail of objects. These hypotheses allow you to manage the level of detail of
the resulting meshes or submeshes: when applying different hypotheses the resulting meshes or sub-meshes: when applying different hypotheses
with different parameters you can preset the quantity of meshing with different parameters you can preset the quantity or size of
elements which will compose your mesh. So, it will be possible to elements which will compose your mesh. So, it will be possible to
generate a coarse or a more refined mesh or sub-mesh. generate a coarse or a more refined mesh or sub-mesh.
In \b MESH there are the following Basic Hypotheses (to introduce In \b MESH there are the following Basic Hypotheses:
them, you operate numerical values):
<ul> <ul>
<li>\subpage a1d_meshing_hypo_page "1D Hypotheses" (for meshing of <li>\subpage a1d_meshing_hypo_page "1D Hypotheses" (for meshing of
<b>edges</b>):</li> <b>edges</b>):</li>
@ -49,9 +48,8 @@ with other hypotheses:
The choice of a hypothesis depends on: The choice of a hypothesis depends on:
<ul> <ul>
<li>the geometrical object (shape) which will be meshed</li>
<li>the algorithm, which will be selected for meshing of this geometrical object (shape)</li> <li>the algorithm, which will be selected for meshing of this geometrical object (shape)</li>
<li>the geometrical object (shape) which will be meshed</li>
</ul> </ul>
*/ */

View File

@ -53,8 +53,8 @@ segments on all four sides of the face must be even (divisible by 2).
<h2>Viscous Layers and Viscous Layers 2D</h2> <h2>Viscous Layers and Viscous Layers 2D</h2>
<b>Viscous Layers</b> and <b>Viscous Layers 2D </b> additional <b>Viscous Layers</b> and <b>Viscous Layers 2D </b> additional
hypotheses can be used together with some 3D algorithms, for example, hypotheses can be used together with either some 3D algorithms, for example
Hexahedron(i,j,k) or 2D algorithms, for example, Triangle Hexahedron(i,j,k), or 2D algorithms, for example Triangle
(MEFISTO), correspondingly. These hypotheses allow creation of layers (MEFISTO), correspondingly. These hypotheses allow creation of layers
of highly stretched elements, prisms in 3D and quadrilaterals in 2D, of highly stretched elements, prisms in 3D and quadrilaterals in 2D,
near mesh boundary, which is beneficial for high quality viscous near mesh boundary, which is beneficial for high quality viscous
@ -67,16 +67,32 @@ computations.
<li><b>Total thickness</b> - gives the total thickness of element layers.</li> <li><b>Total thickness</b> - gives the total thickness of element layers.</li>
<li><b>Number of layers</b> - defines the number of element layers.</li> <li><b>Number of layers</b> - defines the number of element layers.</li>
<li><b>Stretch factor</b> - defines the growth factor of element height <li><b>Stretch factor</b> - defines the growth factor of element height
from the mesh boundary inwards.</li> from the mesh boundary inwards.</li>
<li><b>Faces (Edges) without layers</b> - defines geometrical faces <li><b>Specified Edges are</b> - defines how the shapes specified by
(or edges in 2D) on which element layers should not be the next parameter are used.
constructed. By default the element layers are not constructed on <li><b>Faces without layers</b> and <b>Edges with/without layers</b> -
geometrical faces shared by solids (and edges shared by faces in 2D). in the 3D case it defines geometrical faces on which element layers
should not be constructed; in the 2D case it defines geometrical edges
on which element layers either should be or should not be
constructed, depending on the value of the previous parameter
(<b>Specified Edges are</b>).
\note A mesh shown in the 3D Viewer can prevent selection of faces \note A mesh shown in the 3D Viewer can prevent selection of faces
and edges, in this case just hide the mesh. To avoid a long wait when a and edges, just hide the mesh to avoid this. To avoid a long wait when a
geometry with many faces (or edges) is displayed, the number of faces geometry with many faces (or edges) is displayed, the number of faces
(edges) shown at a time is limited by the value of "Sub-shapes (edges) shown at a time is limited by the value of "Sub-shapes
preview chunk size" preference (in Preferences/Mesh/General tab). preview chunk size" preference (in Preferences/Mesh/General tab).<br>
Whatever shapes are specified by this
parameter, the element layers are not constructed on geometrical
faces shared by several solids in 3D case and edges shared by
several faces in 2D case. In other words the element layers can be
constructed on boundary faces and edges, and are not constructed on
internal faces and edges. There is an exception to this rule in 2D
case: if "Viscous Layers 2D" hypothesis is assigned to a sub-mesh,
the element layers can be constructed on boundary edges of the shape
of this sub-mesh.
\image html viscous_layers_on_submesh.png 2D viscous layers constructed on boundary edges of a sub-mesh on a disk face.
</li> </li>
</ul> </ul>

View File

@ -0,0 +1,11 @@
/*!
\page arranging_study_objects_page Arranging objects in study
If sub-meshes or groups container item has more than one child sub-object, then there is a possibility to sort these children in ascending order.
To use sort functionality select "Sort children" popup menu item for the parent object.
\image html smesh_sort.png "Sorting of sub-objects"
*/

View File

@ -30,13 +30,13 @@ quadrangular elements.</li>
\image html image124.gif "Example of a quadrangular 2D mesh" \image html image124.gif "Example of a quadrangular 2D mesh"
<li>For meshing of 3D entities (<b>volume objects</b>):</li> <li>For meshing of 3D entities (<b>solid objects</b>):</li>
<ul> <ul>
<li>Hexahedron meshing algorithm (i,j,k) - 6-sided Volumes are split into <li>Hexahedron meshing algorithm (i,j,k) - 6-sided Solids are split into
hexahedral (cubic) elements.</li> hexahedral (cubic) elements.</li>
<li>\subpage cartesian_algo_page</li> <li>\subpage cartesian_algo_page</li>
- internal parts of Volumes are split into hexahedral elements forming a - internal parts of Solids are split into hexahedral elements forming a
Cartesian grid; polyhedra and other types of elements are generated Cartesian grid; polyhedra and other types of elements are generated
where the geometrical boundary intersects Cartesian cells.</li> where the geometrical boundary intersects Cartesian cells.</li>
</ul> </ul>

View File

@ -251,7 +251,7 @@ And the last mesh computation is made with:
<em>"Result mesh with order SubMesh_3, SubMesh_2, SubMesh_1 "</em></center> <em>"Result mesh with order SubMesh_3, SubMesh_2, SubMesh_1 "</em></center>
As we can see, each mesh computation has a different number of result As we can see, each mesh computation has a different number of result
elements and a different mesh discretisation on the shared edges (the edges elements and a different mesh discretization on the shared edges (the edges
that are shared between <b>Face_1</b>, <b>Face_2</b> and <b>Face_3</b>) that are shared between <b>Face_1</b>, <b>Face_2</b> and <b>Face_3</b>)
Additionally, submesh priority (the order of applied algorithms) can Additionally, submesh priority (the order of applied algorithms) can

View File

@ -1,36 +1,37 @@
/*! /*!
\page double_nodes_page Duplicate Nodes \page double_nodes_page Duplicate Nodes or/and Elements
\n This operation allows to duplicate nodes of your mesh, which can be \n This operation allows to duplicate nodes or/and elements of your mesh.
useful to emulate a crack in the model. Duplication of nodes can be useful to emulate a crack in the model.
Duplication consists in replacement of an existing mesh element by another one. Duplication consists in creation of mesh element "equal" to existing ones.
Lower level elements of the duplicated ones are cloned automatically.
<em>To duplicate nodes:</em> <em>To duplicate nodes or/and elements:</em>
<ol> <ol>
<li>From the \b Modification menu choose \b Transformation -> \b Duplicate <li>From the \b Modification menu choose \b Transformation -> <b> Duplicate
\b Nodes item or click <em>"Duplicate Nodes"</em> button in the toolbar. Nodes or/and Elements </b> item or click <em>"Duplicate Nodes or/and
Elements"</em> button in the toolbar.
<br> <br>
\image html duplicate_nodes.png "Duplicate Nodes button" \image html duplicate_nodes.png "Duplicate Nodes or/and Elements button"
</li> </li>
<li>Check in the dialog box one of two radio buttons corresponding to <li>Check in the dialog box one of three radio buttons corresponding to
the type of nodes duplication operation you would like to perform.</li> the type of duplication operation you would like to perform.</li>
<li>Fill the other fields available in the dialog box (depends on the chosen <li>Fill the other fields available in the dialog box (depending on
operation mode).</li> the chosen operation mode).</li>
<li>Click the \b Apply or <b>Apply and Close</b> button to perform the operation of nodes <li>Click the \b Apply or <b>Apply and Close</b> button to perform the
duplication.</li> operation of duplication.</li>
</ol> </ol>
\n "Duplicate Nodes" dialog has two working modes: \n "Duplicate Nodes or/and Elements" dialog has three working modes:
<ul> <ul>
<li>\ref mode_without_elem_anchor "Without the duplication of border elements"</li> <li>\ref mode_without_elem_anchor "Duplicate nodes only"</li>
<li>\ref mode_with_elem_anchor "With the duplication of border elements"</li> <li>\ref mode_with_elem_anchor "Duplicate nodes and border elements"</li>
<li>\ref mode_elem_only_anchor "Duplicate elements only"</li>
</ul> </ul>
<br> <br>
\anchor mode_without_elem_anchor \anchor mode_without_elem_anchor
<h2>Without duplication of border elements</h2> <h2>Duplicate nodes only</h2>
In this mode the dialog looks like: In this mode the dialog looks like:
@ -38,16 +39,29 @@ In this mode the dialog looks like:
Parameters to be defined in this mode: Parameters to be defined in this mode:
<ul> <ul>
<li><b>Group of nodes to duplicate</b> (<em>mandatory</em>): these nodes will be duplicated.</li> <li><b>Group of nodes to duplicate</b> (<em>mandatory</em>): these
<li><b>Group of elements to replace nodes with new ones</b> (<em>optional</em>): the duplicated nodes nodes will be duplicated.</li>
will be associated with these elements.</li> <li><b>Group of elements to replace nodes with new ones</b>
<li><b>Construct group with newly created nodes</b> option (<em>checked by default</em>): (<em>optional</em>): the new nodes will replace the nodes to
if checked - the group with just created nodes will be built.</li> duplicate within these elements.</li>
<li><b>Construct group with newly created nodes</b> option
(<em>checked by default</em>): if checked - the group with just
created nodes will be built.</li>
</ul> </ul>
A schema below explains the crack emulation using the node duplication.
\image html crack_emulation_double_nodes.png "Crack emulation"
This schema shows a virtual crack in a 2D mesh created using this duplication
mode. In this schema:
- Black balls are <b>nodes to duplicate</b>.
- Red balls are <b>new nodes</b>.
- <b>Elements to replace nodes with new ones</b> are marked with green.
Note that in reality <b>nodes to duplicate</b> coincide with <b>new nodes</b>.
<br> <br>
\anchor mode_with_elem_anchor \anchor mode_with_elem_anchor
<h2>With duplication of border elements</h2> <h2>Duplicate nodes and border elements</h2>
In this mode the dialog looks like: In this mode the dialog looks like:
@ -55,18 +69,62 @@ In this mode the dialog looks like:
Parameters to be defined in this mode: Parameters to be defined in this mode:
<ul> <ul>
<li><b>Group of elements to duplicate</b> (<em>mandatory</em>): these elements will be duplicated.</li> <li><b>Group of elements to duplicate</b> (<em>mandatory</em>): these
<li><b>Group of nodes at not to duplicate</b> (<em>optional</em>): group of nodes at crack bottom elements will be duplicated.</li>
which will not be duplicated.</li> <li><b>Group of nodes not to duplicate</b> (<em>optional</em>):
<li><b>Group of elements to replace nodes with new ones</b> (<em>mandatory</em>): the duplicated nodes group of nodes at crack bottom which will not be duplicated.</li>
will be associated with these elements.</li> <li><b>Group of elements to replace nodes with new ones</b>
<li><b>Construct group with newly created elements</b> option (<em>checked by default</em>): (<em>mandatory</em>): the new nodes will replace the nodes to
if checked - the group of just created elements will be built.</li> duplicate within these elements.</li>
<li><b>Construct group with newly created nodes</b> option (<em>checked by default</em>): <li><b>Construct group with newly created elements</b> option
if checked - the group of just created nodes will be built.</li> (<em>checked by default</em>): if checked - the group of just created
elements will be built.</li>
<li><b>Construct group with newly created nodes</b> option
(<em>checked by default</em>): if checked - the group of just
created nodes will be built.</li>
</ul>
A schema below explains the crack emulation using the node duplication
with border elements.
\image html crack_emulation_double_nodes_with_elems.png "Crack emulation"
This schema shows a virtual crack in a 2D mesh created using this duplication
mode. In this schema:
- Black segments are <b>elements to duplicate</b> (edges in 2D case).
- Black balls (except the lowest one) are nodes of <b>elements to
duplicate</b> that are duplicated.
- The lowest black ball is a <b>node not to duplicate</b>.
- Red balls are <b>creates nodes</b>.
- Red segments are <b>created elements</b> (edges).
- <b>Elements to replace nodes with new ones</b> are marked with green.
Note that in reality <b>nodes to duplicate</b> coincide with <b>new nodes</b>.
<br>
In a 3D case, where <b>elements to duplicate</b> are faces, the edges
located at the "crack" (if any) are cloned automatically.
<br>
\anchor mode_elem_only_anchor
<h2>Duplicate elements only</h2>
This mode just duplicates given elements, i.e. creates new elements on
the same nodes as the given elements.
<br>
In this mode the dialog looks like:
\image html duplicate03.png
Parameters to be defined in this mode:
<ul>
<li><b>Group of elements to duplicate</b> (<em>mandatory</em>): these
elements will be duplicated.</li>
<li><b>Construct group with newly created elements</b> option
(<em>checked by default</em>): if checked - the group of just created
elements will be built. A name of the created group starts from
"DoubleElements".</li>
</ul> </ul>
<br><b>See Also</b> a sample TUI Script of a \ref tui_duplicate_nodes "Duplicate nodes" operation. <br><b>See Also</b> a sample TUI Script of a
\ref tui_duplicate_nodes "Duplicate nodes or/and elements" operation.
*/ */

View File

@ -2,19 +2,22 @@
\page importing_exporting_meshes_page Importing and exporting meshes \page importing_exporting_meshes_page Importing and exporting meshes
\n In MESH there is a functionality allowing importation/exportation \n In MESH there is a functionality allowing import/export
of meshes from/to \b MED, \b UNV (I-DEAS 10), \b DAT (simple ascii format), \b STL, of meshes from/to \b MED, \b UNV (I-DEAS 10), \b DAT (simple ascii format), \b STL,
\b GMF (internal format of DISTENE products, namely BLSurf, GHS3D and Hexotic algorithms) and \b CGNS format files. You can also export a group as a whole mesh. \b GMF (internal format of DISTENE products, namely BLSurf, GHS3D and
Hexotic algorithms) and \b CGNS format files. You can also export a
group as a whole mesh.
<em>To import a mesh:</em> <em>To import a mesh:</em>
<ol> <ol>
<li>From the \b File menu choose the \b Import item, from its sub-menu <li>From the \b File menu choose the \b Import item, from its sub-menu
select the corresponding format (MED, UNV, STL, GMF and CGNS) of the file containing select the corresponding format (MED, UNV, STL, GMF and CGNS) of the
your mesh.</li> file containing your mesh.</li>
<li>In the standard <b>Search File</b> dialog box find the file for <li>In the standard <b>Search File</b> dialog box find the file for
importation. It is possible to select multiple files to be imported all at once. </li> import. It is possible to select multiple files to be imported all at
once. </li>
<li>Click the \b OK button.</li> <li>Click the \b OK button.</li>
</ol> </ol>
@ -24,17 +27,35 @@ importation. It is possible to select multiple files to be imported all at once.
<em>To export a mesh or a group:</em> <em>To export a mesh or a group:</em>
<ol> <ol>
<li>Select the object you wish to export.</li> <li>Select the object you wish to export.</li>
<li>From the \b File menu choose the \b Export item, from its sub-menu <li>From the \b File menu choose the \b Export item, from its sub-menu
select the format (MED, UNV, DAT, STL, GMF and CGNS) of the file which will select the format (MED, UNV, DAT, STL, GMF and CGNS) of the file which will
contain your exported mesh.</li> contain your exported mesh.</li>
<li>In the standard <b>Search File</b> select a location for the <li>In the standard <b>Search File</b> select a location for the
exported file and enter its name.</li> exported file and enter its name.</li>
<li>Click the \b OK button.</li> <li>Click the \b OK button.</li>
</ol> </ol>
\image html meshexportmesh.png \image html meshexportmesh.png
At export to MED and SAUV format files additional parameters are available.
<ul>
<li><b>Automatically create groups</b> check-box specifies whether to
create groups of all mesh entities of available dimensions or
not. If checked, the created groups have names like "Group_On_All_Nodes",
"Group_On_All_Faces" etc.</li>
<li><b>Automatically define space dimension</b> check-box specifies
whether to define space dimension for export by mesh configuration
or not. Usually the mesh is exported as a mesh in 3D space, just as
it is in Mesh module. The mesh can be exported as a mesh in lower
dimension in following cases, provided that this check-box is
checked.
<ul>
<li> 1D: if all mesh nodes lie on OX coordinate axis. </li>
<li> 2D: if all mesh nodes lie on XOY coordinate plane. </li>
</ul>
</li>
</ul>
<br><b>See Also</b> a sample TUI Script of an \ref tui_export_mesh "Export Mesh" operation. <br><b>See Also</b> a sample TUI Script of an \ref tui_export_mesh "Export Mesh" operation.
*/ */

View File

@ -23,6 +23,9 @@ array of dedicated operations;</li>
\subpage using_notebook_mesh_page "Salome notebook".</li> \subpage using_notebook_mesh_page "Salome notebook".</li>
</ul> </ul>
The possibility to sort the created sub-meshes or groups is detailed on
\subpage arranging_study_objects_page section.
Mesh module preferences are described in the \subpage mesh_preferences_page section of SALOME Mesh Help. Mesh module preferences are described in the \subpage mesh_preferences_page section of SALOME Mesh Help.
Almost all mesh module functionalities are accessible via Almost all mesh module functionalities are accessible via

View File

@ -15,11 +15,13 @@ in the toolbar.
The <b>Mesh Information</b> dialog box provides three tab pages: The <b>Mesh Information</b> dialog box provides three tab pages:
- <b>\ref advanced_mesh_infos_anchor "Base Info"</b> - to show base - <b>\ref advanced_mesh_infos_anchor "Base Info"</b> - to show base
information about the selected mesh object information about the selected mesh object.
- <b>\ref mesh_element_info_anchor "Element Info"</b> - to show - <b>\ref mesh_element_info_anchor "Element Info"</b> - to show
detailed information about the selected mesh node or element. detailed information about the selected mesh node or element.
- <b>\ref mesh_addition_info_anchor "Additional Info"</b> - to show additional information available - <b>\ref mesh_addition_info_anchor "Additional Info"</b> - to show additional information available
for the selected mesh, sub-mesh or group object. for the selected mesh, sub-mesh or group object.
- <b>\ref mesh_quality_info_anchor "Quality Info"</b> - to show
overall quality information about the selected mesh, sub-mesh or group object.
\anchor advanced_mesh_infos_anchor \anchor advanced_mesh_infos_anchor
<h2>Base Information</h2> <h2>Base Information</h2>
@ -119,6 +121,39 @@ automatically calculated if the size of the group does not exceed
the "Automatic nodes compute limit" set via the "Mesh information" the "Automatic nodes compute limit" set via the "Mesh information"
preferences (zero value means no limit). preferences (zero value means no limit).
\anchor mesh_quality_info_anchor
<h2>Quality Information</h2>
The <b>Quality Info</b> tab page of the dialog box provides overal
mesh quality controls information on the selected object - mesh,
sub-mesh or mesh group:
- Name;
- Nodes information:
- Number of the free nodes;
- Number of double nodes;
- Edges information:
- Number of double edges;
- Faces information:
- Number of double faces;
- Number of over-constrained faces;
- Aspect Ratio histogram;
- Volume information:
- Number of double volumes;
- Number of over-constrained volumes;
- Aspect Ratio 3D histogram.
<center>\image html ctrlinfo.png
<em>"Quality Info" page</em></center>
\note User can set "Double nodes tolerance" in the dialog for local change
or via the "Quality controls" in Mesh preferences.
\note For the perfomance reason, all quality control values for the big meshes are
computed only by demand. For this, the user should press the "compute"
button (see picture). Also, values are automatically computed if the number of the
nodes / elements does not exceed the "Automatic controls compute limit" set
via the "Mesh information" preferences (zero value means no limit).
The button \b "Dump" allows printing the information displayed in the The button \b "Dump" allows printing the information displayed in the
dialog box to a .txt file. dialog box to a .txt file.

View File

@ -9,213 +9,227 @@ later sessions with this module.
\image html pref21.png \image html pref21.png
<ul> - <b>Automatic Update</b>
<li><b>Automatic Update</b></li> - If you toggle <b>Automatic Update</b> checkbox, the model in your
<ul> viewer automatically updated when you make changes in it, depending on
<li>If you toggle <b>Automatic Update</b> checkbox, the model in your values of additional preferences specified below.
viewer automatically updated whenever you make changes in it.</li> - <b>Size limit (elements)</b> - allows to specify the maximum
<li><b>Size limit (elements)</b> - allows to specify the maximum number of elements in the resulting mesh for which the automatic updating
number of elements in the resulting mesh for which the automatic updating of the presentation is performed. This option affects only
of the presentation is performed. This option affects only <b>Compute</b> operation. Zero value means "no limit". Default value
<b>Compute</b> operation. Zero value means "no limit". Default value is 500 000 mesh elements.
is 500 000 mesh elements. - <b>Incremental limit check</b> - when this control is switched on,
</ul> check for mesh size limit will be applied not to total number of
<li><b>Quality Controls</b></li> elements in resulting mesh, but iteratively to each entity types
<ul> in the following order: 0D elements, edges, faces, volumes, balls;
<li>If you toggle <b>Display entity</b>, both faces and edges of an at each step number of entities of given type will be added to the
object will be displayed in the viewer by default.</li> total number of elements computed at previous step - if resulting
<li>If you toggle <b>Use precision</b> checkbox, you can display numbers in number of elements does not exceed size limit, the entities of
<b>Quality Control</b> diagrams at the necessary level of precision.</li> this type will be shown, otherwise user will be warned that some
<li><b>Number of digits after point</b> - defines precision for <b>Quality Controls</b>. By default, numbers in <b>Quality Control</b> entities are not shown.
diagrams are presented as integers.</li>
<li><b>Double nodes tolerance</b> defines the maximal distance between two - <b>Quality Controls</b>
mesh nodes, at which they are considered coincident by <b>Double nodes</b> - If you toggle <b>Display entity</b>, both faces and edges of an
quality control. object will be displayed in the viewer by default.
</ul> - If you toggle <b>Use precision</b> checkbox, you can display numbers in
<li><b>Display mode</b> - allows to set Wireframe, Shading, Nodes or Shrink <b>Quality Control</b> diagrams at the necessary level of precision.
presentation mode as default.</li> - <b>Number of digits after point</b> - defines precision for
<li><b>Representation of the 2D quadratic elements</b></li> <b>Quality Controls</b>. By default, numbers in <b>Quality Control</b>
<ul> diagrams are presented as integers.
<li><b>Representation of the 2D quadratic elements</b> combobox - allows - <b>Double nodes tolerance</b> defines the maximal distance between two
to select lines or arcs for representation of quadratic elements.</li> mesh nodes, at which they are considered coincident by <b>Double nodes</b>
<li><b>Maximum Angle</b> - maximum deviation angle used by the quality control.
application to build arcs. </li>
</ul> - <b>Display mode</b> - allows to set Wireframe, Shading, Nodes or Shrink
<li><b>Mesh export</b></li> presentation mode as default.
<ul>
<li>If you toggle <b>Automatically create groups for MED export</b> checkbox, - <b>Representation of the 2D quadratic elements</b>
this operation will be carried out automatically.</li> - <b>Representation of the 2D quadratic elements</b> combobox - allows
<li>If you toggle <b>Automatic renumbering</b> checkbox, the exported to select lines or arcs for representation of quadratic elements.
mesh will be renumbered automatically</li> - <b>Maximum Angle</b> - maximum deviation angle used by the
</ul> application to build arcs.
<li><b>Mesh computation</b></li>
<ul> - <b>Mesh export</b>
<li><b>Show a computation result notification</b> combobox allows to - If you toggle <b>Automatically create groups for MED export</b> checkbox,
select the notification mode about a mesh computation result. this operation will be carried out automatically.
There are 3 possible modes:</li>
<ul> - <b>Mesh computation</b>
<li><b>Never</b> - do not show the result dialog at all;</li> - <b>Show a computation result notification</b> combobox allows to
<li><b>Errors only</b> - the result dialog will be shown if there were select the notification mode about a mesh computation result.
some errors during a mesh computation;</li> There are 3 possible modes:
<li><b>Always</b> - show the result dialog after each mesh - <b>Never</b> - do not show the result dialog at all;
computation. This is a default mode.</li> - <b>Errors only</b> - the result dialog will be shown if there were
</ul></ul> some errors during a mesh computation;
<li><b>Mesh information</b></li> - <b>Always</b> - show the result dialog after each mesh
<ul> computation. This is a default mode.
<li><b>Mesh element information</b></li> - Change the way mesh element
information is shown: - <b>Mesh information</b>
<ul> - <b>Mesh element information</b> - change the way mesh element
<li><b>Simple</b> - as a plain text</li> information is shown:
<li><b>Tree</b> - in a tree-like form</li> - <b>Simple</b> - as a plain text
</ul> - <b>Tree</b> - in a tree-like form
<li><b>Automatic nodes compute limit</b></li> - allows to define the size limit for the - <b>Automatic nodes compute limit</b> - allows to define the size limit for the
mesh groups for which the number of underlying nodes is calculated mesh groups for which the number of underlying nodes is calculated
automatically. If the group size exceeds the value set in the preferences, automatically. If the group size exceeds the value set in the preferences,
the user will have to press \em Compute button explicitly. Zero value the user will have to press \em Compute button explicitly. Zero value
means "no limit". By default the value is set to 100 000 mesh elements. means "no limit". By default the value is set to 100 000 mesh elements.
</li> - <b>Automatic controls compute limit</b> - allows to define the size limit for the
<li><b>Show details on groups in element information tab</b> - when mesh elements for which the Aspect Ratio histogram is calculated
this option is switched off (default), only the names of groups, to which the node automatically. If the mesh elements size exceeds the value set in the preferences,
or element belongs, are shown in the \ref mesh_element_info_anchor "Info Tab" the user will have to press \em Compute button explicitly. Zero value
tab of "Mesh Information" dialog box. If this option is means "no limit". By default the value is set to 3 000 mesh elements.
switched on, the detailed information on groups is shown.</li> - <b>Show details on groups in element information tab</b> - when
<li><b>Dump base information</b> - allows to dump base mesh information to the this option is switched off (default), only the names of groups, to which the node
file, see \ref mesh_infos_page.</li> or element belongs, are shown in the \ref mesh_element_info_anchor "Info Tab"
<li><b>Dump element information</b> - allows to dump element information to the tab of "Mesh Information" dialog box. If this option is
file, see \ref mesh_infos_page.</li> switched on, the detailed information on groups is shown.
<li><b>Dump additional information</b> - allows to dump additional mesh - <b>Dump base information</b> - allows to dump base mesh information to the
information to the file, see \ref mesh_infos_page.</li> file, see \ref mesh_infos_page.
</ul> - <b>Dump element information</b> - allows to dump element information to the
<li><b>Automatic Parameters</b></li> file, see \ref mesh_infos_page.
<ul> - <b>Dump additional information</b> - allows to dump additional mesh
<li><b>Ratio Bounding Box Diagonal / Max Size</b> - this parameter is information to the file, see \ref mesh_infos_page.
used for automatic meshing: ratio between the bounding box of the - <b>Dump controls information</b> - allows to dump quality mesh
meshed object and the Max Size of segments.</li> information to the file, see \ref mesh_infos_page.
<li><b>Default Number of Segments</b> - allows defining the default
number of segments on each edge</li> - <b>Automatic Parameters</b>
</li></ul> - <b>Ratio Bounding Box Diagonal / Max Size</b> - this parameter is
<li><b>Mesh loading</b></li> used for automatic meshing: ratio between the bounding box of the
<ul> meshed object and the Max Size of segments.
<li>If <b>No mesh loading from study file at hypothesis modification</b> - <b>Default Number of Segments</b> - allows defining the default
checkbox is on, the mesh data will not be loaded from the study file number of segments on each edge.
when a hypothesis is modified. This allows saving time by omitting
loading data of a large mesh that is planned to be recomputed with other parameters.</li> - <b>Mesh loading</b>
</ul> - If <b>No mesh loading from study file at hypothesis modification</b>
<li><b>Input fields precision</b></li> checkbox is on, the mesh data will not be loaded from the study file
<ul> when a hypothesis is modified. This allows saving time by omitting
<li><b>Length precision</b> - allows to adjust input precision of coordinates and dimensions.</li> loading data of a large mesh that is planned to be recomputed with other parameters.
<li><b>Angular precision</b> - allows to adjust input precision of angles.</li>
<li><b>Length tolerance precision</b> - allows to adjust input precision of tolerance of coordinates and dimensions.</li> - <b>Input fields precision</b>
<li><b>Parametric precision</b> - allows to adjust input precision of parametric values.</li> - <b>Length precision</b> - allows to adjust input precision of coordinates and dimensions.
<li><b>Area precision</b> - allows to adjust input precision of mesh element area.</li> - <b>Angular precision</b> - allows to adjust input precision of angles.
<li><b>Volume precision</b> - allows to adjust input precision of mesh element volume.</li> - <b>Length tolerance precision</b> - allows to adjust input precision of tolerance of coordinates and dimensions.
</ul> - <b>Parametric precision</b> - allows to adjust input precision of parametric values.
<li><b>Preview</b></li> - <b>Area precision</b> - allows to adjust input precision of mesh element area.
<ul> - <b>Volume precision</b> - allows to adjust input precision of mesh element volume.
<li><b>Sub-shapes preview chunk size</b> - allows to limit the number
of previewed sub-shapes shown in the hypotheses creation dialog boxes, - <b>Preview</b>
for example "Reverse Edges" parameter of \ref number_of_segments_anchor "Number of segments" hypothesis. - <b>Sub-shapes preview chunk size</b> - allows to limit the number
</ul> of previewed sub-shapes shown in the hypotheses creation dialog boxes,
<li><b>Python Dump</b></li> for example "Reverse Edges" parameter of \ref number_of_segments_anchor "Number of segments" hypothesis.
<ul>
<li><b>Historical python dump</b> checkbox allows switching between - <b>Python Dump</b>
\a Historical and \a Snapshot dump mode. In \a - <b>Historical python dump</b> checkbox allows switching between
Historical mode, Python Dump script includes all commands \a Historical and \a Snapshot dump mode:
performed by SMESH engine. In \a Snapshot mode, the commands - In \a Historical mode, Python Dump script includes all commands
relating to objects removed from the Study as well as the commands performed by SMESH engine.
not influencing the current state of meshes are excluded from the script.</li> - In \a Snapshot mode, the commands relating to objects removed
</ul> from the Study as well as the commands not influencing the
</ul> current state of meshes are excluded from the script.
<h2>Mesh Preferences</h2> <h2>Mesh Preferences</h2>
\image html pref22.png \image html pref22.png
<ul> - <b>Nodes</b>
<li><b>Nodes</b></li> - <b>Color</b> - allows to select the color of nodes. Click on the
<ul> colored line to access to the <b>Select Color</b> dialog box.
<li><b>Color</b> - allows to select the color of nodes. Click on the - <b>Type of marker</b> - allows to define the shape of nodes.
colored line to access to the <b>Select Color</b> dialog box.</li> - <b>Scale of marker</b> - allows to define the size of nodes.
<li><b>Type of marker</b> - allows to define the shape of nodes.</li>
<li><b>Scale of marker</b> - allows to define the size of nodes.</li> - <b>Elements</b>
</ul> - <b>Surface color</b> - allows to select the surface color of 2D elements
<li><b>Elements</b></li> (seen in Shading mode). Click on the colored line to access to the
<ul> <b>Select Color</b> dialog box.
<li><b>Surface color</b> - allows to select the surface color of elements - <b>Back surface color</b> - allows to select the back surface color
(seen in Shading mode). Click on the colored line to access to the <b>Select Color</b> dialog box.</li> of 2D elements. This is useful to differ 2d elements with
<li><b>Back surface color</b> - allows to select the interior surface color reversed orientation. Use the slider to select the color generated basing on
of elements. Use the slider to select the color generated basing on the <b>Surface color</b> by changing its brightness and saturation.
the <b>Surface color</b> by changing its brightness and saturation.</li> - <b>Volume color</b> - allows to select the surface color of 3D elements
<li><b>Outline color</b> - allows to select the color of element (seen in Shading mode).
borders. Click on the colored line to access to the <b>Select Color</b> dialog box.</li> - <b>Reversed volume color</b> - allows to select the surface color
<li><b>Wireframe color</b> - allows to select the color of borders of of reversed 3D elements. Use the slider to select the color generated basing on
elements in the wireframe mode. Click on the colored line to access to the <b>Select Color</b> dialog box.</li> the <b>Volume color</b> by changing its brightness and saturation.
<li><b>Width</b> - allows to define the width of lines (edges and borders of elements).</li> - <b>0D elements</b> - allows to choose color of 0D mesh elements.
<li><b>Shrink coef.</b> - allows to define relative space of elements - <b>Balls</b> - allows to choose color of discrete mesh elements (balls).
compared to gaps between them in shrink mode.</li> - <b>Outline color</b> - allows to select the color of element
</ul> borders.
<li><b>Orientation of Faces</b> - allows to define the behavior of - <b>Wireframe color</b> - allows to select the color of borders of
<b>Orientation of faces</b> functionality</li> elements in the wireframe mode.
<ul> - <b>Size of 0D elements</b> - specifies default size of 0D elements.
<li> \b Color - allows to define the color of orientation vertors;</li> - <b>Size of ball elements</b> - specifies default size of discrete
<li> \b Scale - allows to define the size of orientation vectors;</li> elements (balls).
<li> <b> 3D Vector </b> checkbox allows to choose between 2D planar - <b>Line width</b> - allows to define the width of 1D elements (edges).
and 3D vectors.</li> - <b>Outline width</b> - allows to define the width of borders of
</ul> 2D and 3D elements (shown in the Shading mode).
</ul> - <b>Shrink coef.</b> - allows to define relative space of elements
compared to gaps between them in shrink mode.
- <b>Groups</b> allows to define groups default properties:
- <b>Names color</b> - specifies color of group names to be used in
3D viewer.
- <b>Default color</b> - specifies default group color.
- <b>Numbering</b> allows to define properties of numbering functionality:
- <b>Nodes</b> - specifies text properties of nodes numbering
(font family, size, attributes, color).
- <b>Elements</b> - same for elements.
- <b>Orientation of Faces</b> - allows to define the behavior of
<b>Orientation of faces</b> functionality:
- \b Color - allows to define the color of orientation vertors;
- \b Scale - allows to define the size of orientation vectors;
- <b>3D Vector</b> checkbox allows to choose between 2D planar
and 3D vectors.
<br><h2>Selection Preferences</h2> <br><h2>Selection Preferences</h2>
\image html pref23.png \image html pref23.png
<ul> - <b>Selection</b> - performed with mouse-indexing (preselection)
<li><b>Selection</b> - performed with mouse-indexing (preselection) and left-clicking on an object, whose appearance changes as defined in
and left-clicking on an object, whose appearance changes as defined in the <b>Preferences</b>.
the <b>Preferences</b>.</li> - <b>Object Color</b> - allows to select the color of mesh (edges and
<ul> borders of meshes) of the selected entity. Click on the colored line
<li><b>Object Color</b> - allows to select the color of mesh (edges and to access to the <b>Select Color</b> dialog box.
borders of meshes) of the selected entity. Click on the colored line - <b>Element color</b> - allows to select the color of surface of selected
to access to the <b>Select Color</b> dialog elements (seen in Shading mode). Click on the colored line to access
box.</li> to the <b>Select Color</b> dialog box.
<li><b>Element color</b> - allows to select the color of surface of selected
elements (seen in Shading mode). Click on the colored line to access - <b>Preselection</b> - performed with mouse-indexing on an object,
to the <b>Select Color</b> dialog box.</li> whose appearance changes as defined in the <b>Preferences</b>.
</ul> - <b>Highlight Color</b> - allows to select the color of mesh (edges and
<li><b>Preselection</b> - performed with mouse-indexing on an object, borders of meshes) of the entity . Click on the colored line to access
whose appearance changes as defined in the <b>Preferences</b>.</li> to the <b>Select Color</b> dialog box.
<ul>
<li><b>Highlight Color</b> - allows to select the color of mesh (edges and - <b>Precision</b> - in this menu you can set the value of precision
borders of meshes) of the entity . Click on the colored line to access used for <b>Nodes</b>, <b>Elements</b> and <b>Objects</b>.
to the <b>Select Color</b> dialog box.</li>
</ul>
<li><b>Precision</b> - in this menu you can set the value of precision
used for <b>Nodes</b>, <b>Elements</b> and <b>Objects</b>.</li>
</ul>
<br><h2>Scalar Bar Preferences</h2> <br><h2>Scalar Bar Preferences</h2>
\image html pref24.png \image html pref24.png
<ul> - <b>Font</b> - in this menu you can set type, face and color for
<li><b>Font</b> - in this menu you can set type, face and color for the font of <b>Title</b> and <b>Labels</b>.
the font of <b>Title</b> and <b>Labels</b>.</li>
<li><b>Colors & Labels</b> - in this menu you can set the <b>number of - <b>Colors & Labels</b> - in this menu you can set the <b>number of
colors</b> and the <b>number of labels</b> in use.</li> colors</b> and the <b>number of labels</b> in use.
<li><b>Orientation</b> - here you can choose between vertical and
horizontal orientation of the <b>Scalar Bar</b></li>. - <b>Orientation</b> - here you can choose between vertical and
<li><b>Origin & Size Vertical & Horizontal</b> - allows to define horizontal orientation of the <b>Scalar Bar</b>
placement (<b>X</b> and <b>Y</b>) and lookout (<b>Width</b> and
<b>Height</b>) of Scalar Bars</li> - <b>Origin & Size Vertical & Horizontal</b> - allows to define
<ul> placement (<b>X</b> and <b>Y</b>) and lookout (<b>Width</b> and
<li><b>X</b>: abscissa of the point of origin (from the left <b>Height</b>) of Scalar Bars.
side)</li> - <b>X</b>: abscissa of the point of origin (from the left
<li><b>Y</b>: ordinate of the origin of the bar (from the bottom)</li> side)
</ul> - <b>Y</b>: ordinate of the origin of the bar (from the bottom)
<li><b>Distribution</b> in this menu you can Show/Hide distribution histogram of the values of the <b>Scalar Bar</b> and specify the <b>Coloring Type</b> of the histogram</li>
<ul> - <b>Distribution</b> in this menu you can Show/Hide distribution
<li><b>Multicolor</b> the histogram is colored as <b>Scalar Bar</b></li> histogram of the values of the <b>Scalar Bar</b> and specify the
<li><b>Monocolor</b> the histogram is colored as selected with <b>Distribution color</b> selector</li> <b>Coloring Type</b> of the histogram:
</ul> - <b>Multicolor</b> the histogram is colored as <b>Scalar Bar</b>
</ul> - <b>Monocolor</b> the histogram is colored as selected with
<b>Distribution color</b> selector
*/ */

View File

@ -22,7 +22,8 @@ the mesh or some of its elements.</li>
elements.</li> elements.</li>
<li>\subpage symmetry_page "Mirror" the mesh <li>\subpage symmetry_page "Mirror" the mesh
through a point or a vector of symmetry.</li> through a point or a vector of symmetry.</li>
<li>\subpage double_nodes_page "Duplicate nodes" to emulate a crack in the model.</li> <li>\subpage double_nodes_page "Duplicate nodes or/and
Elements". Duplication of nodes can be useful to emulate a crack in the model.</li>
<li>Unite meshes by \subpage sewing_meshes_page "sewing" free borders, <li>Unite meshes by \subpage sewing_meshes_page "sewing" free borders,
conform free borders, border to side or side elements.</li> conform free borders, border to side or side elements.</li>
<li>\subpage merging_nodes_page "Merge Nodes", considered coincident <li>\subpage merging_nodes_page "Merge Nodes", considered coincident

View File

@ -20,7 +20,7 @@
<br> <br>
\anchor tui_editing_mesh \anchor tui_editing_mesh
<h2>Editing of a mesh</h2> <h2>Editing a mesh</h2>
\tui_script{creating_meshes_ex04.py} \tui_script{creating_meshes_ex04.py}
<br> <br>

View File

@ -13,8 +13,8 @@ by flat elements.
\n Triangles are transformed into prisms, and quadrangles into hexahedrons. \n Triangles are transformed into prisms, and quadrangles into hexahedrons.
\n The flat elements are stored in groups of volumes. \n The flat elements are stored in groups of volumes.
These groups are named according to the position of the group in the list: These groups are named according to the position of the group in the list:
the group j_n_p is the group of the flat elements that are built between the group #n and the group #p in the list. the group j_n_p is the group of the flat elements that are built between the group \#n and the group \#p in the list.
If there is no shared faces between the group #n and the group #p in the list, the group j_n_p is not created. If there is no shared faces between the group \#n and the group \#p in the list, the group j_n_p is not created.
All the flat elements are gathered into the group named "joints3D" (or "joints2D" in 2D situation). All the flat elements are gathered into the group named "joints3D" (or "joints2D" in 2D situation).
The flat element of the multiple junctions between the simple junction are stored in a group named "jointsMultiples". The flat element of the multiple junctions between the simple junction are stored in a group named "jointsMultiples".

View File

@ -58,7 +58,7 @@
<br> <br>
\anchor tui_duplicate_nodes \anchor tui_duplicate_nodes
<h3>Duplicate nodes</h3> <h3>Duplicate nodes or/and elements</h3>
\tui_script{transforming_meshes_ex11.py} \tui_script{transforming_meshes_ex11.py}
<br> <br>

View File

@ -64,12 +64,10 @@ nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh)
libSalomeIDLSMESH_la_CPPFLAGS = \ libSalomeIDLSMESH_la_CPPFLAGS = \
-I$(top_builddir)/idl \ -I$(top_builddir)/idl \
$(CORBA_CXXFLAGS) $(CORBA_INCLUDES) \ $(CORBA_CXXFLAGS) $(CORBA_INCLUDES) \
$(KERNEL_CXXFLAGS) $(MED_CXXFLAGS) \ $(KERNEL_CXXFLAGS) $(GEOM_CXXFLAGS)
$(GEOM_CXXFLAGS)
libSalomeIDLSMESH_la_LDFLAGS = -no-undefined -version-info=0:0:0 libSalomeIDLSMESH_la_LDFLAGS = -no-undefined -version-info=0:0:0
libSalomeIDLSMESH_la_LIBADD = \ libSalomeIDLSMESH_la_LIBADD = \
@CORBA_LIBS@ \ @CORBA_LIBS@ \
$(MED_LDFLAGS) -lSalomeIDLMED \
$(GEOM_LDFLAGS) -lSalomeIDLGEOM \ $(GEOM_LDFLAGS) -lSalomeIDLGEOM \
$(KERNEL_LDFLAGS) -lSalomeIDLKernel $(KERNEL_LDFLAGS) -lSalomeIDLKernel
@ -80,7 +78,6 @@ OMNIORB_IDLPYFLAGS = \
@OMNIORB_IDLPYFLAGS@ \ @OMNIORB_IDLPYFLAGS@ \
-I$(top_builddir)/idl/salome \ -I$(top_builddir)/idl/salome \
-I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome \
-I$(MED_ROOT_DIR)/idl/salome \
-I$(GEOM_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome
IDLCXXFLAGS = \ IDLCXXFLAGS = \
@ -88,13 +85,11 @@ IDLCXXFLAGS = \
@IDLCXXFLAGS@ \ @IDLCXXFLAGS@ \
-I$(top_builddir)/idl/salome \ -I$(top_builddir)/idl/salome \
-I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome \
-I$(MED_ROOT_DIR)/idl/salome \
-I$(GEOM_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome
IDLPYFLAGS = \ IDLPYFLAGS = \
@IDLPYFLAGS@ \ @IDLPYFLAGS@ \
-I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome \
-I$(MED_ROOT_DIR)/idl/salome \
-I$(GEOM_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome
# potential problem on parallel make on the following - multiple outputs # potential problem on parallel make on the following - multiple outputs
@ -132,7 +127,7 @@ mostlyclean-local:
@for dep in $^ dummy; do \ @for dep in $^ dummy; do \
if [ $$dep != "dummy" ]; then \ if [ $$dep != "dummy" ]; then \
echo Building dependencies for $$dep; \ echo Building dependencies for $$dep; \
$(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \ $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \
sed 's/\.o/\SK.cc/' >>$@; \ sed 's/\.o/\SK.cc/' >>$@; \
fi; \ fi; \
done ; done ;

View File

@ -875,6 +875,14 @@ module StdMeshers
void SetIgnoreEdges(in SMESH::long_array edgeIDs) raises (SALOME::SALOME_Exception); void SetIgnoreEdges(in SMESH::long_array edgeIDs) raises (SALOME::SALOME_Exception);
SMESH::long_array GetIgnoreEdges(); SMESH::long_array GetIgnoreEdges();
/*!
* Set edges either to exclude from treatment or to make the Viscous Layers on.
*/
void SetEdges(in SMESH::long_array edgeIDs,
in boolean toIgnore) raises (SALOME::SALOME_Exception);
SMESH::long_array GetEdges();
boolean GetIsToIgnoreEdges();
/*! /*!
* Set total thickness of layers of prisms * Set total thickness of layers of prisms
*/ */
@ -918,7 +926,7 @@ module StdMeshers
boolean IsGridBySpacing(in short axis); boolean IsGridBySpacing(in short axis);
/*! /*!
* Set coordinates of nodes along an axis (counterd from zero) * Set coordinates of nodes along an axis (countered from zero)
*/ */
void SetGrid(in SMESH::double_array coords, void SetGrid(in SMESH::double_array coords,
in short axis) raises (SALOME::SALOME_Exception); in short axis) raises (SALOME::SALOME_Exception);

View File

@ -117,8 +117,9 @@ module SMESH
{ {
double GetValue( in long theElementId ); double GetValue( in long theElementId );
Histogram GetHistogram( in short nbIntervals, in boolean isLogarithmic ); Histogram GetHistogram ( in short nbIntervals, in boolean isLogarithmic );
Histogram GetLocalHistogram( in short nbIntervals, in boolean isLogarithmic,
in SMESH::SMESH_IDSource obj );
/*! /*!
* Set precision for calculation. It is a position after point which is * Set precision for calculation. It is a position after point which is
* used to functor value after calculation. * used to functor value after calculation.
@ -164,11 +165,12 @@ module SMESH
/*! /*!
* Predicates are intended for verification of criteria, * Predicates are intended for verification of criteria,
* must return bool value by mesh id * they return bool value by mesh id
*/ */
interface Predicate: Functor interface Predicate: Functor
{ {
boolean IsSatisfy( in long thEntityId ); boolean IsSatisfy( in long thEntityId );
long NbSatisfying( in SMESH::SMESH_IDSource obj );
}; };
/*! /*!

View File

@ -36,6 +36,7 @@
module SMESH module SMESH
{ {
typedef sequence<SALOMEDS::SObject> sobject_list;
typedef sequence<GEOM::GEOM_Object> object_array; typedef sequence<GEOM::GEOM_Object> object_array;
typedef sequence<SMESH_Mesh> mesh_array; typedef sequence<SMESH_Mesh> mesh_array;
@ -402,6 +403,19 @@ module SMESH
* \brief Get names of meshes defined in file with the specified name. * \brief Get names of meshes defined in file with the specified name.
*/ */
string_array GetMeshNames(in string theFileName); string_array GetMeshNames(in string theFileName);
/*!
* \brief Moves objects to the specified position
*
* This function is used in the drag-n-drop functionality.
*
* \param what objects being moved
* \param where parent object where objects are moved to
* \param row position in the parent object's children list at which objects are moved
*/
void Move( in sobject_list what,
in SALOMEDS::SObject where,
in long row );
}; };
}; };

View File

@ -29,7 +29,6 @@
#include "SALOME_Exception.idl" #include "SALOME_Exception.idl"
#include "SALOME_GenericObj.idl" #include "SALOME_GenericObj.idl"
#include "GEOM_Gen.idl" #include "GEOM_Gen.idl"
#include "MED.idl"
module SMESH module SMESH
{ {
@ -86,6 +85,7 @@ module SMESH
double_array coords; double_array coords;
long_array indexes; long_array indexes;
}; };
typedef sequence<log_block> log_array;
struct PointStruct { double x; struct PointStruct { double x;
double y; double y;
@ -93,7 +93,7 @@ module SMESH
typedef sequence<PointStruct> nodes_array; typedef sequence<PointStruct> nodes_array;
struct DirStruct { PointStruct PS ; } ; // analog to Occ Direction struct DirStruct { PointStruct PS ; } ; // analog to OCCT gp_Vec
struct AxisStruct { double x; struct AxisStruct { double x;
double y; double y;
@ -101,7 +101,6 @@ module SMESH
double vx; double vx;
double vy; double vy;
double vz; } ; double vz; } ;
/*! /*!
* Node location on a shape * Node location on a shape
*/ */
@ -130,12 +129,13 @@ module SMESH
FACE, FACE,
VOLUME, VOLUME,
ELEM0D, ELEM0D,
BALL BALL,
NB_ELEMENT_TYPES
}; };
typedef sequence<ElementType> array_of_ElementType ; typedef sequence<ElementType> array_of_ElementType ;
/*! /*!
* Enumeration for element geometry type, like in SMDS * Enumeration for element geometry type, like SMDSAbs_GeometryType in SMDSAbs_ElementType.hxx
*/ */
enum GeometryType enum GeometryType
{ {
@ -162,7 +162,6 @@ module SMESH
ORDER_QUADRATIC /*! entities of 2nd order */ ORDER_QUADRATIC /*! entities of 2nd order */
}; };
/*! /*!
* Enumeration of entity type used in mesh info array, * Enumeration of entity type used in mesh info array,
* it should be synchronised with enum SMDSAbs_EntityType * it should be synchronised with enum SMDSAbs_EntityType
@ -197,7 +196,6 @@ module SMESH
Entity_Last Entity_Last
}; };
/*! /*!
* Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods) * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
*/ */
@ -221,12 +219,12 @@ module SMESH
}; };
/*! /*!
* Enumeration for DriverMED read status (used by ImportMEDFile() method) * Enumeration for mesh read status (used by SMESH_Gen::CreateMeshesFrom*() methods)
*/ */
enum DriverMED_ReadStatus // in the order of severity enum DriverMED_ReadStatus // in the order of severity
{ {
DRS_OK, DRS_OK,
DRS_EMPTY, // a MED file contains no mesh with the given name DRS_EMPTY, // a file contains no mesh with the given name
DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers, DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers,
// so the numbers from the file are ignored // so the numbers from the file are ignored
DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
@ -235,16 +233,23 @@ module SMESH
}; };
/*! /*!
* Enumeration for DriverMED (used by Perform() method) * Enumeration for ExportToMED*()
*/ */
enum MED_VERSION // in the order of severity enum MED_VERSION
{ {
MED_V2_1, MED_V2_1,
MED_V2_2 MED_V2_2
}; };
typedef sequence<log_block> log_array; /*!
* \brief A structure containing information about MED file
*/
struct MedFileInfo
{
string fileName; //!< name of file
long fileSize; //!< size of file
long major, minor, release; //!< MED file version
};
/*! /*!
* Auxilary flags for advanced extrusion. * Auxilary flags for advanced extrusion.
@ -280,11 +285,17 @@ module SMESH
long_array GetIDs(); long_array GetIDs();
/*! /*!
* Returns statistic of mesh elements * Returns number of mesh elements of each \a EntityType
* @return array of number enityties by index of EntityType * @return array of number of elements per \a EntityType
*/ */
long_array GetMeshInfo(); long_array GetMeshInfo();
/*!
* Returns number of mesh elements of each \a ElementType
* @return array of number of elements per \a ElementType
*/
long_array GetNbElementsByType();
/*! /*!
* Returns types of elements it contains. * Returns types of elements it contains.
* It's empty if the SMESH_IDSource contains no IDs * It's empty if the SMESH_IDSource contains no IDs
@ -596,19 +607,26 @@ module SMESH
boolean HasDuplicatedGroupNamesMED(); boolean HasDuplicatedGroupNamesMED();
/*! /*!
* Export Mesh to different MED Formats * Export Mesh to a MED Format file
* @params * @params
* - file : name of the MED file * - file : name of the MED file
* - auto_groups : boolean parameter for creating/not creating * - auto_groups : boolean parameter for creating/not creating
* the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; * the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
* the typical use is auto_groups=false. * the typical use is auto_groups=false.
* - version : define the version of format of MED file, that will be created * - version : define the version of format of MED file, that will be created
* - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists * - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
* - autoDimension: if @c True (default), a space dimension of a MED mesh can be either
* - 1D if all mesh nodes lie on OX coordinate axis, or
* - 2D if all mesh nodes lie on XOY coordinate plane, or
* - 3D in the rest cases.
*
* If @a autoDimension is @c False, the space dimension is always 3.
*/ */
void ExportToMEDX( in string file, void ExportToMEDX( in string file,
in boolean auto_groups, in boolean auto_groups,
in MED_VERSION version, in MED_VERSION version,
in boolean overwrite ) raises (SALOME::SALOME_Exception); in boolean overwrite,
in boolean autoDimension ) raises (SALOME::SALOME_Exception);
/*! /*!
* Export a part of Mesh into a MED file * Export a part of Mesh into a MED file
@ -617,15 +635,20 @@ module SMESH
* - file : name of the MED file * - file : name of the MED file
* - version : define the version of format of MED file, that will be created * - version : define the version of format of MED file, that will be created
* - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists * - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
* - autoDimension: if @c True, a space dimension for export is defined by mesh
* configuration; for example a planar mesh lying on XOY plane
* will be exported as a mesh in 2D space.
* If @a autoDimension == @c False, the space dimension is 3.
*/ */
void ExportPartToMED( in SMESH_IDSource meshPart, void ExportPartToMED( in SMESH_IDSource meshPart,
in string file, in string file,
in boolean auto_groups, in boolean auto_groups,
in MED_VERSION version, in MED_VERSION version,
in boolean overwrite ) raises (SALOME::SALOME_Exception); in boolean overwrite,
in boolean autoDimension ) raises (SALOME::SALOME_Exception);
/*! /*!
* Export Mesh to different MED Formats * Export Mesh to a MED Format file
* Works, just the same as ExportToMEDX, with overwrite parameter equal to true. * Works, just the same as ExportToMEDX, with overwrite parameter equal to true.
* The method is kept in order to support old functionality * The method is kept in order to support old functionality
*/ */
@ -674,12 +697,10 @@ module SMESH
void ExportPartToSTL( in SMESH_IDSource meshPart, void ExportPartToSTL( in SMESH_IDSource meshPart,
in string file, in string file,
in boolean isascii ) raises (SALOME::SALOME_Exception); in boolean isascii ) raises (SALOME::SALOME_Exception);
/*! /*!
* Get MED Mesh * Return computation progress [0.,1]
*/ */
SALOME_MED::MESH GetMEDMesh() double GetComputeProgress();
raises (SALOME::SALOME_Exception);
/*! /*!
* Get informations about mesh contents * Get informations about mesh contents
@ -932,7 +953,7 @@ module SMESH
double_array BaryCenter(in long id); double_array BaryCenter(in long id);
/*! Gets information about imported MED file */ /*! Gets information about imported MED file */
SALOME_MED::MedFileInfo GetMEDFileInfo(); MedFileInfo GetMEDFileInfo();
/*! /*!
* Sets list of notebook variables used for Mesh operations separated by ":" symbol * Sets list of notebook variables used for Mesh operations separated by ":" symbol
@ -1005,12 +1026,6 @@ module SMESH
* Get the internal Id * Get the internal Id
*/ */
long GetId(); long GetId();
/*!
* Get MED subMesh
*/
SALOME_MED::FAMILY GetFamily()
raises (SALOME::SALOME_Exception);
}; };
}; };

View File

@ -927,13 +927,29 @@ module SMESH
boolean ChangeElemNodes(in long ide, in long_array newIDs) boolean ChangeElemNodes(in long ide, in long_array newIDs)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*!
* \brief Duplicates given elements, i.e. creates new elements based on the
* same nodes as the given ones.
* \param theElements - container of elements to duplicate.
* \param theGroupName - a name of group to contain the generated elements.
* If a group with such a name already exists, the new elements
* are added to the existng group, else a new group is created.
* If \a theGroupName is empty, new elements are not added
* in any group.
* \return a group where the new elements are added. NULL if theGroupName == "".
* \sa DoubleNode()
*/
SMESH_Group DoubleElements( in SMESH_IDSource theElements,
in string theGroupName )
raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Creates a hole in a mesh by doubling the nodes of some particular elements * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
* \param theNodes - identifiers of nodes to be doubled * \param theNodes - identifiers of nodes to be doubled
* \param theModifiedElems - identifiers of elements to be updated by the new (doubled) * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
* nodes. If list of element identifiers is empty then nodes are doubled but * nodes. If list of element identifiers is empty then nodes are doubled but
* they not assigned to elements * they not assigned to elements
* \return TRUE if operation has been completed successfully, FALSE otherwise * \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups() * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
*/ */
boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems ) boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems )

View File

@ -156,7 +156,8 @@ dist_salomeres_DATA = \
mesh_sew_sideelements.png \ mesh_sew_sideelements.png \
mesh_merge_nodes.png \ mesh_merge_nodes.png \
mesh_merge_elements.png \ mesh_merge_elements.png \
select1.png \ select1.png \
open.png \
StdMeshers.xml \ StdMeshers.xml \
mesh_pattern.png \ mesh_pattern.png \
mesh_pentahedron.png \ mesh_pentahedron.png \
@ -193,13 +194,14 @@ dist_salomeres_DATA = \
mesh_tree_mesh_partial.png \ mesh_tree_mesh_partial.png \
mesh_extractGroup.png \ mesh_extractGroup.png \
mesh_precompute.png \ mesh_precompute.png \
mesh_2d_from_3d.png \ mesh_2d_from_3d.png \
mesh_free_faces.png \ mesh_free_faces.png \
scale.png \ scale.png \
scale_along_axes.png \ scale_along_axes.png \
split_into_tetra.png \ split_into_tetra.png \
mesh_duplicate_nodes.png \ mesh_duplicate_nodes.png \
mesh_duplicate_nodes_with_elem.png \ mesh_duplicate_nodes_with_elem.png \
mesh_duplicate_elem_only.png \
mesh_bounding_box.png \ mesh_bounding_box.png \
mesh_hypo_viscous_layers.png \ mesh_hypo_viscous_layers.png \
mesh_tree_hypo_viscous_layers.png \ mesh_tree_hypo_viscous_layers.png \

View File

@ -77,6 +77,7 @@
<parameter name="distribution_color" value="0, 85, 0" /> <parameter name="distribution_color" value="0, 85, 0" />
<parameter name="DisplayMode" value="true" /> <parameter name="DisplayMode" value="true" />
<parameter name="auto_update" value="true" /> <parameter name="auto_update" value="true" />
<parameter name="incremental_limit" value="false" />
<parameter name="update_limit" value="500000" /> <parameter name="update_limit" value="500000" />
<parameter name="display_entity" value="true" /> <parameter name="display_entity" value="true" />
<parameter name="display_mode" value="1" /> <parameter name="display_mode" value="1" />
@ -85,9 +86,11 @@
<parameter name="mesh_elem_info" value="1"/> <parameter name="mesh_elem_info" value="1"/>
<parameter name="elem_info_grp_details" value="false"/> <parameter name="elem_info_grp_details" value="false"/>
<parameter name="info_groups_nodes_limit" value="100000"/> <parameter name="info_groups_nodes_limit" value="100000"/>
<parameter name="info_controls_limit" value="3000"/>
<parameter name="info_dump_base" value="true" /> <parameter name="info_dump_base" value="true" />
<parameter name="info_dump_elem" value="true" /> <parameter name="info_dump_elem" value="true" />
<parameter name="info_dump_add" value="true" /> <parameter name="info_dump_add" value="true" />
<parameter name="info_dump_ctrl" value="true" />
<parameter name="segmentation" value="10"/> <parameter name="segmentation" value="10"/>
<parameter name="nb_segments_per_edge" value="15"/> <parameter name="nb_segments_per_edge" value="15"/>
<parameter name="forget_mesh_on_hyp_modif" value="true"/> <parameter name="forget_mesh_on_hyp_modif" value="true"/>
@ -113,6 +116,7 @@
<parameter name="sub_menu" value="%1 module"/> <parameter name="sub_menu" value="%1 module"/>
<parameter name="User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/index.html"/> <parameter name="User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/index.html"/>
<parameter name="Plug-ins/Yams plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/yams/index.html"/> <parameter name="Plug-ins/Yams plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/yams/index.html"/>
<parameter name="Plug-ins/MGCleaner plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MGCleaner/index.html"/>
<parameter name="Developer's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/tui/SMESH/index.html"/> <parameter name="Developer's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/tui/SMESH/index.html"/>
</section> </section>
<section name="resources"> <section name="resources">

View File

@ -261,7 +261,7 @@
<algo>MEFISTO_2D=Triangle(algo=smeshBuilder.MEFISTO)</algo> <algo>MEFISTO_2D=Triangle(algo=smeshBuilder.MEFISTO)</algo>
<hypo>LengthFromEdges=LengthFromEdges()</hypo> <hypo>LengthFromEdges=LengthFromEdges()</hypo>
<hypo>MaxElementArea=MaxElementArea(SetMaxElementArea())</hypo> <hypo>MaxElementArea=MaxElementArea(SetMaxElementArea())</hypo>
<hypo>ViscousLayers2D=ViscousLayers2D(SetTotalThickness(),SetNumberLayers(),SetStretchFactor(),SetIgnoreEdges())</hypo> <hypo>ViscousLayers2D=ViscousLayers2D(SetTotalThickness(),SetNumberLayers(),SetStretchFactor(),SetEdges(1),SetEdges(2))</hypo>
</python-wrap> </python-wrap>
</algorithm> </algorithm>

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

BIN
resources/open.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -2768,10 +2768,11 @@ void ElemEntityType::SetMesh( const SMDS_Mesh* theMesh )
bool ElemEntityType::IsSatisfy( long theId ) bool ElemEntityType::IsSatisfy( long theId )
{ {
if ( !myMesh ) return false; if ( !myMesh ) return false;
if ( myType == SMDSAbs_Node )
return myMesh->FindNode( theId );
const SMDS_MeshElement* anElem = myMesh->FindElement( theId ); const SMDS_MeshElement* anElem = myMesh->FindElement( theId );
return ( anElem && return ( anElem &&
myEntityType == anElem->GetEntityType() && myEntityType == anElem->GetEntityType() );
( myType == SMDSAbs_Edge || myType == SMDSAbs_Face || myType == SMDSAbs_Volume ));
} }
void ElemEntityType::SetType( SMDSAbs_ElementType theType ) void ElemEntityType::SetType( SMDSAbs_ElementType theType )

View File

@ -59,7 +59,7 @@ class MESHDRIVER_EXPORT Driver_Mesh
}; };
void SetMeshId(int theMeshId); void SetMeshId(int theMeshId);
void SetFile(const std::string& theFileName); virtual void SetFile(const std::string& theFileName);
virtual void SetMeshName(const std::string& theMeshName); virtual void SetMeshName(const std::string& theMeshName);
virtual std::string GetMeshName() const; virtual std::string GetMeshName() const;

View File

@ -0,0 +1,28 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// Declarations needed for usage of DriverMED
#include <boost/shared_ptr.hpp>
class DriverMED_Family;
typedef boost::shared_ptr<DriverMED_Family> DriverMED_FamilyPtr;

View File

@ -24,7 +24,6 @@
// File : DriverMED_Family.cxx // File : DriverMED_Family.cxx
// Author : Julia DOROVSKIKH // Author : Julia DOROVSKIKH
// Module : SMESH // Module : SMESH
// $Header$
// //
#include "DriverMED_Family.h" #include "DriverMED_Family.h"
#include "MED_Factory.hxx" #include "MED_Factory.hxx"

View File

@ -24,12 +24,12 @@
// File : DriverMED_Family.hxx // File : DriverMED_Family.hxx
// Author : Julia DOROVSKIKH // Author : Julia DOROVSKIKH
// Module : SMESH // Module : SMESH
// $Header$
// //
#ifndef _INCLUDE_DRIVERMED_FAMILY #ifndef _INCLUDE_DRIVERMED_FAMILY
#define _INCLUDE_DRIVERMED_FAMILY #define _INCLUDE_DRIVERMED_FAMILY
#include "SMESH_DriverMED.hxx" #include "SMESH_DriverMED.hxx"
#include "DriverMED.hxx"
#include "SMDS_Mesh.hxx" #include "SMDS_Mesh.hxx"
#include "SMESHDS_GroupBase.hxx" #include "SMESHDS_GroupBase.hxx"
@ -49,8 +49,6 @@
#define REST_BALL_FAMILY -5 #define REST_BALL_FAMILY -5
#define FIRST_ELEM_FAMILY -6 #define FIRST_ELEM_FAMILY -6
class DriverMED_Family;
typedef boost::shared_ptr<DriverMED_Family> DriverMED_FamilyPtr;
typedef std::list<DriverMED_FamilyPtr > DriverMED_FamilyPtrList; typedef std::list<DriverMED_FamilyPtr > DriverMED_FamilyPtrList;
typedef std::map<int,SMESHDS_SubMesh* > SMESHDS_SubMeshPtrMap; typedef std::map<int,SMESHDS_SubMesh* > SMESHDS_SubMeshPtrMap;
typedef std::list<SMESHDS_GroupBase* > SMESHDS_GroupBasePtrList; typedef std::list<SMESHDS_GroupBase* > SMESHDS_GroupBasePtrList;

View File

@ -52,6 +52,26 @@ static int MYDEBUG = 0;
using namespace MED; using namespace MED;
using namespace std; using namespace std;
typedef std::map<int, DriverMED_FamilyPtr> TID2FamilyMap;
namespace DriverMED
{
bool buildMeshGrille(const MED::PWrapper& theWrapper,
const MED::PMeshInfo& theMeshInfo,
SMESHDS_Mesh* theMesh,
const TID2FamilyMap& myFamilies);
/*!
* \brief Ensure aFamily has a required ID
* \param aFamily - a family to check
* \param anID - an ID aFamily should have
* \param myFamilies - a map of the family ID to the Family
* \retval bool - true if successful
*/
bool checkFamilyID(DriverMED_FamilyPtr & aFamily,
int anID,
const TID2FamilyMap& myFamilies);
}
void void
DriverMED_R_SMESHDS_Mesh DriverMED_R_SMESHDS_Mesh
::SetMeshName(string theMeshName) ::SetMeshName(string theMeshName)
@ -135,7 +155,7 @@ DriverMED_R_SMESHDS_Mesh
} }
if (aMeshInfo->GetType() == MED::eSTRUCTURE){ if (aMeshInfo->GetType() == MED::eSTRUCTURE){
/*bool aRes = */buildMeshGrille(aMed,aMeshInfo); /*bool aRes = */DriverMED::buildMeshGrille(aMed,aMeshInfo,myMesh,myFamilies);
continue; continue;
} }
@ -169,7 +189,7 @@ DriverMED_R_SMESHDS_Mesh
// Save reference to this node from its family // Save reference to this node from its family
TInt aFamNum = aNodeInfo->GetFamNum(iElem); TInt aFamNum = aNodeInfo->GetFamNum(iElem);
if ( checkFamilyID ( aFamily, aFamNum )) if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies ))
{ {
aFamily->AddElement(aNode); aFamily->AddElement(aNode);
aFamily->SetType(SMDSAbs_Node); aFamily->SetType(SMDSAbs_Node);
@ -257,7 +277,7 @@ DriverMED_R_SMESHDS_Mesh
// Save reference to this element from its family // Save reference to this element from its family
TInt aFamNum = aBallInfo->GetFamNum(iBall); TInt aFamNum = aBallInfo->GetFamNum(iBall);
if ( checkFamilyID ( aFamily, aFamNum )) if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies ))
{ {
aFamily->AddElement(anElement); aFamily->AddElement(anElement);
aFamily->SetType( SMDSAbs_Ball ); aFamily->SetType( SMDSAbs_Ball );
@ -329,7 +349,7 @@ DriverMED_R_SMESHDS_Mesh
if(aResult < DRS_WARN_RENUMBER) if(aResult < DRS_WARN_RENUMBER)
aResult = DRS_WARN_RENUMBER; aResult = DRS_WARN_RENUMBER;
} }
if ( checkFamilyID ( aFamily, aFamNum )) if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies ))
{ {
// Save reference to this element from its family // Save reference to this element from its family
aFamily->AddElement(anElement); aFamily->AddElement(anElement);
@ -409,7 +429,7 @@ DriverMED_R_SMESHDS_Mesh
if (aResult < DRS_WARN_RENUMBER) if (aResult < DRS_WARN_RENUMBER)
aResult = DRS_WARN_RENUMBER; aResult = DRS_WARN_RENUMBER;
} }
if ( checkFamilyID ( aFamily, aFamNum )) { if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies )) {
// Save reference to this element from its family // Save reference to this element from its family
aFamily->AddElement(anElement); aFamily->AddElement(anElement);
aFamily->SetType(anElement->GetType()); aFamily->SetType(anElement->GetType());
@ -920,7 +940,7 @@ DriverMED_R_SMESHDS_Mesh
if (aResult < DRS_WARN_RENUMBER) if (aResult < DRS_WARN_RENUMBER)
aResult = DRS_WARN_RENUMBER; aResult = DRS_WARN_RENUMBER;
} }
if ( checkFamilyID ( aFamily, aFamNum )) { if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies )) {
// Save reference to this element from its family // Save reference to this element from its family
myFamilies[aFamNum]->AddElement(anElement); myFamilies[aFamNum]->AddElement(anElement);
myFamilies[aFamNum]->SetType(anElement->GetType()); myFamilies[aFamNum]->SetType(anElement->GetType());
@ -1127,7 +1147,9 @@ void DriverMED_R_SMESHDS_Mesh::CreateAllSubMeshes ()
* \param anID - an ID aFamily should have * \param anID - an ID aFamily should have
* \retval bool - true if successful * \retval bool - true if successful
*/ */
bool DriverMED_R_SMESHDS_Mesh::checkFamilyID(DriverMED_FamilyPtr & aFamily, int anID) const bool DriverMED::checkFamilyID(DriverMED_FamilyPtr & aFamily,
int anID,
const TID2FamilyMap& myFamilies)
{ {
if ( !aFamily || aFamily->GetId() != anID ) { if ( !aFamily || aFamily->GetId() != anID ) {
map<int, DriverMED_FamilyPtr>::const_iterator i_fam = myFamilies.find(anID); map<int, DriverMED_FamilyPtr>::const_iterator i_fam = myFamilies.find(anID);
@ -1138,14 +1160,18 @@ bool DriverMED_R_SMESHDS_Mesh::checkFamilyID(DriverMED_FamilyPtr & aFamily, int
return ( aFamily->GetId() == anID ); return ( aFamily->GetId() == anID );
} }
/*!
/*! \brief Reading the structured mesh and convert to non structured (by filling of smesh structure for non structured mesh) * \brief Reading the structured mesh and convert to non structured
* (by filling of smesh structure for non structured mesh)
* \param theWrapper - PWrapper const pointer * \param theWrapper - PWrapper const pointer
* \param theMeshInfo - PMeshInfo const pointer * \param theMeshInfo - PMeshInfo const pointer
* \param myFamilies - a map of the family ID to the Family
* \return TRUE, if successfully. Else FALSE * \return TRUE, if successfully. Else FALSE
*/ */
bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper, bool DriverMED::buildMeshGrille(const MED::PWrapper& theWrapper,
const MED::PMeshInfo& theMeshInfo) const MED::PMeshInfo& theMeshInfo,
SMESHDS_Mesh* myMesh,
const TID2FamilyMap& myFamilies)
{ {
bool res = true; bool res = true;
@ -1167,7 +1193,7 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
if((aGrilleInfo->myFamNumNode).size() > 0){ if((aGrilleInfo->myFamNumNode).size() > 0){
TInt aFamNum = aGrilleInfo->GetFamNumNode(iNode); TInt aFamNum = aGrilleInfo->GetFamNumNode(iNode);
if ( checkFamilyID ( aFamily, aFamNum )) if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies ))
{ {
aFamily->AddElement(aNode); aFamily->AddElement(aNode);
aFamily->SetType(SMDSAbs_Node); aFamily->SetType(SMDSAbs_Node);
@ -1224,7 +1250,7 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
} }
if((aGrilleInfo->myFamNum).size() > 0){ if((aGrilleInfo->myFamNum).size() > 0){
TInt aFamNum = aGrilleInfo->GetFamNum(iCell); TInt aFamNum = aGrilleInfo->GetFamNum(iCell);
if ( checkFamilyID ( aFamily, aFamNum )){ if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies )){
aFamily->AddElement(anElement); aFamily->AddElement(anElement);
aFamily->SetType(anElement->GetType()); aFamily->SetType(anElement->GetType());
} }

View File

@ -29,10 +29,12 @@
#include "SMESH_DriverMED.hxx" #include "SMESH_DriverMED.hxx"
#include "DriverMED.hxx"
#include "Driver_SMESHDS_Mesh.h" #include "Driver_SMESHDS_Mesh.h"
#include "DriverMED_Family.h" #include "SMDSAbs_ElementType.hxx"
#include <list> #include <list>
#include <map>
class SMESHDS_Mesh; class SMESHDS_Mesh;
class SMESHDS_Group; class SMESHDS_Group;
@ -53,18 +55,6 @@ class MESHDRIVERMED_EXPORT DriverMED_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
std::list<std::string> GetMeshNames(Status& theStatus); std::list<std::string> GetMeshNames(Status& theStatus);
void SetMeshName(std::string theMeshName); void SetMeshName(std::string theMeshName);
private:
/*!
* \brief Ensure aFamily has required ID
* \param aFamily - a family to check
* \param anID - an ID aFamily should have
* \retval bool - true if successful
*/
bool checkFamilyID(DriverMED_FamilyPtr & aFamily, int anID) const;
bool buildMeshGrille(const MED::PWrapper& theWrapper,
const MED::PMeshInfo& theMeshInfo);
private: private:
std::string myMeshName; std::string myMeshName;
std::map<int, DriverMED_FamilyPtr> myFamilies; std::map<int, DriverMED_FamilyPtr> myFamilies;

View File

@ -24,19 +24,19 @@
// File : DriverMED_W_SMESHDS_Mesh.cxx // File : DriverMED_W_SMESHDS_Mesh.cxx
// Module : SMESH // Module : SMESH
// //
#include <sstream>
#include "DriverMED_W_SMESHDS_Mesh.h" #include "DriverMED_W_SMESHDS_Mesh.h"
#include "DriverMED_Family.h"
#include "SMESHDS_Mesh.hxx" #include "DriverMED_Family.h"
#include "MED_Factory.hxx"
#include "MED_Utilities.hxx"
#include "SMDS_MeshElement.hxx" #include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
#include "SMDS_PolyhedralVolumeOfNodes.hxx" #include "SMDS_PolyhedralVolumeOfNodes.hxx"
#include "SMESHDS_Mesh.hxx"
#include "utilities.h" #include <utilities.h>
#include "MED_Utilities.hxx"
#define _EDF_NODE_IDS_ #define _EDF_NODE_IDS_
//#define _ELEMENTS_BY_DIM_ //#define _ELEMENTS_BY_DIM_
@ -46,25 +46,27 @@ using namespace MED;
DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh(): DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh():
myMedVersion(MED::eV2_2),
myAllSubMeshes (false), myAllSubMeshes (false),
myDoGroupOfNodes (false), myDoGroupOfNodes (false),
myDoGroupOfEdges (false), myDoGroupOfEdges (false),
myDoGroupOfFaces (false), myDoGroupOfFaces (false),
myDoGroupOfVolumes (false), myDoGroupOfVolumes (false),
myDoGroupOf0DElems(false), myDoGroupOf0DElems(false),
myDoGroupOfBalls(false) myDoGroupOfBalls(false),
myAutoDimension(true)
{} {}
void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName, void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName,
MED::EVersion theId) MED::EVersion theId)
{ {
myMed = CrWrapper(theFileName,theId);
Driver_SMESHDS_Mesh::SetFile(theFileName); Driver_SMESHDS_Mesh::SetFile(theFileName);
myMedVersion = theId;
} }
void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName) void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName)
{ {
return SetFile(theFileName,MED::eV2_2); Driver_SMESHDS_Mesh::SetFile(theFileName);
} }
string DriverMED_W_SMESHDS_Mesh::GetVersionString(const MED::EVersion theVersion, int theNbDigits) string DriverMED_W_SMESHDS_Mesh::GetVersionString(const MED::EVersion theVersion, int theNbDigits)
@ -120,7 +122,8 @@ void DriverMED_W_SMESHDS_Mesh::AddGroupOfVolumes()
myDoGroupOfVolumes = true; myDoGroupOfVolumes = true;
} }
namespace{ namespace
{
typedef double (SMDS_MeshNode::* TGetCoord)() const; typedef double (SMDS_MeshNode::* TGetCoord)() const;
typedef const char* TName; typedef const char* TName;
typedef const char* TUnit; typedef const char* TUnit;
@ -311,12 +314,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
} }
// Mesh dimension definition // Mesh dimension definition
TInt aSpaceDimension; TInt aSpaceDimension = 3;
TCoordHelperPtr aCoordHelperPtr; TCoordHelperPtr aCoordHelperPtr;
{ {
bool anIsXDimension = false; bool anIsXDimension = false;
bool anIsYDimension = false; bool anIsYDimension = false;
bool anIsZDimension = false; bool anIsZDimension = false;
if ( myAutoDimension )
{ {
SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator(); SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
double aBounds[6]; double aBounds[6];
@ -390,6 +394,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
if ( myMesh->NbVolumes() > 0 ) if ( myMesh->NbVolumes() > 0 )
aMeshDimension = 3; aMeshDimension = 3;
MED::PWrapper myMed = CrWrapper(myFile,myMedVersion);
PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName); PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName);
MESSAGE("Add - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName()); MESSAGE("Add - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
myMed->SetMeshInfo(aMeshInfo); myMed->SetMeshInfo(aMeshInfo);

View File

@ -30,7 +30,7 @@
#include "SMESH_DriverMED.hxx" #include "SMESH_DriverMED.hxx"
#include "Driver_SMESHDS_Mesh.h" #include "Driver_SMESHDS_Mesh.h"
#include "MED_Factory.hxx" #include "MED_Common.hxx"
#include <string> #include <string>
#include <list> #include <list>
@ -48,6 +48,7 @@ class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
virtual void SetFile(const std::string& theFileName); virtual void SetFile(const std::string& theFileName);
void SetFile(const std::string& theFileName, MED::EVersion theId); void SetFile(const std::string& theFileName, MED::EVersion theId);
void SetAutoDimension(bool toFindOutDimension) { myAutoDimension = toFindOutDimension; }
static std::string GetVersionString(const MED::EVersion theVersion, int theNbDigits=2); static std::string GetVersionString(const MED::EVersion theVersion, int theNbDigits=2);
/*! sets file name; only for usage with Add(), not Write() /*! sets file name; only for usage with Add(), not Write()
@ -71,7 +72,7 @@ class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
private: private:
MED::PWrapper myMed; MED::EVersion myMedVersion;
std::list<SMESHDS_GroupBase*> myGroups; std::list<SMESHDS_GroupBase*> myGroups;
bool myAllSubMeshes; bool myAllSubMeshes;
std::map<int,SMESHDS_SubMesh*> mySubMeshes; std::map<int,SMESHDS_SubMesh*> mySubMeshes;
@ -81,8 +82,7 @@ class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
bool myDoGroupOfVolumes; bool myDoGroupOfVolumes;
bool myDoGroupOf0DElems; bool myDoGroupOf0DElems;
bool myDoGroupOfBalls; bool myDoGroupOfBalls;
bool myAutoDimension;
}; };
#endif #endif

View File

@ -26,6 +26,7 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
# header files # header files
salomeinclude_HEADERS = \ salomeinclude_HEADERS = \
DriverMED.hxx \
DriverMED_R_SMESHDS_Mesh.h \ DriverMED_R_SMESHDS_Mesh.h \
DriverMED_W_SMESHDS_Mesh.h \ DriverMED_W_SMESHDS_Mesh.h \
DriverMED_Family.h \ DriverMED_Family.h \
@ -47,12 +48,13 @@ dist_MED_Test_SOURCES = \
# additionnal information to compil and link file # additionnal information to compil and link file
libMeshDriverMED_la_CPPFLAGS = \ libMeshDriverMED_la_CPPFLAGS = \
$(MED_CXXFLAGS) \
@HDF5_INCLUDES@ \ @HDF5_INCLUDES@ \
$(KERNEL_CXXFLAGS) \ $(KERNEL_CXXFLAGS) \
$(CAS_CPPFLAGS) \ $(CAS_CPPFLAGS) \
$(VTK_INCLUDES) \ $(VTK_INCLUDES) \
$(BOOST_CPPFLAGS) \ $(BOOST_CPPFLAGS) \
-I$(srcdir)/../MEDWrapper/Base \
-I$(srcdir)/../MEDWrapper/Factory \
-I$(srcdir)/../Driver \ -I$(srcdir)/../Driver \
-I$(srcdir)/../SMDS \ -I$(srcdir)/../SMDS \
-I$(srcdir)/../SMESHUtils \ -I$(srcdir)/../SMESHUtils \
@ -61,7 +63,9 @@ libMeshDriverMED_la_CPPFLAGS = \
libMeshDriverMED_la_LDFLAGS = \ libMeshDriverMED_la_LDFLAGS = \
$(BOOST_LIBS) \ $(BOOST_LIBS) \
../Driver/libMeshDriver.la \ ../Driver/libMeshDriver.la \
$(MED_LDFLAGS) -lMEDWrapper -lMEDWrapperBase -lMEDWrapper_V2_2 ../MEDWrapper/Factory/libMEDWrapper.la \
../MEDWrapper/Base/libMEDWrapperBase.la \
../MEDWrapper/V2_2/libMEDWrapper_V2_2.la \
$(BOOST_LIB_SYSTEM) $(BOOST_LIB_SYSTEM)
MED_Test_CPPFLAGS = \ MED_Test_CPPFLAGS = \
@ -77,8 +81,7 @@ MED_Test_LDADD = \
-lOpUtil \ -lOpUtil \
-lSALOMELocalTrace \ -lSALOMELocalTrace \
-lSALOMEBasics \ -lSALOMEBasics \
$(MED_LDFLAGS) \ ../MEDWrapper/Factory/libMEDWrapper.la \
-lMEDWrapper \ ../MEDWrapper/Base/libMEDWrapperBase.la \
-lMEDWrapperBase \ ../MEDWrapper/V2_2/libMEDWrapper_V2_2.la \
-lMEDWrapper_V2_2
$(BOOST_LIB_SYSTEM) $(BOOST_LIB_SYSTEM)

View File

@ -0,0 +1,47 @@
# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
INCLUDE_DIRECTORIES(
${HDF5_INCLUDE_DIRS}
${BOOST_INCLUDE_DIRS}
)
IF(MED_ENABLE_KERNEL)
INCLUDE_DIRECTORIES(${KERNEL_ROOT_DIR}/include/salome)
ELSE(MED_ENABLE_KERNEL)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/adm_local_without_kernel)
ENDIF(MED_ENABLE_KERNEL)
SET(MEDWrapperBase_SOURCES
MED_Structures.cxx
MED_Wrapper.cxx
MED_Algorithm.cxx
MED_GaussUtils.cxx
MED_CoordUtils.cxx
MED_Utilities.cxx
MED_GaussDef.cxx
)
ADD_LIBRARY(MEDWrapperBase SHARED ${MEDWrapperBase_SOURCES})
SET_TARGET_PROPERTIES(MEDWrapperBase PROPERTIES COMPILE_FLAGS "-D${MACHINE} ${HDF5_DEFINITIONS} ${BOOST_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
TARGET_LINK_LIBRARIES(MEDWrapperBase ${BOOST_LIB_THREAD} ${BOOST_LIB_DATE_TIME})
INSTALL(TARGETS MEDWrapperBase DESTINATION ${MED_salomelib_LIBS})
FILE(GLOB MEDWrapperBase_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
INSTALL(FILES ${MEDWrapperBase_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS})

View File

@ -0,0 +1,375 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#include "MED_Algorithm.hxx"
#include "MED_Wrapper.hxx"
#include "MED_Utilities.hxx"
#ifdef _DEBUG_
static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0;
#else
// static int MYDEBUG = 0;
// static int MYVALUEDEBUG = 0;
#endif
namespace MED
{
//---------------------------------------------------------------
TEntity2TGeom2ElemInfo
GetEntity2TGeom2ElemInfo(const PWrapper& theWrapper,
const PMeshInfo& theMeshInfo,
const MED::TEntityInfo& theEntityInfo)
{
MSG(MYDEBUG,"GetElemsByEntity(...)");
TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo;
MED::TEntityInfo::const_iterator anIter = theEntityInfo.begin();
PElemInfo anElemInfo;
TErr anErr;
for(; anIter != theEntityInfo.end(); anIter++){
const EEntiteMaillage& anEntity = anIter->first;
const TGeom2Size& aGeom2Size = anIter->second;
TGeom2ElemInfo& aGeom2ElemInfo = anEntity2TGeom2ElemInfo[anEntity];
if(anEntity == eNOEUD){
aGeom2ElemInfo[ePOINT1] = theWrapper->GetPElemInfo(theMeshInfo);
continue;
}
TGeom2Size::const_iterator anIter2 = aGeom2Size.begin();
for(; anIter2 != aGeom2Size.end(); anIter2++){
const EGeometrieElement& aGeom = anIter2->first;
aGeom2ElemInfo[aGeom] = theWrapper->GetPElemInfo(theMeshInfo,anEntity,aGeom,MED::eNOD,&anErr);
}
}
ADDMSG(MYDEBUG,"\n");
return anEntity2TGeom2ElemInfo;
}
//---------------------------------------------------------------
TFamilyInfoSet
GetFamilyInfoSet(const PWrapper& theWrapper,
const PMeshInfo& theMeshInfo)
{
MSG(MYDEBUG,"GetFamilies(...)");
TErr anErr;
TFamilyInfoSet aFamilyInfoSet;
TInt aNbFam = theWrapper->GetNbFamilies(*theMeshInfo);
INITMSG(MYDEBUG,"GetNbFamilies() = "<<aNbFam<<"\n");
for(TInt iFam = 1; iFam <= aNbFam; iFam++){
PFamilyInfo aFamilyInfo = theWrapper->GetPFamilyInfo(theMeshInfo,iFam,&anErr);
if(anErr >= 0)
aFamilyInfoSet.insert(aFamilyInfo);
}
ADDMSG(MYDEBUG,"\n");
return aFamilyInfoSet;
}
//---------------------------------------------------------------
TGroupInfo
GetGroupInfo(const TFamilyInfoSet& theFamilyInfoSet)
{
MSG(MYDEBUG,"GetFamiliesByGroup(...)");
TGroupInfo aGroup;
TFamilyInfoSet::const_iterator anIter = theFamilyInfoSet.begin();
for(; anIter != theFamilyInfoSet.end(); anIter++){
const PFamilyInfo& aFamilyInfo = *anIter;
TInt aNbGroup = aFamilyInfo->GetNbGroup();
for(TInt iGroup = 0; iGroup < aNbGroup; iGroup++){
aGroup[aFamilyInfo->GetGroupName(iGroup)].insert(aFamilyInfo);
}
}
#ifdef _DEBUG_
if(MYDEBUG){
TGroupInfo::const_iterator anIter = aGroup.begin();
for(; anIter != aGroup.end(); anIter++){
const std::string& aName = anIter->first;
INITMSG(MYDEBUG,"aGroupName = '"<<aName<<"'\n");
const TFamilyInfoSet& aFamilyInfoSet = anIter->second;
TFamilyInfoSet::const_iterator anFamIter = aFamilyInfoSet.begin();
for(; anFamIter != aFamilyInfoSet.end(); anFamIter++){
const PFamilyInfo& aFamilyInfo = *anFamIter;
INITMSG(MYDEBUG,"aFamilyName = '"<<aFamilyInfo->GetName()<<"'\n");
}
}
ADDMSG(MYDEBUG,"\n");
}
#endif
return aGroup;
}
//---------------------------------------------------------------
TFieldInfo2TimeStampInfoSet
GetFieldInfo2TimeStampInfoSet(const PWrapper& theWrapper,
const PMeshInfo& theMeshInfo,
const MED::TEntityInfo& theEntityInfo)
{
MSG(MYDEBUG,"GetFieldsByEntity(...)");
TFieldInfo2TimeStampInfoSet aFieldInfo2TimeStampInfoSet;
TInt aNbFields = theWrapper->GetNbFields();
INITMSG(MYDEBUG,"GetNbFields() = "<<aNbFields<<"\n");
for(TInt iField = 1; iField <= aNbFields; iField++){
PFieldInfo aFieldInfo = theWrapper->GetPFieldInfo(theMeshInfo,iField);
INITMSG(MYDEBUG,"aFieldName = '"<<aFieldInfo->GetName()<<
"'; aNbComp = "<<aFieldInfo->GetNbComp()<<"; ");
TGeom2Size aGeom2Size;
EEntiteMaillage anEntity = EEntiteMaillage(-1);
TInt aNbTimeStamps = theWrapper->GetNbTimeStamps(aFieldInfo,theEntityInfo,anEntity,aGeom2Size);
ADDMSG(MYDEBUG,"anEntity = "<<anEntity<<"; GetNbTimeStamps = "<<aNbTimeStamps<<"\n");
for(TInt iTimeStamp = 1; iTimeStamp <= aNbTimeStamps; iTimeStamp++){
PTimeStampInfo aTimeStamp =
theWrapper->GetPTimeStampInfo(aFieldInfo,anEntity,aGeom2Size,iTimeStamp);
aFieldInfo2TimeStampInfoSet[aFieldInfo].insert(aTimeStamp);
INITMSG(MYDEBUG,
"aDt = "<<aTimeStamp->GetDt()<<
", Unit = \'"<<aTimeStamp->GetUnitDt()<<"\n");
}
}
ADDMSG(MYDEBUG,"\n");
return aFieldInfo2TimeStampInfoSet;
}
//---------------------------------------------------------------
TEntite2TFieldInfo2TimeStampInfoSet
GetEntite2TFieldInfo2TimeStampInfoSet(const TFieldInfo2TimeStampInfoSet& theFieldInfo2TimeStampInfoSet)
{
TEntite2TFieldInfo2TimeStampInfoSet anEntite2TFieldInfo2TimeStampInfoSet;
TFieldInfo2TimeStampInfoSet::const_iterator anIter = theFieldInfo2TimeStampInfoSet.begin();
for(; anIter != theFieldInfo2TimeStampInfoSet.end(); anIter++){
const TTimeStampInfoSet& aTimeStampInfoSet = anIter->second;
//const PFieldInfo& aFieldInfo = anIter->first;
if(aTimeStampInfoSet.empty())
continue;
const PTimeStampInfo& aTimeStampInfo = *aTimeStampInfoSet.begin();
anEntite2TFieldInfo2TimeStampInfoSet[ConvertEntity(aTimeStampInfo->GetEntity())].insert(*anIter);
}
return anEntite2TFieldInfo2TimeStampInfoSet;
}
//---------------------------------------------------------------
bool
operator<(const TFamilyTSize& theLeft, const TFamilyTSize& theRight)
{
const MED::PFamilyInfo& aLeftInfo = boost::get<0>(theLeft);
const MED::PFamilyInfo& aRightInfo = boost::get<0>(theRight);
return aLeftInfo->GetId() < aRightInfo->GetId();
}
//---------------------------------------------------------------
TEntity2FamilySet
GetEntity2FamilySet(const PWrapper& theWrapper,
const TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
const TFamilyInfoSet& theFamilyInfoSet)
{
MSG(MYDEBUG,"GetFamiliesByEntity(...)");
TEntity2FamilySet anEntity2FamilySet;
typedef std::map<TInt,PFamilyInfo> TId2Family;
TId2Family anId2Family;
TFamilyInfoSet::const_iterator anIter = theFamilyInfoSet.begin();
for(; anIter != theFamilyInfoSet.end(); anIter++){
const PFamilyInfo& aFamilyInfo = *anIter;
anId2Family.insert(TId2Family::value_type(aFamilyInfo->GetId(),aFamilyInfo));
}
if(!anId2Family.empty()){
typedef std::map<TInt,TInt> TFamilyID2Size;
typedef std::map<EEntiteMaillage,TFamilyID2Size> TEntity2FamilyID;
TEntity2FamilyID anEntity2FamilyID;
if(!theEntity2TGeom2ElemInfo.empty()){
TEntity2TGeom2ElemInfo::const_iterator anIter = theEntity2TGeom2ElemInfo.begin();
for(; anIter != theEntity2TGeom2ElemInfo.end(); anIter++){
const EEntiteMaillage& anEntity = anIter->first;
TFamilyID2Size& aFamilyID2Size = anEntity2FamilyID[anEntity];
const TGeom2ElemInfo& aGeom2ElemInfo = anIter->second;
TGeom2ElemInfo::const_iterator aGeom2ElemInfoIter = aGeom2ElemInfo.begin();
for(; aGeom2ElemInfoIter != aGeom2ElemInfo.end(); aGeom2ElemInfoIter++){
const PElemInfo& aElemInfo = aGeom2ElemInfoIter->second;
if(TInt aNbElem = aElemInfo->GetNbElem()){
for(TInt i = 0; i < aNbElem; i++){
aFamilyID2Size[aElemInfo->GetFamNum(i)] += 1;
}
}
}
}
}
if(!anEntity2FamilyID.empty()){
TEntity2FamilyID::const_iterator anIter = anEntity2FamilyID.begin();
for(; anIter != anEntity2FamilyID.end(); anIter++){
const EEntiteMaillage& anEntity = anIter->first;
INITMSG(MYDEBUG,"anEntity = "<<anEntity<<":\n");
const TFamilyID2Size& aFamilyID2Size = anIter->second;
TFamilyID2Size::const_iterator anIter2 = aFamilyID2Size.begin();
for(; anIter2 != aFamilyID2Size.end(); anIter2++){
TInt anId = anIter2->first;
TInt aSize = anIter2->second;
TId2Family::const_iterator anIter3 = anId2Family.find(anId);
if(anIter3 != anId2Family.end()){
const PFamilyInfo& aFamilyInfo = anIter3->second;
anEntity2FamilySet[anEntity].insert(TFamilyTSize(aFamilyInfo,aSize));
INITMSG(MYDEBUG,
"aFamilyName = '"<<aFamilyInfo->GetName()<<
"' anId = "<<aFamilyInfo->GetId()<<"\n");
}
}
}
}
}
ADDMSG(MYDEBUG,"\n");
return anEntity2FamilySet;
}
//---------------------------------------------------------------
TKey2Gauss
GetKey2Gauss(const PWrapper& theWrapper,
TErr* theErr,
EModeSwitch theMode)
{
INITMSG(MYDEBUG,"GetKey2Gauss - theMode = "<<theMode<<std::endl);
TKey2Gauss aKey2Gauss;
TInt aNbGauss = theWrapper->GetNbGauss(theErr);
for(TInt anId = 1; anId <= aNbGauss; anId++){
TGaussInfo::TInfo aPreInfo = theWrapper->GetGaussPreInfo(anId);
PGaussInfo anInfo = theWrapper->CrGaussInfo(aPreInfo,theMode);
theWrapper->GetGaussInfo(anId,anInfo,theErr);
TGaussInfo::TKey aKey = boost::get<0>(aPreInfo);
aKey2Gauss[aKey] = anInfo;
#ifdef _DEBUG_
const EGeometrieElement& aGeom = boost::get<0>(aKey);
const std::string& aName = boost::get<1>(aKey);
INITMSG(MYDEBUG,
"- aGeom = "<<aGeom<<
"; aName = '"<<aName<<"'"<<
std::endl);
#endif
}
return aKey2Gauss;
}
//---------------------------------------------------------------
PProfileInfo
GetProfileInfo(const PWrapper& theWrapper,
const std::string& theProfileName,
TErr* theErr,
EModeProfil theMode)
{
PProfileInfo anInfo;
TInt aNbProfiles = theWrapper->GetNbProfiles(theErr);
for(TInt anId = 1; anId <= aNbProfiles; anId++){
TProfileInfo::TInfo aPreInfo = theWrapper->GetProfilePreInfo(anId);
const std::string& aName = boost::get<0>(aPreInfo);
if(aName == theProfileName)
return theWrapper->GetPProfileInfo(anId,theMode,theErr);
}
return anInfo;
}
//---------------------------------------------------------------
TMKey2Profile
GetMKey2Profile(const PWrapper& theWrapper,
TErr* theErr,
EModeProfil theMode)
{
INITMSG(MYDEBUG,"GetMKey2Profile - theMode = "<<theMode<<std::endl);
TKey2Profile aKey2Profile;
TInt aNbProfiles = theWrapper->GetNbProfiles(theErr);
for(TInt anId = 1; anId <= aNbProfiles; anId++){
TProfileInfo::TInfo aPreInfo = theWrapper->GetProfilePreInfo(anId);
PProfileInfo anInfo = theWrapper->GetPProfileInfo(anId,theMode,theErr);
const std::string& aName = boost::get<0>(aPreInfo);
aKey2Profile[aName] = anInfo;
#ifdef _DEBUG_
INITMSG(MYDEBUG,
"- aName = '"<<aName<<"'"<<
" : "<<
std::endl);
TInt aNbElem = anInfo->GetSize();
for(TInt iElem = 0; iElem < aNbElem; iElem++){
ADDMSG(MYVALUEDEBUG,anInfo->GetElemNum(iElem)<<", ");
}
ADDMSG(MYVALUEDEBUG, std::endl);
#endif
}
return TMKey2Profile(theMode,aKey2Profile);
}
//---------------------------------------------------------------
EEntiteMaillage
GetEntityByFamilyId(PGrilleInfo& theInfo,TInt theId){
TElemNum::iterator aNodeFamIter = (theInfo->myFamNumNode).begin();
for(;aNodeFamIter != (theInfo->myFamNumNode).end(); aNodeFamIter++){
if(theId == *aNodeFamIter)
return eNOEUD;
}
TElemNum::iterator aCellFamIter = (theInfo->myFamNum).begin();
for(;aCellFamIter != (theInfo->myFamNum).end(); aCellFamIter++){
if(theId == *aCellFamIter)
return eMAILLE;
}
EXCEPTION(std::runtime_error, "GetEntityByFamilyId - fails");
return EEntiteMaillage(-1);
}
TFamilyID2NbCells
GetFamilyID2NbCells(PGrilleInfo& theInfo){
TFamilyID2NbCells aFamily2NbCells;
TInt aNbNodes = theInfo->myFamNumNode.size();
TInt aNbCells = theInfo->myFamNum.size();
for(TInt i=0; i<aNbNodes; i++) aFamily2NbCells[theInfo->GetFamNumNode(i)] = 0;
for(TInt i=0; i<aNbCells; i++) aFamily2NbCells[theInfo->GetFamNum(i)] = 0;
for(TInt i=0; i<aNbNodes; i++) aFamily2NbCells[theInfo->GetFamNumNode(i)] += 1;
for(TInt i=0; i<aNbCells; i++) aFamily2NbCells[theInfo->GetFamNum(i)] += 1;
return aFamily2NbCells;
}
EEntiteMaillage ConvertEntity(const EEntiteMaillage& aEntity){
switch( aEntity ){
case eNOEUD_ELEMENT:
case eMAILLE: return eMAILLE; //eNOEUD_ELEMENT it is eMAILLE
case eFACE:
case eARETE:
case eNOEUD: return aEntity; break;
default: return EEntiteMaillage(-1);
}
}
}

View File

@ -0,0 +1,157 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#ifndef MED_Algorithm_HeaderFile
#define MED_Algorithm_HeaderFile
#include "MED_WrapperBase.hxx"
#include "MED_Structures.hxx"
#include <set>
namespace MED
{
//---------------------------------------------------------------
typedef std::map<EGeometrieElement,PElemInfo> TGeom2ElemInfo;
typedef std::map<EEntiteMaillage,TGeom2ElemInfo> TEntity2TGeom2ElemInfo;
//! Get set of TElemInfo by its geometrical type and corresponding MED ENTITY
MEDWRAPPER_EXPORT
TEntity2TGeom2ElemInfo
GetEntity2TGeom2ElemInfo(const PWrapper& theWrapper,
const PMeshInfo& theMeshInfo,
const MED::TEntityInfo& theEntityInfo);
//---------------------------------------------------------------
typedef std::set<PFamilyInfo> TFamilyInfoSet;
//! Read set of MED FAMILIES for defined MED file
MEDWRAPPER_EXPORT
TFamilyInfoSet
GetFamilyInfoSet(const PWrapper& theWrapper,
const PMeshInfo& theMeshInfo);
//---------------------------------------------------------------
typedef boost::tuple<PFamilyInfo,TInt> TFamilyTSize;
bool
operator<(const TFamilyTSize& theLeft, const TFamilyTSize& theRight);
typedef std::set<TFamilyTSize> TFamilyTSizeSet;
//---------------------------------------------------------------
typedef std::map<EEntiteMaillage,TFamilyTSizeSet> TEntity2FamilySet;
//! Split set of MED FAMILIES by corresponding MED ENTITY
MEDWRAPPER_EXPORT
TEntity2FamilySet
GetEntity2FamilySet(const PWrapper& theWrapper,
const TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
const TFamilyInfoSet& theFamilyInfoSet);
//---------------------------------------------------------------
typedef std::map<std::string,TFamilyInfoSet> TGroupInfo;
//! Split the input set of MED FAMILIES by corresponding MED GROUPS
MEDWRAPPER_EXPORT
TGroupInfo
GetGroupInfo(const TFamilyInfoSet& theFamilyInfoSet);
//---------------------------------------------------------------
typedef std::set<PTimeStampInfo> TTimeStampInfoSet;
typedef std::map<PFieldInfo,TTimeStampInfoSet> TFieldInfo2TimeStampInfoSet;
//! Read set of MED TIMESTAMPS groupped by corresponding MED FIELDS
MEDWRAPPER_EXPORT
TFieldInfo2TimeStampInfoSet
GetFieldInfo2TimeStampInfoSet(const PWrapper& theWrapper,
const PMeshInfo& theMeshInfo,
const MED::TEntityInfo& theEntityInfo);
//---------------------------------------------------------------
typedef std::map<EEntiteMaillage,TFieldInfo2TimeStampInfoSet> TEntite2TFieldInfo2TimeStampInfoSet;
//! Split the input set of MED TIMESTAMPS by corresponding MED FIELDS and MED ENTITIES
MEDWRAPPER_EXPORT
TEntite2TFieldInfo2TimeStampInfoSet
GetEntite2TFieldInfo2TimeStampInfoSet(const TFieldInfo2TimeStampInfoSet& theFieldInfo2TimeStampInfoSet);
//---------------------------------------------------------------
typedef std::map<TGaussInfo::TKey,PGaussInfo,TGaussInfo::TLess> TKey2Gauss;
//! Read set of MED GAUSS
MEDWRAPPER_EXPORT
TKey2Gauss
GetKey2Gauss(const PWrapper& theWrapper,
TErr* theErr = NULL,
EModeSwitch theMode = eFULL_INTERLACE);
//---------------------------------------------------------------
//! Get MED PROFILE by its name
MEDWRAPPER_EXPORT
PProfileInfo
GetProfileInfo(const PWrapper& theWrapper,
const std::string& theProfileName,
TErr* theErr = NULL,
EModeProfil theMode = eCOMPACT);
//---------------------------------------------------------------
typedef std::map<TProfileInfo::TKey,PProfileInfo> TKey2Profile;
typedef boost::tuple<EModeProfil,TKey2Profile> TMKey2Profile;
//! Read set of MED PROFILES
MEDWRAPPER_EXPORT
TMKey2Profile
GetMKey2Profile(const PWrapper& theWrapper,
TErr* theErr = NULL,
EModeProfil theMode = eCOMPACT);
//---------------------------------------------------------------
//! Get Entity for Grille by family id.
MEDWRAPPER_EXPORT
EEntiteMaillage
GetEntityByFamilyId(PGrilleInfo& theInfo,
TInt theId);
typedef std::map<TInt,TInt> TFamilyID2NbCells;
//! Get Number of cells for theId family, for Grille
MEDWRAPPER_EXPORT
TFamilyID2NbCells
GetFamilyID2NbCells(PGrilleInfo& theInfo);
//! Convert eNOEUD_ELEMENT to eMAILLE
MEDWRAPPER_EXPORT
EEntiteMaillage
ConvertEntity(const EEntiteMaillage& aEntity);
}
#endif

View File

@ -0,0 +1,186 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MED_Common_HeaderFile
#define MED_Common_HeaderFile
#include "MED_WrapperBase.hxx"
#include <string>
#include <set>
#include <map>
#include <hdf5.h>
#include <boost/tuple/tuple.hpp>
#include "SALOMEconfig.h"
#include "MED_Vector.hxx"
#include "MED_SharedPtr.hxx"
#include "MED_SliceArray.hxx"
#ifdef WIN32
#pragma warning(disable:4099)
#endif
namespace MED{
enum EVersion {eVUnknown = -1, eV2_1, eV2_2};
typedef enum {eFAUX, eVRAI} EBooleen ;
typedef double TFloat;
#if defined(HAVE_F77INT64)
typedef long TInt;
#else
typedef int TInt;
#endif
typedef hid_t TIdt;
typedef herr_t TErr;
typedef enum {eFULL_INTERLACE, eNO_INTERLACE} EModeSwitch;
typedef enum {eFLOAT64=6, eINT=26} ETypeChamp;
typedef enum {eNON_STRUCTURE, eSTRUCTURE} EMaillage;
typedef enum {eCART, eCYL, eSPHER} ERepere;
typedef enum {eNOD, eDESC} EConnectivite ;
typedef enum {ePOINT1=1, eSEG2=102, eSEG3=103, eTRIA3=203,
eQUAD4=204, eTRIA6=206, eTRIA7=207, eQUAD8=208, eQUAD9=209,eTETRA4=304,
ePYRA5=305, ePENTA6=306, eHEXA8=308, eOCTA12=312, eTETRA10=310,
ePYRA13=313, ePENTA15=315, eHEXA20=320, eHEXA27=327,
ePOLYGONE=400, ePOLYEDRE=500, eNONE=0,
eBALL=1101 /*no such a type in med.h, it's just a trick*/,
eAllGeoType=-1 } EGeometrieElement;
typedef enum {eMAILLE, eFACE, eARETE, eNOEUD, eNOEUD_ELEMENT, eSTRUCT_ELEMENT} EEntiteMaillage;
typedef enum {eNO_PFLMOD, eGLOBAL, eCOMPACT} EModeProfil;
typedef enum {eGRILLE_CARTESIENNE, eGRILLE_POLAIRE, eGRILLE_STANDARD} EGrilleType;
typedef enum {eCOOR, eCONN, eNOM, eNUM, eFAM, eCOOR_IND1, eCOOR_IND2, eCOOR_IND3} ETable;
typedef TVector<TFloat> TFloatVector;
typedef TVector<std::string> TStringVector;
typedef TVector<TInt> TIntVector;
typedef std::set<std::string> TStringSet;
typedef std::map<EGeometrieElement,TInt> TGeom2Size;
typedef std::map<EEntiteMaillage,TGeom2Size> TEntityInfo;
typedef std::set<EGeometrieElement> TGeomSet;
typedef std::map<EEntiteMaillage,TGeomSet> TEntity2GeomSet;
MEDWRAPPER_EXPORT
const TEntity2GeomSet&
GetEntity2GeomSet();
template<EVersion>
TInt MEDWRAPPER_EXPORT
GetDESCLength();
template<EVersion>
TInt MEDWRAPPER_EXPORT
GetIDENTLength();
template<EVersion>
TInt MEDWRAPPER_EXPORT
GetNOMLength();
template<EVersion>
TInt MEDWRAPPER_EXPORT
GetLNOMLength();
template<EVersion>
TInt MEDWRAPPER_EXPORT
GetPNOMLength();
template<EVersion>
void MEDWRAPPER_EXPORT
GetVersionRelease(TInt& majeur, TInt& mineur, TInt& release);
template<EVersion>
MEDWRAPPER_EXPORT
TInt
GetNbConn(EGeometrieElement typmai,
EEntiteMaillage typent,
TInt mdim);
MEDWRAPPER_EXPORT
TInt
GetNbNodes(EGeometrieElement typmai);
struct TNameInfo;
typedef SharedPtr<TNameInfo> PNameInfo;
struct TMeshInfo;
typedef SharedPtr<TMeshInfo> PMeshInfo;
struct TFamilyInfo;
typedef SharedPtr<TFamilyInfo> PFamilyInfo;
struct TElemInfo;
typedef SharedPtr<TElemInfo> PElemInfo;
struct TNodeInfo;
typedef SharedPtr<TNodeInfo> PNodeInfo;
struct TPolygoneInfo;
typedef SharedPtr<TPolygoneInfo> PPolygoneInfo;
struct TPolyedreInfo;
typedef SharedPtr<TPolyedreInfo> PPolyedreInfo;
struct TCellInfo;
typedef SharedPtr<TCellInfo> PCellInfo;
struct TBallInfo;
typedef SharedPtr<TBallInfo> PBallInfo;
struct TFieldInfo;
typedef SharedPtr<TFieldInfo> PFieldInfo;
struct TTimeStampInfo;
typedef SharedPtr<TTimeStampInfo> PTimeStampInfo;
struct TProfileInfo;
typedef SharedPtr<TProfileInfo> PProfileInfo;
struct TGaussInfo;
typedef SharedPtr<TGaussInfo> PGaussInfo;
class TGrilleInfo;
typedef SharedPtr<TGrilleInfo> PGrilleInfo;
struct TTimeStampValueBase;
typedef SharedPtr<TTimeStampValueBase> PTimeStampValueBase;
struct TWrapper;
typedef SharedPtr<TWrapper> PWrapper;
}
#endif

View File

@ -0,0 +1,160 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#include "MED_CoordUtils.hxx"
#include "MED_Utilities.hxx"
namespace MED
{
enum ECoordName{eX, eY, eZ, eNone};
template<ECoordName TCoordId>
TFloat
GetCoord(const TCCoordSlice& theCoordSlice)
{
return theCoordSlice[TCoordId];
}
template<>
TFloat
GetCoord<eNone>(const TCCoordSlice& theCoordSlice)
{
return 0.0;
}
TGetCoord
aXYZGetCoord[3] = {
&GetCoord<eX>,
&GetCoord<eY>,
&GetCoord<eZ>
};
TGetCoord
aXYGetCoord[3] = {
&GetCoord<eX>,
&GetCoord<eY>,
&GetCoord<eNone>
};
TGetCoord
aYZGetCoord[3] = {
&GetCoord<eNone>,
&GetCoord<eX>,
&GetCoord<eY>
};
TGetCoord
aXZGetCoord[3] = {
&GetCoord<eX>,
&GetCoord<eNone>,
&GetCoord<eY>
};
TGetCoord
aXGetCoord[3] = {
&GetCoord<eX>,
&GetCoord<eNone>,
&GetCoord<eNone>
};
TGetCoord
aYGetCoord[3] = {
&GetCoord<eNone>,
&GetCoord<eX>,
&GetCoord<eNone>
};
TGetCoord
aZGetCoord[3] = {
&GetCoord<eNone>,
&GetCoord<eNone>,
&GetCoord<eX>
};
//---------------------------------------------------------------
TCoordHelper
::TCoordHelper(TGetCoord* theGetCoord):
myGetCoord(theGetCoord)
{}
TFloat
TCoordHelper
::GetCoord(TCCoordSlice& theCoordSlice,
TInt theCoordId)
{
return (*myGetCoord[theCoordId])(theCoordSlice);
}
//---------------------------------------------------------------
PCoordHelper
GetCoordHelper(PNodeInfo theNodeInfo)
{
PCoordHelper aCoordHelper;
{
PMeshInfo aMeshInfo = theNodeInfo->GetMeshInfo();
TInt aMeshDimension = aMeshInfo->GetDim();
bool anIsDimPresent[3] = {false, false, false};
for(int iDim = 0; iDim < aMeshDimension; iDim++){
// PAL16857(SMESH not conform to the MED convention) ->
// 1D - always along X
// 2D - always in XOY plane
anIsDimPresent[iDim] = iDim < aMeshDimension;
// std::string aName = theNodeInfo->GetCoordName(iDim);
// if ( aName.size() > 1 ) // PAL12148, aName has size 8 or 16
// aName = aName.substr(0,1);
// if(aName == "x" || aName == "X")
// anIsDimPresent[eX] = true;
// else if(aName == "y" || aName == "Y")
// anIsDimPresent[eY] = true;
// else if(aName == "z" || aName == "Z")
// anIsDimPresent[eZ] = true;
}
switch(aMeshDimension){
case 3:
aCoordHelper.reset(new TCoordHelper(aXYZGetCoord));
break;
case 2:
if(anIsDimPresent[eY] && anIsDimPresent[eZ])
aCoordHelper.reset(new TCoordHelper(aYZGetCoord));
else if(anIsDimPresent[eX] && anIsDimPresent[eZ])
aCoordHelper.reset(new TCoordHelper(aXZGetCoord));
else
aCoordHelper.reset(new TCoordHelper(aXYGetCoord));
break;
case 1:
if(anIsDimPresent[eY])
aCoordHelper.reset(new TCoordHelper(aYGetCoord));
else if(anIsDimPresent[eZ])
aCoordHelper.reset(new TCoordHelper(aZGetCoord));
else
aCoordHelper.reset(new TCoordHelper(aXGetCoord));
break;
}
}
return aCoordHelper;
}
}

View File

@ -0,0 +1,57 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#ifndef MED_CoordUtils_HeaderFile
#define MED_CoordUtils_HeaderFile
#include "MED_WrapperBase.hxx"
#include "MED_Structures.hxx"
namespace MED
{
typedef TFloat (*TGetCoord)(const TCCoordSlice& theCoordSlice);
//---------------------------------------------------------------
class MEDWRAPPER_EXPORT TCoordHelper
{
TGetCoord* myGetCoord;
public:
TCoordHelper(TGetCoord* theGetCoord);
TFloat
GetCoord(TCCoordSlice& theCoordSlice,
TInt theCoordId);
};
typedef SharedPtr<TCoordHelper> PCoordHelper;
//---------------------------------------------------------------
MEDWRAPPER_EXPORT
PCoordHelper
GetCoordHelper(PNodeInfo theNodeInfo);
}
#endif

View File

@ -0,0 +1,570 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : MED_GaussDef.hxx
// Author : Edward AGAPOV (eap)
//
#include "MED_GaussDef.hxx"
#include "MED_Utilities.hxx"
#include "MED_GaussUtils.hxx"
namespace MED
{
using namespace std;
using namespace MED;
//---------------------------------------------------------------
void TGaussDef::add(const double x, const double weight)
{
if ( dim() != 1 )
EXCEPTION( logic_error,"dim() != 1");
if ( myWeights.capacity() == myWeights.size() )
EXCEPTION( logic_error,"Extra gauss point");
myCoords.push_back( x );
myWeights.push_back( weight );
}
void TGaussDef::add(const double x, const double y, const double weight)
{
if ( dim() != 2 )
EXCEPTION( logic_error,"dim() != 2");
if ( myWeights.capacity() == myWeights.size() )
EXCEPTION( logic_error,"Extra gauss point");
myCoords.push_back( x );
myCoords.push_back( y );
myWeights.push_back( weight );
}
void TGaussDef::add(const double x, const double y, const double z, const double weight)
{
if ( dim() != 3 )
EXCEPTION( logic_error,"dim() != 3");
if ( myWeights.capacity() == myWeights.size() )
EXCEPTION( logic_error,"Extra gauss point");
myCoords.push_back( x );
myCoords.push_back( y );
myCoords.push_back( z );
myWeights.push_back( weight );
}
void TGaussDef::setRefCoords(const TShapeFun& aShapeFun)
{
myRefCoords.reserve( aShapeFun.myRefCoord.size() );
myRefCoords.assign( aShapeFun.myRefCoord.begin(),
aShapeFun.myRefCoord.end() );
}
//---------------------------------------------------------------
/*!
* \brief Fill definition of gauss points family
*/
//---------------------------------------------------------------
TGaussDef::TGaussDef(const int geom, const int nbGauss, const int variant)
{
myType = geom;
myCoords .reserve( nbGauss * dim() );
myWeights.reserve( nbGauss );
switch ( geom ) {
case eSEG2:
case eSEG3:
if (geom == eSEG2) setRefCoords( TSeg2a() );
else setRefCoords( TSeg3a() );
switch ( nbGauss ) {
case 1: {
add( 0.0, 2.0 ); break;
}
case 2: {
const double a = 0.577350269189626;
add( a, 1.0 );
add( -a, 1.0 ); break;
}
case 3: {
const double a = 0.774596669241;
const double P1 = 1./1.8;
const double P2 = 1./1.125;
add( -a, P1 );
add( 0, P2 );
add( a, P1 ); break;
}
case 4: {
const double a = 0.339981043584856, b = 0.861136311594053;
const double P1 = 0.652145154862546, P2 = 0.347854845137454 ;
add( a, P1 );
add( -a, P1 );
add( b, P2 );
add( -b, P2 ); break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for SEG"<<nbGauss);
}
break;
case eTRIA3:
case eTRIA6:
if ( variant == 1 ) {
if (geom == eTRIA3) setRefCoords( TTria3b() );
else setRefCoords( TTria6b() );
switch ( nbGauss ) {
case 1: { // FPG1
add( 1/3., 1/3., 1/2. ); break;
}
case 3: { // FPG3
// what about COT3 ???
add( 1/6., 1/6., 1/6. );
add( 2/3., 1/6., 1/6. );
add( 1/6., 2/3., 1/6. ); break;
}
case 4: { // FPG4
add( 1/5., 1/5., 25/(24*4.) );
add( 3/5., 1/5., 25/(24*4.) );
add( 1/5., 3/5., 25/(24*4.) );
add( 1/3., 1/3., -27/(24*4.) ); break;
}
case 6: { // FPG6
const double P1 = 0.11169079483905, P2 = 0.0549758718227661;
const double a = 0.445948490915965, b = 0.091576213509771;
add( b, b, P2 );
add( 1-2*b, b, P2 );
add( b, 1-2*b, P2 );
add( a, 1-2*a, P1 );
add( a, a, P1 );
add( 1-2*a, a, P1 ); break;
}
case 7: { // FPG7
const double A = 0.470142064105115;
const double B = 0.101286507323456;
const double P1 = 0.066197076394253;
const double P2 = 0.062969590272413;
add( 1/3., 1/3., 9/80. );
add( A, A, P1 );
add( 1-2*A, A, P1 );
add( A, 1-2*A, P1 );
add( B, B, P2 );
add( 1-2*B, B, P2 );
add( B, 1-2*B, P2 ); break;
}
case 12: { // FPG12
const double A = 0.063089014491502;
const double B = 0.249286745170910;
const double C = 0.310352451033785;
const double D = 0.053145049844816;
const double P1 = 0.025422453185103;
const double P2 = 0.058393137863189;
const double P3 = 0.041425537809187;
add( A, A, P1 );
add( 1-2*A, A, P1 );
add( A, 1-2*A, P1 );
add( B, B, P2 );
add( 1-2*B, B, P2 );
add( B, 1-2*B, P2 );
add( C, D, P3 );
add( D, C, P3 );
add( 1-C-D, C, P3 );
add( 1-C-D, D, P3 );
add( C, 1-C-D, P3 );
add( D, 1-C-D, P3 ); break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for TRIA, variant 1: "
<<nbGauss);
}
}
else if ( variant == 2 ) {
if (geom == eTRIA3) setRefCoords( TTria3a() );
else setRefCoords( TTria6a() );
switch ( nbGauss ) {
case 1: {
add( -1/3., -1/3., 2. ); break;
}
case 3: {
add( -2/3., 1/3., 2/3. );
add( -2/3., -2/3., 2/3. );
add( 1/3., -2/3., 2/3. ); break;
}
case 6: {
const double P1 = 0.11169079483905, P2 = 0.0549758718227661;
const double A = 0.445948490915965, B = 0.091576213509771;
add( 2*B-1, 1-4*B, 4*P2 );
add( 2*B-1, 2*B-1, 4*P2 );
add( 1-4*B, 2*B-1, 4*P2 );
add( 1-4*A, 2*A-1, 4*P1 );
add( 2*A-1, 1-4*A, 4*P1 );
add( 2*A-1, 2*A-1, 4*P1 ); break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for TRIA, variant 2: "
<<nbGauss);
}
}
else if ( variant == 3 ) {
if (geom == eTRIA3) setRefCoords( TTria3b() );
else setRefCoords( TTria6b() );
switch ( nbGauss ) {
case 4: {
add( 1/3., 1/3., -27/96 );
add( 0.2 , 0.2 , 25/96 );
add( 0.6 , 0.2 , 25/96 );
add( 0.2 , 0.6 , 25/96 ); break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for TRIA, variant 3: "
<<nbGauss);
}
}
break;
case eQUAD4:
case eQUAD8:
if ( variant == 1 ) {
if (geom == eQUAD4) setRefCoords( TQuad4b() );
else setRefCoords( TQuad8b() );
switch ( nbGauss ) {
case 1: { // FPG1
add( 0, 0, 4 ); break;
}
case 4: { // FPG4
const double a = 1/sqrt(3.);
add( -a, -a, 1 );
add( a, -a, 1 );
add( a, a, 1 );
add( -a, a, 1 ); break;
}
case 9: { // FPG9
const double a = 0.774596669241483;
add( -a, -a, 25/81. );
add( a, -a, 25/81. );
add( a, a, 25/81. );
add( -a, a, 25/81. );
add( 0., -a, 40/81. );
add( a, 0., 40/81. );
add( 0., a, 40/81. );
add( -a, 0., 40/81. );
add( 0., 0., 64/81. ); break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for QUAD, variant 1: "
<<nbGauss);
}
}
else if ( variant == 2 ) {
if (geom == eQUAD4) setRefCoords( TQuad4a() );
else setRefCoords( TQuad8a() );
switch ( nbGauss ) {
case 4: {
const double a = 1/sqrt(3.);
add( -a, a, 1 );
add( -a, -a, 1 );
add( a, -a, 1 );
add( a, a, 1 ); break;
}
case 9: {
const double a = 0.774596669241483;
add( -a, a, 25/81. );
add( -a, -a, 25/81. );
add( a, -a, 25/81. );
add( a, a, 25/81. );
add( -a, 0., 40/81. );
add( 0., -a, 40/81. );
add( a, 0., 40/81. );
add( 0., a, 40/81. );
add( 0., 0., 64/81. ); break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for QUAD, variant 1: "
<<nbGauss);
}
}
else if ( variant == 3 ) {
if (geom == eQUAD4) setRefCoords( TQuad4b() );
else setRefCoords( TQuad8b() );
switch ( nbGauss ) {
case 4: {
const double a = 3/sqrt(3.);
add( -a, -a, 1 );
add( -a, a, 1 );
add( a, -a, 1 );
add( a, a, 1 ); break;
}
case 9: {
const double a = sqrt(3/5.), c1 = 5/9., c2 = 8/9.;
const double c12 = c1*c2, c22 = c2*c2, c1c2 = c1*c2;
add( -a, -a, c12 );
add( -a, 0., c1c2 );
add( -a, a, c12 );
add( 0., -a, c1c2 );
add( 0., 0., c22 );
add( 0., a, c1c2 );
add( a, -a, c12 );
add( a, 0., c1c2 );
add( a, a, c12 ); break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for QUAD, variant 3: "
<<nbGauss);
}
}
break;
case eTETRA4:
case eTETRA10:
if (geom == eTETRA4) setRefCoords( TTetra4a() );
else setRefCoords( TTetra10a() );
switch ( nbGauss ) {
case 4: { // FPG4
const double a = (5 - sqrt(5.))/20., b = (5 + 3*sqrt(5.))/20.;
add( a, a, a, 1/24. );
add( a, a, b, 1/24. );
add( a, b, a, 1/24. );
add( b, a, a, 1/24. ); break;
}
case 5: { // FPG5
const double a = 0.25, b = 1/6., c = 0.5;
add( a, a, a, -2/15. );
add( b, b, b, 3/40. );
add( b, b, c, 3/40. );
add( b, c, b, 3/40. );
add( c, b, b, 3/40. ); break;
}
case 15: { // FPG15
const double a = 0.25;
const double b1 = (7 + sqrt(15.))/34., c1 = (13 + 3*sqrt(15.))/34., d = (5 - sqrt(15.))/20.;
const double b2 = (7 - sqrt(15.))/34., c2 = (13 - 3*sqrt(15.))/34., e = (5 + sqrt(15.))/20.;
const double P1 = (2665 - 14*sqrt(15.))/226800.;
const double P2 = (2665 + 14*sqrt(15.))/226800.;
add( a, a, a, 8/405.);//_____
add( b1, b1, b1, P1 );
add( b1, b1, c1, P1 );
add( b1, c1, b1, P1 );
add( c1, b1, b1, P1 );//_____
add( b2, b2, b2, P2 );
add( b2, b2, c2, P2 );
add( b2, c2, b2, P2 );
add( c2, b2, b2, P2 );//_____
add( d, d, e, 5/567.);
add( d, e, d, 5/567.);
add( e, d, d, 5/567.);
add( d, e, e, 5/567.);
add( e, d, e, 5/567.);
add( e, e, d, 5/567.);
break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for TETRA: "<<nbGauss);
}
break;
case ePYRA5:
case ePYRA13:
if (geom == ePYRA5) setRefCoords( TPyra5a() );
else setRefCoords( TPyra13a() );
switch ( nbGauss ) {
case 5: { // FPG5
const double h1 = 0.1531754163448146;
const double h2 = 0.6372983346207416;
add( .5, 0., h1, 2/15. );
add( 0., .5, h1, 2/15. );
add( -.5, 0., h1, 2/15. );
add( 0., -.5, h1, 2/15. );
add( 0., 0., h2, 2/15. ); break;
}
case 6: { // FPG6
const double p1 = 0.1024890634400000 ;
const double p2 = 0.1100000000000000 ;
const double p3 = 0.1467104129066667 ;
const double a = 0.5702963741068025 ;
const double h1 = 0.1666666666666666 ;
const double h2 = 0.08063183038464675;
const double h3 = 0.6098484849057127 ;
add( a, 0., h1, p1 );
add( 0., a, h1, p1 );
add( -a, 0., h1, p1 );
add( 0., -a, h1, p1 );
add( 0., 0., h2, p2 );
add( 0., 0., h3, p3 ); break;
}
case 27: { // FPG27
const double a1 = 0.788073483;
const double b6 = 0.499369002;
const double b1 = 0.848418011;
const double c8 = 0.478508449;
const double c1 = 0.652816472;
const double d12 = 0.032303742;
const double d1 = 1.106412899;
double z = 1/2., fz = b1/2*(1 - z);
add( 0., 0., z, a1 ); // 1
add( fz, fz, z, b6 ); // 2
add( -fz, fz, z, b6 ); // 3
add( -fz, -fz, z, b6 ); // 4
add( fz, -fz, z, b6 ); // 5
z = (1 - b1)/2.;
add( 0., 0., z, b6 ); // 6
z = (1 + b1)/2.;
add( 0., 0., z, b6 ); // 7
z = (1 - c1)/2.; fz = c1*(1 - z);
add( fz, 0., z, c8 ); // 8
add( 0., fz, z, c8 ); // 9
add( -fz, 0., z, c8 ); // 10
add( 0., -fz, z, c8 ); // 11
z = (1 + c1)/2.; fz = c1*(1 - z);
add( fz, 0., z, c8 ); // 12
add( 0., fz, z, c8 ); // 13
add( -fz, 0., z, c8 ); // 14
add( 0., -fz, z, c8 ); // 15
z = (1 - d1)/2., fz = d1/2*(1 - z);
add( fz, fz, z, d12); // 16
add( -fz, fz, z, d12); // 17
add( -fz, -fz, z, d12); // 18
add( fz, -fz, z, d12); // 19
z = 1/2.; fz = d1*(1 - z);
add( fz, 0., z, d12); // 20
add( 0., fz, z, d12); // 21
add( -fz, 0., z, d12); // 22
add( 0., -fz, z, d12); // 23
z = (1 + d1)/2., fz = d1/2*(1 - z);
add( fz, fz, z, d12); // 24
add( -fz, fz, z, d12); // 25
add( -fz, -fz, z, d12); // 26
add( fz, -fz, z, d12); // 27
break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for PYRA: "<<nbGauss);
}
break;
case ePENTA6:
case ePENTA15:
if (geom == ePENTA6) setRefCoords( TPenta6a() );
else setRefCoords( TPenta15a() );
switch ( nbGauss ) {
case 6: { // FPG6
const double a = sqrt(3.)/3.;
add( -a, .5, .5, 1/6. );
add( -a, 0., .5, 1/6. );
add( -a, .5, 0., 1/6. );
add( a, .5, .5, 1/6. );
add( a, 0., .5, 1/6. );
add( a, .5, 0., 1/6. ); break;
}
case 8: { // FPG8
const double a = 0.577350269189626;
add( -a, 1/3., 1/3., -27/96. );
add( -a, 0.6, 0.2, 25/96. );
add( -a, 0.2, 0.6, 25/96. );
add( -a, 0.2, 0.2, 25/96. );
add( +a, 1/3., 1/3., -27/96. );
add( +a, 0.6, 0.2, 25/96. );
add( +a, 0.2, 0.6, 25/96. );
add( +a, 0.2, 0.2, 25/96. ); break;
}
case 21: { // FPG21
const double d = sqrt(3/5.), c1 = 5/9., c2 = 8/9.; // d <=> alfa
const double a = (6 + sqrt(15.))/21.;
const double b = (6 - sqrt(15.))/21.;
const double P1 = (155 + sqrt(15.))/2400.;
const double P2 = (155 - sqrt(15.))/2400.; //___
add( -d, 1/3., 1/3., c1*9/80. );//___
add( -d, a, a, c1*P1 );
add( -d, 1-2*a, a, c1*P1 );
add( -d, a, 1-2*a, c1*P1 );//___
add( -d, b, b, c1*P2 );
add( -d, 1-2*b, b, c1*P2 );
add( -d, b, 1-2*b, c1*P2 );//___
add( 0., 1/3., 1/3., c2*9/80. );//___
add( 0., a, a, c2*P1 );
add( 0., 1-2*a, a, c2*P1 );
add( 0., a, 1-2*a, c2*P1 );//___
add( 0., b, b, c2*P2 );
add( 0., 1-2*b, b, c2*P2 );
add( 0., b, 1-2*b, c2*P2 );//___
add( d, 1/3., 1/3., c1*9/80. );//___
add( d, a, a, c1*P1 );
add( d, 1-2*a, a, c1*P1 );
add( d, a, 1-2*a, c1*P1 );//___
add( d, b, b, c1*P2 );
add( d, 1-2*b, b, c1*P2 );
add( d, b, 1-2*b, c1*P2 );//___
break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for PENTA: " <<nbGauss);
}
break;
case eHEXA8:
case eHEXA20:
if (geom == eHEXA8) setRefCoords( THexa8a() );
else setRefCoords( THexa20a() );
switch ( nbGauss ) {
case 8: { // FPG8
const double a = sqrt(3.)/3.;
add( -a, -a, -a, 1. );
add( -a, -a, a, 1. );
add( -a, a, -a, 1. );
add( -a, a, a, 1. );
add( a, -a, -a, 1. );
add( a, -a, a, 1. );
add( a, a, -a, 1. );
add( a, a, a, 1. ); break;
}
case 27: { // FPG27
const double a = sqrt(3/5.), c1 = 5/9., c2 = 8/9.;
const double c12 = c1*c1, c13 = c1*c1*c1;
const double c22 = c2*c2, c23 = c2*c2*c2;
add( -a, -a, -a, c13 ); // 1
add( -a, -a, 0., c12*c2 ); // 2
add( -a, -a, a, c13 ); // 3
add( -a, 0., -a, c12*c2 ); // 4
add( -a, 0., 0., c1*c22 ); // 5
add( -a, 0., a, c12*c2 ); // 6
add( -a, a, -a, c13 ); // 7
add( -a, a, 0., c12*c2 ); // 8
add( -a, a, a, c13 ); // 9
add( 0., -a, -a, c12*c2 ); // 10
add( 0., -a, 0., c1*c22 ); // 11
add( 0., -a, a, c12*c2 ); // 12
add( 0., 0., -a, c1*c22 ); // 13
add( 0., 0., 0., c23 ); // 14
add( 0., 0., a, c1*c22 ); // 15
add( 0., a, -a, c12*c2 ); // 16
add( 0., a, 0., c1*c22 ); // 17
add( 0., a, a, c12*c2 ); // 18
add( a, -a, -a, c13 ); // 19
add( a, -a, 0., c12*c2 ); // 20
add( a, -a, a, c13 ); // 21
add( a, 0., -a, c12*c2 ); // 22
add( a, 0., 0., c1*c22 ); // 23
add( a, 0., a, c12*c2 ); // 24
add( a, a, -a, c13 ); // 25
add( a, a, 0., c12*c2 ); // 26
add( a, a, a, c13 ); // 27
break;
}
default:
EXCEPTION( logic_error,"Invalid nb of gauss points for PENTA: " <<nbGauss);
}
break;
default:
EXCEPTION( logic_error,"unexpected EGeometrieElement: "<< geom);
}
if ( myWeights.capacity() != myWeights.size() )
EXCEPTION( logic_error,"Not all gauss points defined");
}
}

View File

@ -0,0 +1,69 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : MED_GaussDef.hxx
// Author : Edward AGAPOV (eap)
//
#ifndef MED_GaussDef_HeaderFile
#define MED_GaussDef_HeaderFile
#include "MED_WrapperBase.hxx"
//#include "MED_GaussUtils.hxx" <<<---- avoid dependence on boost
#include <vector>
namespace MED
{
class TShapeFun;
typedef std::vector<double> TDoubleVector;
/*!
* \brief Description of family of integration points
*/
struct TGaussDef
{
int myType; //!< element geometry (EGeometrieElement or med_geometrie_element)
TDoubleVector myRefCoords; //!< description of reference points
TDoubleVector myCoords; //!< coordinates of Gauss points
TDoubleVector myWeights; //!< weights, len(weights)==<nb of gauss points>
/*!
* \brief Creates definition of gauss points family
* \param geomType - element geometry (EGeometrieElement or med_geometrie_element)
* \param nbPoints - nb gauss point
* \param variant - [1-3] to choose the variant of definition
*
* Throws in case of invalid parameters
* variant == 1 refers to "Fonctions de forme et points d'integration
* des elements finis" v7.4 by J. PELLET, X. DESROCHES, 15/09/05
* variant == 2 refers to the same doc v6.4 by J.P. LEFEBVRE, X. DESROCHES, 03/07/03
* variant == 3 refers to the same doc v6.4, second variant for 2D elements
*/
MEDWRAPPER_EXPORT TGaussDef(const int geomType, const int nbPoints, const int variant=1);
MEDWRAPPER_EXPORT int dim() const { return myType/100; }
MEDWRAPPER_EXPORT int nbPoints() const { return myWeights.capacity(); }
private:
void add(const double x, const double weight);
void add(const double x, const double y, const double weight);
void add(const double x, const double y, const double z, const double weight);
void setRefCoords(const TShapeFun& aShapeFun);
};
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,366 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#ifndef MED_GaussUtils_HeaderFile
#define MED_GaussUtils_HeaderFile
#include "MED_WrapperBase.hxx"
#include "MED_Structures.hxx"
namespace MED
{
//---------------------------------------------------------------
typedef TVector<TCCoordSlice> TCCoordSliceArr;
typedef TVector<TCoordSlice> TCoordSliceArr;
//! Define a helper class to handle Gauss Points coordinates
class MEDWRAPPER_EXPORT TGaussCoord:
virtual TModeSwitchInfo
{
TInt myNbElem;
TInt myNbGauss;
TInt myDim;
TInt myGaussStep;
TNodeCoord myGaussCoord;
public:
TGaussCoord();
//! To init the class
void
Init(TInt theNbElem,
TInt theNbGauss,
TInt theDim,
EModeSwitch theMode = eFULL_INTERLACE);
TInt
GetNbElem() const;
TInt
GetNbGauss() const;
TInt
GetDim() const;
unsigned char*
GetValuePtr();
//! Get slice of the coordinate that corresponds to defined cell (const version)
TCCoordSliceArr
GetCoordSliceArr(TInt theElemId) const;
//! Get slice of the coordinate that corresponds to defined cell
TCoordSliceArr
GetCoordSliceArr(TInt theElemId);
};
typedef SharedPtr<TGaussCoord> PGaussCoord;
//---------------------------------------------------------------
//! To calculate Gauss Points coordinates
MEDWRAPPER_EXPORT
bool
GetGaussCoord3D(const TGaussInfo& theGaussInfo,
const TCellInfo& theCellInfo,
const TNodeInfo& theNodeInfo,
TGaussCoord& theGaussCoord,
const TElemNum& theElemNum = TElemNum(),
EModeSwitch theMode = eFULL_INTERLACE);
//---------------------------------------------------------------
//! To calculate Gauss Points coordinates for defined TCellInfo as its bary center
MEDWRAPPER_EXPORT
bool
GetBaryCenter(const TCellInfo& theCellInfo,
const TNodeInfo& theNodeInfo,
TGaussCoord& theGaussCoord,
const TElemNum& theElemNum = TElemNum(),
EModeSwitch theMode = eFULL_INTERLACE);
//! To calculate Gauss Points coordinates for defined TPolygoneInfo as its bary center
MEDWRAPPER_EXPORT
bool
GetBaryCenter(const TPolygoneInfo& thePolygoneInfo,
const TNodeInfo& theNodeInfo,
TGaussCoord& theGaussCoord,
const TElemNum& theElemNum = TElemNum(),
EModeSwitch theMode = eFULL_INTERLACE);
//! To calculate Gauss Points coordinates for defined TPolyedreInfo as its bary center
MEDWRAPPER_EXPORT
bool
GetBaryCenter(const TPolyedreInfo& thePolyedreInfo,
const TNodeInfo& theNodeInfo,
TGaussCoord& theGaussCoord,
const TElemNum& theElemNum = TElemNum(),
EModeSwitch theMode = eFULL_INTERLACE);
//---------------------------------------------------------------
//! Shape function definitions
//---------------------------------------------------------------
struct MEDWRAPPER_EXPORT TShapeFun
{
class TFun;
TFloatVector myRefCoord;
TInt myDim;
TInt myNbRef;
TShapeFun(TInt theDim = 0, TInt theNbRef = 0);
TInt GetNbRef() const { return myNbRef; }
TCCoordSlice GetCoord(TInt theRefId) const;
TCoordSlice GetCoord(TInt theRefId);
void GetFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
virtual
void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const = 0;
virtual
bool IsSatisfy(const TCCoordSliceArr& theRefCoord) const;
bool Eval(const TCellInfo& theCellInfo,
const TNodeInfo& theNodeInfo,
const TElemNum& theElemNum,
const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TGaussCoord& theGaussCoord,
EModeSwitch theMode);
};
//---------------------------------------------------------------
struct TSeg2a: TShapeFun {
TSeg2a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TSeg3a: TShapeFun {
TSeg3a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTria3a: TShapeFun {
TTria3a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTria6a: TShapeFun {
TTria6a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTria3b: TShapeFun {
TTria3b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTria6b: TShapeFun {
TTria6b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad4a: TShapeFun {
TQuad4a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad8a: TShapeFun {
TQuad8a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad9a: TShapeFun {
TQuad9a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad4b: TShapeFun {
TQuad4b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad8b: TShapeFun {
TQuad8b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad9b: TShapeFun {
TQuad9b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTetra4a: TShapeFun {
TTetra4a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTetra10a: TShapeFun {
TTetra10a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTetra4b: TShapeFun {
TTetra4b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTetra10b: TShapeFun {
TTetra10b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct THexa8a: TShapeFun {
THexa8a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct THexa20a: TShapeFun {
THexa20a(TInt theDim = 3, TInt theNbRef = 20);
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct THexa27a: THexa20a {
THexa27a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct THexa8b: TShapeFun {
THexa8b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct THexa20b: TShapeFun {
THexa20b(TInt theDim = 3, TInt theNbRef = 20);
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPenta6a: TShapeFun {
TPenta6a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPenta6b: TShapeFun {
TPenta6b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPenta15a: TShapeFun {
TPenta15a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPenta15b: TShapeFun {
TPenta15b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPyra5a: TShapeFun {
TPyra5a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPyra5b: TShapeFun {
TPyra5b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPyra13a: TShapeFun {
TPyra13a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPyra13b: TShapeFun {
TPyra13b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
}
#endif

View File

@ -0,0 +1,96 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#ifndef MED_SharedPtr_HeaderFile
#define MED_SharedPtr_HeaderFile
#include <boost/shared_ptr.hpp>
namespace MED
{
//! To extend the boost::shared_ptr to support such features automatic dynamic cast
/*!
All entities of the MEDWrapper package are handled as pointer.
This class was introduced to provide correct and flexible memory management
for all of the MEDWrapper objects.
*/
template<class T> class SharedPtr: public boost::shared_ptr<T>
{
public:
//! Default constructor
SharedPtr() {}
//! Construct the class by any type of a pointer
template<class Y>
explicit SharedPtr(Y * p):
boost::shared_ptr<T>(p)
{}
//! Construct the class by any specialisation of the class
template<class Y>
SharedPtr(SharedPtr<Y> const & r):
boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag())
{}
//! Copy-constructor
template<class Y>
SharedPtr&
operator=(SharedPtr<Y> const & r)
{
boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag()).swap(*this);
return *this;
}
//! Introduce a flexible way to reset the wrapped pointer
template<class Y>
SharedPtr&
operator()(Y * p) // Y must be complete
{
return operator=<Y>(SharedPtr<Y>(p));
}
//! Introduce a flexible way to reset the wrapped pointer
template<class Y>
SharedPtr&
operator()(SharedPtr<Y> const & r) // Y must be complete
{
return operator=<Y>(SharedPtr<Y>(r));
}
//! To provide a flexible way to use reference to the wrapped pointer (const version)
operator const T& () const
{
return *(this->get());
}
//! To provide a flexible way to use reference to the wrapped pointer
operator T& ()
{
return *(this->get());
}
};
}
#endif

View File

@ -0,0 +1,186 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#ifndef MED_SliceArray_HeaderFile
#define MED_SliceArray_HeaderFile
#ifdef WIN32 // for correctly compiling "valarray" in modules, which are includes this file
#undef max
#undef min
#endif
#include <valarray>
#include <stdexcept>
//#if defined(_DEBUG_)
# define MED_TCSLICE_CHECK_RANGE
//#endif
namespace MED
{
//---------------------------------------------------------------
//! This class intends to provide an uniform way to handle multy-dimention data (const version)
/*!
It just contains pointer to real sequence and implement proper calcultion of its indexes.
This class deal with constant pointer to the sources data and provide const method to
read the them (data).
*/
template<class TValueType>
class TCSlice
{
const TValueType* myCValuePtr; //!< Reference to source multy-dimension data
size_t mySourceSize; //!< Size of the source multy-dimension data
std::slice mySlice; //!< Defines algorithm of index calculation
protected:
void
check_id(size_t theId) const
{
long int anId = -1;
if(theId < mySlice.size()){
anId = mySlice.start() + theId*mySlice.stride();
if(anId < (long int)mySourceSize)
return;
}
throw std::out_of_range("TCSlice::check_id");
}
//! Calculate internal index to get proper element from the source multy-dimension data
size_t
calculate_id(size_t theId) const
{
return mySlice.start() + theId*mySlice.stride();
}
size_t
get_id(size_t theId) const
{
#ifdef MED_TCSLICE_CHECK_RANGE
check_id(theId);
#endif
return calculate_id(theId);
}
size_t
get_id_at(size_t theId) const
{
check_id(theId);
return calculate_id(theId);
}
public:
typedef TValueType value_type;
//! Construct the class from bare pointer
TCSlice(const value_type* theValuePtr,
size_t theSourceSize,
const std::slice& theSlice):
myCValuePtr(theValuePtr),
mySourceSize(theSourceSize),
mySlice(theSlice)
{}
//! Construct the class from corresponding container
TCSlice(const TVector<value_type>& theContainer,
const std::slice& theSlice):
myCValuePtr(&theContainer[0]),
mySourceSize(theContainer.size()),
mySlice(theSlice)
{}
//! Default constructor (dangerous)
TCSlice():
myCValuePtr(NULL)
{}
//! Get element by its number (const version)
const value_type&
operator[](size_t theId) const
{
return *(myCValuePtr + get_id(theId));
}
const value_type&
at(size_t theId) const
{
return *(myCValuePtr + get_id_at(theId));
}
//! Get range of the order numbers
size_t
size() const
{
return mySlice.size();
}
};
//---------------------------------------------------------------
//! This class extend TCSlice functionality for non-constant case
template<class TValueType>
class TSlice: public TCSlice<TValueType>
{
TValueType* myValuePtr;
public:
typedef TValueType value_type;
typedef TCSlice<TValueType> TSupperClass;
//! Construct the class from bare pointer
TSlice(value_type* theValuePtr,
size_t theSourceSize,
const std::slice& theSlice):
TSupperClass(theValuePtr, theSourceSize, theSlice),
myValuePtr(theValuePtr)
{}
//! Construct the class from corresponding container
TSlice(TVector<value_type>& theContainer,
const std::slice& theSlice):
TSupperClass(theContainer, theSlice),
myValuePtr(&theContainer[0])
{}
//! Default constructor (dangerous)
TSlice():
myValuePtr(NULL)
{}
//! Get element by its number
value_type&
operator[](size_t theId)
{
return *(myValuePtr + this->get_id(theId));
}
value_type&
at(size_t theId)
{
return *(myValuePtr + this->get_id_at(theId));
}
};
}
#undef MED_TCSLICE_CHECK_RANGE
#endif

View File

@ -0,0 +1,865 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : MED_Structure.cxx
// Author : Eugeny NIKOLAEV
//
#include "MED_Structures.hxx"
#include "MED_Utilities.hxx"
#include <cstring>
using namespace MED;
namespace MED
{
TInt
GetNbNodes(EGeometrieElement typmai)
{
return typmai%100;
}
std::string
GetString(TInt theId,
TInt theStep,
const TString& theString)
{
const char* aPos = &theString[theId*theStep];
TInt aSize = std::min(TInt(strlen(aPos)),theStep);
return std::string(aPos,aSize);
}
void
SetString(TInt theId,
TInt theStep,
TString& theString,
const std::string& theValue)
{
TInt aSize = std::min(TInt(theValue.size()+1),theStep);
char* aPos = &theString[theId*theStep];
strncpy(aPos,theValue.c_str(),aSize);
}
void
SetString(TInt theId,
TInt theStep,
TString& theString,
const TString& theValue)
{
TInt aSize = std::min(TInt(theValue.size()+1),theStep);
char* aPos = &theString[theId*theStep];
const char* aValue = &theValue[0];
strncpy(aPos,aValue,aSize);
}
TInt
GetDimGaussCoord(EGeometrieElement theGeom)
{
return theGeom/100;
}
TInt
GetNbRefCoord(EGeometrieElement theGeom)
{
return (theGeom%100);
}
//---------------------------------------------------------------
PFloatTimeStampValue
CastToFloatTimeStampValue(const PTimeStampValueBase& theTimeStampValue)
{
return theTimeStampValue;
}
PIntTimeStampValue
CastToIntTimeStampValue(const PTimeStampValueBase& theTimeStampValue)
{
return theTimeStampValue;
}
}
//---------------------------------------------------------------
TInt
TFamilyInfo
::GetAttrId(TInt theId) const
{
return myAttrId[theId];
}
TInt
TFamilyInfo
::GetAttrVal(TInt theId) const
{
return myAttrVal[theId];
}
void
TFamilyInfo
::SetAttrId(TInt theId,TInt theVal)
{
myAttrId[theId] = theVal;
}
void
TFamilyInfo
::SetAttrVal(TInt theId,TInt theVal)
{
myAttrVal[theId] = theVal;
}
//---------------------------------------------------------------
TInt
TElemInfo
::GetFamNum(TInt theId) const
{
return (*myFamNum)[theId];
}
void
TElemInfo
::SetFamNum(TInt theId, TInt theVal)
{
(*myFamNum)[theId] = theVal;
myIsFamNum = eVRAI;
}
TInt
TElemInfo
::GetElemNum(TInt theId) const
{
return (*myElemNum)[theId];
}
void
TElemInfo
::SetElemNum(TInt theId, TInt theVal)
{
(*myElemNum)[theId] = theVal;
}
//---------------------------------------------------------------
TCCoordSlice
TNodeInfo
::GetCoordSlice(TInt theId) const
{
TInt aDim = myMeshInfo->GetSpaceDim();
if(GetModeSwitch() == eFULL_INTERLACE)
return TCCoordSlice(*myCoord, std::slice(theId*aDim, aDim, 1));
else
return TCCoordSlice(*myCoord, std::slice(theId, aDim, aDim));
}
TCoordSlice
TNodeInfo
::GetCoordSlice(TInt theId)
{
TInt aDim = myMeshInfo->GetSpaceDim();
if(GetModeSwitch() == eFULL_INTERLACE)
return TCoordSlice(*myCoord, std::slice(theId*aDim,aDim,1));
else
return TCoordSlice(*myCoord, std::slice(theId,aDim,aDim));
}
//---------------------------------------------------------------
TCConnSlice
TCellInfo
::GetConnSlice(TInt theElemId) const
{
if(GetModeSwitch() == eFULL_INTERLACE)
return TCConnSlice(*myConn, std::slice(GetConnDim()*theElemId, GetNbNodes(myGeom), 1));
else
return TCConnSlice(*myConn, std::slice(theElemId, GetNbNodes(myGeom), GetConnDim()));
}
TConnSlice
TCellInfo
::GetConnSlice(TInt theElemId)
{
if(GetModeSwitch() == eFULL_INTERLACE)
return TConnSlice(*myConn, std::slice(GetConnDim()*theElemId, GetNbNodes(myGeom), 1));
else
return TConnSlice(*myConn, std::slice(theElemId, GetNbNodes(myGeom), GetConnDim()));
}
//---------------------------------------------------------------
TInt
TPolygoneInfo
::GetNbConn(TInt theElemId) const
{
return (*myIndex)[theElemId + 1] - (*myIndex)[theElemId];
}
TCConnSlice
TPolygoneInfo
::GetConnSlice(TInt theElemId) const
{
return TCConnSlice(*myConn, std::slice((*myIndex)[theElemId] - 1, GetNbConn(theElemId), 1));
}
TConnSlice
TPolygoneInfo
::GetConnSlice(TInt theElemId)
{
return TConnSlice(*myConn, std::slice((*myIndex)[theElemId] - 1, GetNbConn(theElemId), 1));
}
//---------------------------------------------------------------
TInt
TPolyedreInfo
::GetNbFaces(TInt theElemId) const
{
return (*myIndex)[theElemId+1] - (*myIndex)[theElemId];
}
TInt
TPolyedreInfo
::GetNbNodes(TInt theElemId) const
{
TInt aNbNodes = 0;
TInt aNbFaces = GetNbFaces(theElemId);
TInt aStartFaceId = (*myIndex)[theElemId] - 1;
for(TInt aFaceId = 0; aFaceId < aNbFaces; aFaceId++, aStartFaceId++){
TInt aCurrentId = (*myFaces)[aStartFaceId];
TInt aDiff = (*myFaces)[aStartFaceId + 1] - aCurrentId;
aNbNodes += aDiff;
}
return aNbNodes;
}
TCConnSliceArr
TPolyedreInfo
::GetConnSliceArr(TInt theElemId) const
{
TInt aNbFaces = GetNbFaces(theElemId);
TCConnSliceArr aConnSliceArr(aNbFaces);
TInt aStartFaceId = (*myIndex)[theElemId] - 1;
for(TInt aFaceId = 0; aFaceId < aNbFaces; aFaceId++, aStartFaceId++){
TInt aCurrentId = (*myFaces)[aStartFaceId];
TInt aDiff = (*myFaces)[aStartFaceId + 1] - aCurrentId;
aConnSliceArr[aFaceId] =
TCConnSlice(*myConn, std::slice(aCurrentId - 1, aDiff, 1));
}
return aConnSliceArr;
}
TConnSliceArr
TPolyedreInfo
::GetConnSliceArr(TInt theElemId)
{
TInt aNbFaces = GetNbFaces(theElemId);
TConnSliceArr aConnSliceArr(aNbFaces);
TInt aStartFaceId = (*myIndex)[theElemId] - 1;
for(TInt aFaceId = 0; aFaceId < aNbFaces; aFaceId++, aStartFaceId++){
TInt aCurrentId = (*myFaces)[aStartFaceId];
TInt aDiff = (*myFaces)[aStartFaceId + 1] - aCurrentId;
aConnSliceArr[aFaceId] =
TConnSlice(*myConn, std::slice(aCurrentId - 1, aDiff, 1));
}
return aConnSliceArr;
}
//---------------------------------------------------------------
TMeshValueBase
::TMeshValueBase():
myNbElem(0),
myNbComp(0),
myNbGauss(0),
myStep(0)
{}
void
TMeshValueBase
::Allocate(TInt theNbElem,
TInt theNbGauss,
TInt theNbComp,
EModeSwitch theMode)
{
myModeSwitch = theMode;
myNbElem = theNbElem;
myNbGauss = theNbGauss;
myNbComp = theNbComp;
myStep = theNbComp*theNbGauss;
}
size_t
TMeshValueBase
::GetSize() const
{
return myNbElem * myStep;
}
size_t
TMeshValueBase
::GetNbVal() const
{
return myNbElem * myNbGauss;
}
size_t
TMeshValueBase
::GetNbGauss() const
{
return myNbGauss;
}
size_t
TMeshValueBase
::GetStep() const
{
return myStep;
}
//---------------------------------------------------------------
TInt
TProfileInfo
::GetElemNum(TInt theId) const
{
return (*myElemNum)[theId];
}
void
TProfileInfo
::SetElemNum(TInt theId,TInt theVal)
{
(*myElemNum)[theId] = theVal;
}
//---------------------------------------------------------------
bool
TGaussInfo::TLess
::operator()(const TKey& theLeft, const TKey& theRight) const
{
EGeometrieElement aLGeom = boost::get<0>(theLeft);
EGeometrieElement aRGeom = boost::get<0>(theRight);
if(aLGeom != aRGeom)
return aLGeom < aRGeom;
const std::string& aLStr = boost::get<1>(theLeft);
const std::string& aRStr = boost::get<1>(theRight);
return aLStr < aRStr;
}
bool
TGaussInfo::TLess
::operator()(const TGaussInfo& theLeft, const TGaussInfo& theRight) const
{
if(!&theLeft)
return true;
if(!&theRight)
return false;
if(theLeft.myGeom != theRight.myGeom)
return theLeft.myGeom < theRight.myGeom;
if(theLeft.myRefCoord != theRight.myRefCoord)
return theLeft.myRefCoord < theRight.myRefCoord;
return theLeft.myGaussCoord < theRight.myGaussCoord;
}
TCCoordSlice
TGaussInfo
::GetRefCoordSlice(TInt theId) const
{
if(GetModeSwitch() == eFULL_INTERLACE)
return TCCoordSlice(myRefCoord,std::slice(theId*GetDim(),GetDim(),1));
else
return TCCoordSlice(myRefCoord,std::slice(theId,GetDim(),GetDim()));
}
TCoordSlice
TGaussInfo
::GetRefCoordSlice(TInt theId)
{
if(GetModeSwitch() == eFULL_INTERLACE)
return TCoordSlice(myRefCoord,std::slice(theId*GetDim(),GetDim(),1));
else
return TCoordSlice(myRefCoord,std::slice(theId,GetDim(),GetDim()));
}
TCCoordSlice
TGaussInfo
::GetGaussCoordSlice(TInt theId) const
{
if(GetModeSwitch() == eFULL_INTERLACE)
return TCCoordSlice(myGaussCoord,std::slice(theId*GetDim(),GetDim(),1));
else
return TCCoordSlice(myGaussCoord,std::slice(theId,GetDim(),GetDim()));
}
TCoordSlice
TGaussInfo
::GetGaussCoordSlice(TInt theId)
{
if(GetModeSwitch() == eFULL_INTERLACE)
return TCoordSlice(myGaussCoord,std::slice(theId*GetDim(),GetNbGauss(),1));
else
return TCoordSlice(myGaussCoord,std::slice(theId,GetNbGauss(),GetDim()));
}
//---------------------------------------------------------------
TInt
TTimeStampInfo
::GetNbGauss(EGeometrieElement theGeom) const
{
TGeom2NbGauss::const_iterator anIter = myGeom2NbGauss.find(theGeom);
if(anIter == myGeom2NbGauss.end())
return 1;//EXCEPTION(runtime_error,"TTimeStampInfo::GetNbGauss - myGeom2NbGauss.find(theGeom) fails");
return anIter->second;
}
//---------------------------------------------------------------
// TGrilleInfo structure methods
//---------------------------------------------------------------
const EGrilleType&
TGrilleInfo
::GetGrilleType() const
{
return myGrilleType;
}
EGrilleType
TGrilleInfo
::GetGrilleType()
{
return myGrilleType;
}
void
TGrilleInfo
::SetGrilleType(EGrilleType theGrilleType)
{
myGrilleType = theGrilleType;
}
const
TIndexes&
TGrilleInfo
::GetMapOfIndexes() const
{
return myIndixes;
}
TIndexes&
TGrilleInfo
::GetMapOfIndexes()
{
return myIndixes;
}
const
TFloatVector&
TGrilleInfo
::GetIndexes(TInt theAxisNumber) const
{
TIndexes::const_iterator aIter=myIndixes.find(theAxisNumber);
if(aIter==myIndixes.end())
EXCEPTION(std::runtime_error, "const TGrilleInfo::GetIndexes - myIndixes.find(theAxisNumber); fails");
return aIter->second;
}
TFloatVector&
TGrilleInfo
::GetIndexes(TInt theAxisNumber)
{
TIndexes::iterator aIter=myIndixes.find(theAxisNumber);
if(aIter==myIndixes.end())
EXCEPTION(std::runtime_error, "TGrilleInfo::GetIndexes - myIndixes.find(theAxisNumber="<<theAxisNumber<<"); fails");
return aIter->second;
}
TInt
TGrilleInfo
::GetNbIndexes(TInt theAxisNumber)
{
const TFloatVector& aVector=GetIndexes(theAxisNumber);
return aVector.size();
}
TInt
TGrilleInfo
::GetNbNodes()
{
TInt nbNodes=0;
TInt aDim = myMeshInfo->GetDim();
for(int i=0;i<aDim;i++)
if(nbNodes == 0)
nbNodes = this->GetGrilleStructure()[i];
else
nbNodes = nbNodes*this->GetGrilleStructure()[i];
return nbNodes;
}
TInt
TGrilleInfo
::GetNbCells()
{
TInt nbCells=0;
TInt aDim = myMeshInfo->GetDim();
for(int i=0;i<aDim;i++)
if(nbCells == 0)
nbCells = this->GetGrilleStructure()[i]-1;
else
nbCells = nbCells*(this->GetGrilleStructure()[i]-1);
return nbCells;
}
TInt
TGrilleInfo
::GetNbSubCells()
{
TInt nb=0;
TInt aDim = myMeshInfo->GetDim();
switch (aDim) {
case 3:
nb =
(myGrilleStructure[0] ) * (myGrilleStructure[1]-1) * (myGrilleStructure[2]-1) +
(myGrilleStructure[0]-1) * (myGrilleStructure[1] ) * (myGrilleStructure[2]-1) +
(myGrilleStructure[0]-1) * (myGrilleStructure[1]-1) * (myGrilleStructure[2] );
break;
case 2:
nb =
(myGrilleStructure[0] ) * (myGrilleStructure[1]-1) +
(myGrilleStructure[0]-1) * (myGrilleStructure[1] );
break;
}
return nb;
}
EGeometrieElement
TGrilleInfo
::GetGeom()
{
TInt aDim = myMeshInfo->GetDim();
switch(aDim){
case 1:
return eSEG2;
case 2:
return eQUAD4;
case 3:
return eHEXA8;
default:
return eNONE;
}
}
EGeometrieElement
TGrilleInfo
::GetSubGeom()
{
TInt aDim = myMeshInfo->GetDim();
switch(aDim){
case 2:
return eSEG2;
case 3:
return eQUAD4;
}
return eNONE;
}
EEntiteMaillage
TGrilleInfo
::GetEntity()
{
return eMAILLE;
}
EEntiteMaillage
TGrilleInfo
::GetSubEntity()
{
TInt aDim = myMeshInfo->GetDim();
switch(aDim){
case 2:
return eARETE;
case 3:
return eFACE;
}
return EEntiteMaillage(-1);
}
const
TIntVector&
TGrilleInfo
::GetGrilleStructure() const
{
return myGrilleStructure;
}
TIntVector
TGrilleInfo
::GetGrilleStructure()
{
return myGrilleStructure;
}
void
TGrilleInfo
::SetGrilleStructure(TInt theAxis,TInt theNb)
{
if(theAxis >= 0 && theAxis <=2 && theNb >= 0)
myGrilleStructure[theAxis]=theNb;
}
const
TNodeCoord&
TGrilleInfo
::GetNodeCoord() const
{
return myCoord;
}
TNodeCoord&
TGrilleInfo
::GetNodeCoord()
{
return myCoord;
}
TNodeCoord
TGrilleInfo
::GetCoord(TInt theId)
{
TNodeCoord aCoord;
TInt aDim = myMeshInfo->GetDim();
TInt aNbNodes = this->GetNbNodes();
aCoord.resize(aDim);
if(theId >= aNbNodes)
EXCEPTION(std::runtime_error, "TGrilleInfo::GetCoord - theId out of range");
if(myGrilleType == eGRILLE_STANDARD){
switch(aDim){
case 3:
aCoord[2] = myCoord[aDim*theId+2];
case 2:
aCoord[1] = myCoord[aDim*theId+1];
case 1:{
aCoord[0] = myCoord[aDim*theId];
break;
}
}
} else {
TFloatVector aVecX = this->GetIndexes(0);
TInt nbIndxX = this->GetNbIndexes(0);
switch(aDim){
case 1:{
aCoord[0] = aVecX[theId];
break;
}
case 2:{
TFloatVector aVecY = this->GetIndexes(1);
TInt i,j,k;
i = j = k = 0;
i = theId % nbIndxX;
j = theId / nbIndxX;
if(myGrilleType == eGRILLE_CARTESIENNE){
aCoord[0] = aVecX[i];
aCoord[1] = aVecY[j];
} else { // eGRILLE_POLAIRE (cylindrical)
aCoord[0] = aVecX[i] * cos(aVecY[j]);
aCoord[1] = aVecX[i] * sin(aVecY[j]);
}
break;
}
case 3:{
TFloatVector aVecY = this->GetIndexes(1);
TInt nbIndxY = this->GetNbIndexes(1);
TFloatVector aVecZ = this->GetIndexes(2);
TInt i,j,k;
i = j = k = 0;
i = theId % nbIndxX;
j = (theId / nbIndxX) % nbIndxY;
k = theId / (nbIndxX*nbIndxY);
if(myGrilleType == eGRILLE_CARTESIENNE){
aCoord[0] = aVecX[i];
aCoord[1] = aVecY[j];
aCoord[2] = aVecZ[k];
} else { // eGRILLE_POLAIRE (cylindrical)
aCoord[0] = aVecX[i] * cos(aVecY[j]);
aCoord[1] = aVecX[i] * sin(aVecY[j]);
aCoord[2] = aVecZ[k];
}
break;
}
}
}
return aCoord;
}
TIntVector
TGrilleInfo
::GetConn(TInt theId, const bool isSub)
{
TIntVector anIndexes;
TInt aDim = myMeshInfo->GetDim();
TInt idx;
TInt iMin, jMin, kMin, iMax, jMax, kMax;
TInt loc[3];
loc[0] = loc[1] = loc[2] = 0;
iMin = iMax = jMin = jMax = kMin = kMax = 0;
switch(aDim) {
case 3:
{
TInt nbX = this->GetGrilleStructure()[0];
TInt nbY = this->GetGrilleStructure()[1];
TInt nbZ = this->GetGrilleStructure()[2];
TInt d01 = nbX*nbY, dX = 1, dY = 1, dZ = 1;
if ( isSub )
{
if ( theId < nbX * (nbY-1) * (nbZ-1))
{ // face is normal to X axis
dX = 0;
}
else if ( theId < nbX * (nbY-1) * (nbZ-1) + (nbX-1) * nbY * (nbZ-1))
{ // face is normal to Y axis
theId -= nbX * (nbY-1) * (nbZ-1);
dY = 0;
}
else
{
theId -= nbX * (nbY-1) * (nbZ-1) + (nbX-1) * nbY * (nbZ-1);
dZ = 0;
}
}
//else
{
iMin = theId % (nbX - dX);
jMin = (theId / (nbX - dX)) % (nbY - dY);
kMin = theId / ((nbX - dX) * (nbY - dY));
iMax = iMin+dX;
jMax = jMin+dY;
kMax = kMin+dZ;
}
for (loc[2]=kMin; loc[2]<=kMax; loc[2]++)
for (loc[1]=jMin; loc[1]<=jMax; loc[1]++)
for (loc[0]=iMin; loc[0]<=iMax; loc[0]++)
{
idx = loc[0] + loc[1]*nbX + loc[2]*d01;
anIndexes.push_back(idx);
}
break;
}
case 2:
{
TInt nbX = this->GetGrilleStructure()[0];
TInt nbY = this->GetGrilleStructure()[1];
TInt dX = 1, dY = 1;
if ( isSub )
{
if ( theId < nbX * (nbY-1))
{ // edge is normal to X axis
dX = 0;
}
else
{
theId -= nbX * (nbY-1);
dY = 0;
}
}
iMin = theId % (nbX-dX);
jMin = theId / (nbX-dX);
iMax = iMin+dX;
jMax = jMin+dY;
for (loc[1]=jMin; loc[1]<=jMax; loc[1]++)
for (loc[0]=iMin; loc[0]<=iMax; loc[0]++)
{
idx = loc[0] + loc[1]*nbX;
anIndexes.push_back(idx);
}
break;
}
case 1:
{
iMin = theId;
for (loc[0]=iMin; loc[0]<=iMin+1; loc[0]++)
{
idx = loc[0];
anIndexes.push_back(idx);
}
break;
}
}
return anIndexes;
}
TInt
TGrilleInfo
::GetFamNumNode(TInt theId) const
{
return myFamNumNode[theId];
}
void
TGrilleInfo
::SetFamNumNode(TInt theId,TInt theVal)
{
myFamNumNode[theId] = theVal;
}
TInt
TGrilleInfo
::GetFamNum(TInt theId) const
{
return myFamNum[theId];
}
void
TGrilleInfo
::SetFamNum(TInt theId,TInt theVal)
{
myFamNum[theId] = theVal;
}
TInt
TGrilleInfo
::GetFamSubNum(TInt theId) const
{
return myFamSubNum[theId];
}
void
TGrilleInfo
::SetFamSubNum(TInt theId,TInt theVal)
{
myFamSubNum[theId] = theVal;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,578 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MED_TWrapper_HeaderFile
#define MED_TWrapper_HeaderFile
#include "MED_TStructures.hxx"
#include "MED_Wrapper.hxx"
namespace MED
{
template<EVersion eVersion>
class TTWrapper: public TWrapper
{
public:
//----------------------------------------------------------------------------
//! Gets version of the MED library used for the MED file
virtual
EVersion
GetVersion()
{
return eVersion;
}
//----------------------------------------------------------------------------
virtual
PMeshInfo
CrMeshInfo(TInt theDim = 0, TInt theSpaceDim = 0,
const std::string& theValue = "",
EMaillage theType = eNON_STRUCTURE,
const std::string& theDesc = "")
{
return PMeshInfo(new TTMeshInfo<eVersion>
(theDim,
theSpaceDim,
theValue,
theType,
theDesc));
}
virtual
PMeshInfo
CrMeshInfo(const PMeshInfo& theInfo)
{
return PMeshInfo(new TTMeshInfo<eVersion>(theInfo));
}
//----------------------------------------------------------------------------
virtual
PFamilyInfo
CrFamilyInfo(const PMeshInfo& theMeshInfo,
TInt theNbGroup = 0,
TInt theNbAttr = 0,
TInt theId = 0,
const std::string& theValue = "")
{
return PFamilyInfo(new TTFamilyInfo<eVersion>
(theMeshInfo,
theNbGroup,
theNbAttr,
theId,
theValue));
}
virtual
PFamilyInfo
CrFamilyInfo(const PMeshInfo& theMeshInfo,
const std::string& theValue,
TInt theId,
const MED::TStringSet& theGroupNames,
const MED::TStringVector& theAttrDescs = MED::TStringVector(),
const MED::TIntVector& theAttrIds = MED::TIntVector(),
const MED::TIntVector& theAttrVals = MED::TIntVector())
{
return PFamilyInfo(new TTFamilyInfo<eVersion>
(theMeshInfo,
theValue,
theId,
theGroupNames,
theAttrDescs,
theAttrIds,
theAttrVals));
}
virtual
PFamilyInfo
CrFamilyInfo(const PMeshInfo& theMeshInfo,
const PFamilyInfo& theInfo)
{
return PFamilyInfo(new TTFamilyInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PElemInfo
CrElemInfo(const PMeshInfo& theMeshInfo,
TInt theNbElem,
EBooleen theIsElemNum = eVRAI,
EBooleen theIsElemNames = eVRAI)
{
return PElemInfo(new TTElemInfo<eVersion>
(theMeshInfo,
theNbElem,
theIsElemNum,
theIsElemNames));
}
virtual
PElemInfo
CrElemInfo(const PMeshInfo& theMeshInfo,
TInt theNbElem,
const TIntVector& theFamNum,
const TIntVector& aElemNum,
const TStringVector& aElemNames)
{
return PElemInfo(new TTElemInfo<eVersion>
(theMeshInfo,
theNbElem,
theFamNum,
aElemNum,
aElemNames));
}
//----------------------------------------------------------------------------
virtual
PNodeInfo
CrNodeInfo(const PMeshInfo& theMeshInfo,
TInt theNbElem,
EModeSwitch theMode = eFULL_INTERLACE,
ERepere theSystem = eCART,
EBooleen theIsElemNum = eVRAI,
EBooleen theIsElemNames = eVRAI)
{
return PNodeInfo(new TTNodeInfo<eVersion>
(theMeshInfo,
theNbElem,
theMode,
theSystem,
theIsElemNum,
theIsElemNames));
}
virtual
PNodeInfo
CrNodeInfo(const PMeshInfo& theMeshInfo,
const TFloatVector& theNodeCoords,
EModeSwitch theMode = eFULL_INTERLACE,
ERepere theSystem = eCART,
const TStringVector& theCoordNames = TStringVector(),
const TStringVector& theCoordUnits = TStringVector(),
const TIntVector& theFamilyNums = TIntVector(),
const TIntVector& theElemNums = TIntVector(),
const TStringVector& theElemNames = TStringVector())
{
return PNodeInfo(new TTNodeInfo<eVersion>
(theMeshInfo,
theNodeCoords,
theMode,
theSystem,
theCoordNames,
theCoordUnits,
theFamilyNums,
theElemNums,
theElemNames));
}
virtual
PNodeInfo
CrNodeInfo(const PMeshInfo& theMeshInfo,
const PNodeInfo& theInfo)
{
return PNodeInfo(new TTNodeInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PPolygoneInfo
CrPolygoneInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TInt theNbElem,
TInt theConnSize,
EConnectivite theConnMode = eNOD,
EBooleen theIsElemNum = eVRAI,
EBooleen theIsElemNames = eVRAI)
{
return PPolygoneInfo(new TTPolygoneInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theNbElem,
theConnSize,
theConnMode,
theIsElemNum,
theIsElemNames));
}
virtual
PPolygoneInfo
CrPolygoneInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
const TIntVector& theIndexes,
const TIntVector& theConnectivities,
EConnectivite theConnMode = eNOD,
const TIntVector& theFamilyNums = TIntVector(),
const TIntVector& theElemNums = TIntVector(),
const TStringVector& theElemNames = TStringVector())
{
return PPolygoneInfo(new TTPolygoneInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theIndexes,
theConnectivities,
theConnMode,
theFamilyNums,
theElemNums,
theElemNames));
}
virtual
PPolygoneInfo
CrPolygoneInfo(const PMeshInfo& theMeshInfo,
const PPolygoneInfo& theInfo)
{
return PPolygoneInfo(new TTPolygoneInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PPolyedreInfo
CrPolyedreInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TInt theNbElem,
TInt theNbFaces,
TInt theConnSize,
EConnectivite theConnMode = eNOD,
EBooleen theIsElemNum = eVRAI,
EBooleen theIsElemNames = eVRAI)
{
return PPolyedreInfo(new TTPolyedreInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theNbElem,
theNbFaces,
theConnSize,
theConnMode,
theIsElemNum,
theIsElemNames));
}
virtual
PPolyedreInfo
CrPolyedreInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
const TIntVector& theIndexes,
const TIntVector& theFaces,
const TIntVector& theConnectivities,
EConnectivite theConnMode = eNOD,
const TIntVector& theFamilyNums = TIntVector(),
const TIntVector& theElemNums = TIntVector(),
const TStringVector& theElemNames = TStringVector())
{
return PPolyedreInfo(new TTPolyedreInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theIndexes,
theFaces,
theConnectivities,
theConnMode,
theFamilyNums,
theElemNums,
theElemNames));
}
virtual
PPolyedreInfo
CrPolyedreInfo(const PMeshInfo& theMeshInfo,
const PPolyedreInfo& theInfo)
{
return PPolyedreInfo(new TTPolyedreInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PCellInfo
CrCellInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TInt theNbElem,
EConnectivite theConnMode = eNOD,
EBooleen theIsElemNum = eVRAI,
EBooleen theIsElemNames = eVRAI,
EModeSwitch theMode = eFULL_INTERLACE)
{
return PCellInfo(new TTCellInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theNbElem,
theConnMode,
theIsElemNum,
theIsElemNames,
theMode));
}
virtual
PCellInfo
CrCellInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
const TIntVector& theConnectivities,
EConnectivite theConnMode = eNOD,
const TIntVector& theFamilyNums = TIntVector(),
const TIntVector& theElemNums = TIntVector(),
const TStringVector& theElemNames = TStringVector(),
EModeSwitch theMode = eFULL_INTERLACE)
{
return PCellInfo(new TTCellInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theConnectivities,
theConnMode,
theFamilyNums,
theElemNums,
theElemNames,
theMode));
}
virtual
PCellInfo
CrCellInfo(const PMeshInfo& theMeshInfo,
const PCellInfo& theInfo)
{
return PCellInfo(new TTCellInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
//! Creates a MEDWrapper MED Balls representation
virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo,
TInt theNbBalls,
EBooleen theIsElemNum = eVRAI)
{
return PBallInfo( new TTBallInfo<eVersion>( theMeshInfo, theNbBalls, theIsElemNum ));
}
//! Creates a MEDWrapper MED Balls representation
virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo,
const TIntVector& theNodes,
TFloatVector& theDiameters,
const TIntVector& theFamilyNums = TIntVector(),
const TIntVector& theElemNums = TIntVector())
{
return PBallInfo( new TTBallInfo<eVersion>( theMeshInfo, theNodes, theDiameters,
theFamilyNums, theElemNums));
}
//! A copy-constructor for the MEDWrapper MED Balls representation
virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo,
const PBallInfo& theInfo)
{
return PBallInfo( new TTBallInfo<eVersion>( theMeshInfo, theInfo ));
}
//----------------------------------------------------------------------------
virtual
PFieldInfo
CrFieldInfo(const PMeshInfo& theMeshInfo,
TInt theNbComp = 0,
ETypeChamp theType = eFLOAT64,
const std::string& theValue = "",
EBooleen theIsLocal = eVRAI,
TInt theNbRef = 1)
{
return PFieldInfo(new TTFieldInfo<eVersion>
(theMeshInfo,
theNbComp,
theType,
theValue,
theIsLocal,
theNbRef));
}
virtual
PFieldInfo
CrFieldInfo(const PMeshInfo& theMeshInfo,
const PFieldInfo& theInfo)
{
return PFieldInfo(new TTFieldInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PTimeStampInfo
CrTimeStampInfo(const PFieldInfo& theFieldInfo,
EEntiteMaillage theEntity,
const TGeom2Size& theGeom2Size,
const TGeom2NbGauss& theGeom2NbGauss = TGeom2NbGauss(),
TInt theNumDt = 0,
TInt theNumOrd = 0,
TFloat theDt = 0,
const std::string& theUnitDt = "",
const TGeom2Gauss& theGeom2Gauss = TGeom2Gauss())
{
return PTimeStampInfo(new TTTimeStampInfo<eVersion>
(theFieldInfo,
theEntity,
theGeom2Size,
theGeom2NbGauss,
theNumDt,
theNumOrd,
theDt,
theUnitDt,
theGeom2Gauss));
}
virtual
PTimeStampInfo
CrTimeStampInfo(const PFieldInfo& theFieldInfo,
const PTimeStampInfo& theInfo)
{
return PTimeStampInfo(new TTTimeStampInfo<eVersion>
(theFieldInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PGaussInfo
CrGaussInfo(const TGaussInfo::TInfo& theInfo,
EModeSwitch theMode = eFULL_INTERLACE)
{
return PGaussInfo(new TTGaussInfo<eVersion>
(theInfo,
theMode));
}
//----------------------------------------------------------------------------
virtual
PProfileInfo
CrProfileInfo(const TProfileInfo::TInfo& theInfo,
EModeProfil theMode = eCOMPACT)
{
return PProfileInfo(new TTProfileInfo<eVersion>
(theInfo,
theMode));
}
//----------------------------------------------------------------------------
virtual
PTimeStampValueBase
CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
ETypeChamp theTypeChamp,
const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
EModeSwitch theMode = eFULL_INTERLACE)
{
if(theTypeChamp == eFLOAT64)
return PTimeStampValueBase(new TTTimeStampValue<eVersion, TFloatMeshValue>
(theTimeStampInfo,
theTypeChamp,
theGeom2Profile,
theMode));
return PTimeStampValueBase(new TTTimeStampValue<eVersion, TIntMeshValue>
(theTimeStampInfo,
theTypeChamp,
theGeom2Profile,
theMode));
}
virtual
PTimeStampValueBase
CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
const PTimeStampValueBase& theInfo,
ETypeChamp theTypeChamp)
{
if(theTypeChamp == eFLOAT64)
return PTimeStampValueBase(new TTTimeStampValue<eVersion, TFloatMeshValue>
(theTimeStampInfo,
theInfo,
theTypeChamp));
return PTimeStampValueBase(new TTTimeStampValue<eVersion, TIntMeshValue>
(theTimeStampInfo,
theInfo,
theTypeChamp));
}
//----------------------------------------------------------------------------
virtual
PGrilleInfo
CrGrilleInfo(const PMeshInfo& theMeshInfo,
const PGrilleInfo& theInfo)
{
return PGrilleInfo(new TTGrilleInfo<eVersion>
(theMeshInfo,
theInfo));
}
virtual
PGrilleInfo
CrGrilleInfo(const PMeshInfo& theMeshInfo,
const EGrilleType& type)
{
return PGrilleInfo(new TTGrilleInfo<eVersion>
(theMeshInfo,
type));
}
virtual
PGrilleInfo
CrGrilleInfo(const PMeshInfo& theMeshInfo,
const EGrilleType& type,
const TInt& nbNodes)
{
return PGrilleInfo(new TTGrilleInfo<eVersion>
(theMeshInfo,
type,
nbNodes));
}
virtual
PGrilleInfo
CrGrilleInfo(const PMeshInfo& theMeshInfo,
const EGrilleType& type,
const MED::TIntVector& nbNodeVec)
{
return PGrilleInfo(new TTGrilleInfo<eVersion>
(theMeshInfo,
type,
nbNodeVec));
}
//----------------------------------------------------------------------------
};
}
#endif

View File

@ -0,0 +1,113 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#include "MED_Utilities.hxx"
#include "MED_Common.hxx"
using namespace std;
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
// static int MYDEBUG = 0;
#endif
int MED::PrefixPrinter::myCounter = 0;
MED::PrefixPrinter::PrefixPrinter(bool theIsActive):
myIsActive(theIsActive)
{
if(myIsActive)
myCounter++;
MSG(MYDEBUG,"MED::PrefixPrinter::PrefixPrinter(...)- "<<myCounter);
}
MED::PrefixPrinter::~PrefixPrinter()
{
if(myIsActive){
myCounter--;
if(myCounter < 0)
EXCEPTION(runtime_error,"PrefixPrinter::~PrefixPrinter() - myCounter("<<myCounter<<") < 0");
}
}
string MED::PrefixPrinter::GetPrefix()
{
if(myCounter){
if(myCounter < 0)
EXCEPTION(runtime_error,"PrefixPrinter::~PrefixPrinter() - myCounter("<<myCounter<<") < 0");
return string(myCounter*2,' ');
}
return "";
}
static MED::TEntity2GeomSet Entity2GeomSet;
bool InitEntity2GeomSet()
{
using namespace MED;
TGeomSet& aGeomARETESet = Entity2GeomSet[eARETE];
aGeomARETESet.insert(eSEG2);
aGeomARETESet.insert(eSEG3);
TGeomSet& aGeomFACESet = Entity2GeomSet[eFACE];
aGeomFACESet.insert(eTRIA3);
aGeomFACESet.insert(eQUAD4);
aGeomFACESet.insert(eTRIA6);
aGeomFACESet.insert(eTRIA7);
aGeomFACESet.insert(eQUAD8);
aGeomFACESet.insert(eQUAD9);
aGeomFACESet.insert(ePOLYGONE);
TGeomSet& aGeomMAILLESet = Entity2GeomSet[eMAILLE];
aGeomMAILLESet.insert(ePOINT1);
aGeomMAILLESet.insert(aGeomARETESet.begin(),aGeomARETESet.end());
aGeomMAILLESet.insert(aGeomFACESet.begin(),aGeomFACESet.end());
aGeomMAILLESet.insert(eTETRA4);
aGeomMAILLESet.insert(ePYRA5);
aGeomMAILLESet.insert(ePENTA6);
aGeomMAILLESet.insert(eHEXA8);
aGeomMAILLESet.insert(eOCTA12);
aGeomMAILLESet.insert(eTETRA10);
aGeomMAILLESet.insert(ePYRA13);
aGeomMAILLESet.insert(ePENTA15);
aGeomMAILLESet.insert(eHEXA20);
aGeomMAILLESet.insert(eHEXA27);
aGeomMAILLESet.insert(ePOLYEDRE);
/* This combination allows reading nb of models of structure elements */
Entity2GeomSet[eSTRUCT_ELEMENT].insert(eAllGeoType);
return true;
}
static bool anIsInited = InitEntity2GeomSet();
const MED::TEntity2GeomSet& MED::GetEntity2GeomSet()
{
return Entity2GeomSet;
}

View File

@ -0,0 +1,74 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#ifndef MED_Utilities_HeaderFile
#define MED_Utilities_HeaderFile
#include "MED_WrapperBase.hxx"
#include <iostream>
#include <sstream>
#include <string>
#include <string.h>
#include <stdexcept>
namespace MED
{
class MEDWRAPPER_EXPORT PrefixPrinter
{
static int myCounter;
bool myIsActive;
public:
PrefixPrinter(bool theIsActive = true);
~PrefixPrinter();
static std::string GetPrefix();
};
}
#ifdef _DEBUG_
#define MSG(deb,msg) if(deb) std::cout<<MED::PrefixPrinter::GetPrefix()<<msg<<" ("<<__FILE__<<" ["<<__LINE__<<"])\n"
#define BEGMSG(deb,msg) if(deb) std::cout<<MED::PrefixPrinter::GetPrefix()<<msg
#define INITMSGA(deb,lev,msg) MED::PrefixPrinter aPrefixPrinter_##lev(deb); BEGMSG(deb,msg)
#define INITMSG(deb,msg) INITMSGA(deb,,msg)
#define ADDMSG(deb,msg) if(deb) std::cout<<msg
#else
#define MSG(deb,msg)
#define BEGMSG(deb,msg)
#define INITMSGA(deb,lev,msg)
#define INITMSG(deb,msg)
#define ADDMSG(deb,msg)
#endif
#ifndef EXCEPTION
#define EXCEPTION(TYPE, MSG) {\
std::ostringstream aStream;\
aStream<<__FILE__<<"["<<__LINE__<<"]::"<<MSG;\
throw TYPE(aStream.str().c_str());\
}
#endif
#endif

View File

@ -0,0 +1,153 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#ifndef MED_Vector_HeaderFile
#define MED_Vector_HeaderFile
#include <vector>
#include <stdexcept>
//#if defined(_DEBUG_)
# define MED_TVECTOR_CHECK_RANGE
//#endif
namespace MED
{
//! Main purpose to introduce the class was to customize operator []
template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
class TVector : public std::vector<_Tp, _Alloc>
{
public:
typedef size_t size_type;
typedef std::vector<_Tp, _Alloc> superclass;
typedef typename superclass::allocator_type allocator_type;
typedef _Tp value_type;
typedef value_type& reference;
typedef const value_type& const_reference;
protected:
void
check_range(size_type __n) const
{
if (__n >= this->size())
throw std::out_of_range("TVector [] access out of range");
}
const_reference
get_value(size_type __n) const
{
return superclass::operator[](__n);
}
reference
get_value(size_type __n)
{
return superclass::operator[](__n);
}
public:
explicit
TVector(const allocator_type& __a = allocator_type()):
superclass(__a)
{}
TVector(size_type __n, const value_type& __val,
const allocator_type& __a = allocator_type()):
superclass(__n, __val, __a)
{}
explicit
TVector(size_type __n):
superclass(__n)
{}
TVector(const TVector& __x):
superclass(__x)
{}
template<typename _InputIterator>
TVector(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type()):
superclass(__first, __last, __a)
{}
template<typename _Yp, typename _Al>
TVector(TVector<_Yp, _Al> __y):
superclass(__y.begin(), __y.end())
{}
TVector&
operator=(const TVector& __x)
{
superclass::operator=(__x);
return *this;
}
template<typename _Yp, typename _Al>
TVector&
operator=(TVector<_Yp, _Al> __y)
{
this->assign(__y.begin(), __y.end());
return *this;
}
reference
operator[](size_type __n)
{
#if defined(MED_TVECTOR_CHECK_RANGE)
check_range(__n);
#endif
return get_value(__n);
}
const_reference
operator[](size_type __n) const
{
#if defined(MED_TVECTOR_CHECK_RANGE)
check_range(__n);
#endif
return get_value(__n);
}
reference
at(size_type __n)
{
check_range(__n);
return get_value(__n);
}
const_reference
at(size_type __n) const
{
check_range(__n);
return get_value(__n);
}
};
}
#undef MED_TVECTOR_CHECK_RANGE
#endif

View File

@ -0,0 +1,707 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : MED_Wrapper.cxx
// Author : Alexey PETROV
//
#include "MED_Wrapper.hxx"
#include "MED_Utilities.hxx"
#include <boost/version.hpp>
#ifdef _DEBUG_
static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0;
#else
// static int MYDEBUG = 0;
// static int MYVALUEDEBUG = 0;
#endif
namespace MED
{
TLockProxy
::TLockProxy(TWrapper* theWrapper):
myWrapper(theWrapper)
{
#if BOOST_VERSION >= 103500
myWrapper->myMutex.lock();
#else
boost::detail::thread::lock_ops<TWrapper::TMutex>::lock(myWrapper->myMutex);
#endif
INITMSG(MYDEBUG,"TLockProxy() - this -"<<this<<"; myWrapper = "<<myWrapper<<std::endl);
}
TLockProxy
::~TLockProxy()
{
INITMSG(MYDEBUG,"~TLockProxy() - this -"<<this<<"; myWrapper = "<<myWrapper<<std::endl);
#if BOOST_VERSION >= 103500
myWrapper->myMutex.unlock();
#else
boost::detail::thread::lock_ops<TWrapper::TMutex>::unlock(myWrapper->myMutex);
#endif
}
TWrapper*
TLockProxy
::operator-> () const // never throws
{
return myWrapper;
}
//----------------------------------------------------------------------------
TWrapper::~TWrapper()
{
}
//----------------------------------------------------------------------------
PMeshInfo
TWrapper
::GetPMeshInfo(TInt theId,
TErr* theErr)
{
PMeshInfo anInfo = CrMeshInfo();
GetMeshInfo(theId,*anInfo,theErr);
return anInfo;
}
//----------------------------------------------------------------------------
PFamilyInfo
TWrapper
::GetPFamilyInfo(const PMeshInfo& theMeshInfo,
TInt theId,
TErr* theErr)
{
// must be reimplemented in connection with mesh type eSTRUCTURE
// if(theMeshInfo->GetType() != eNON_STRUCTURE)
// return PFamilyInfo();
TInt aNbAttr = GetNbFamAttr(theId,*theMeshInfo);
TInt aNbGroup = GetNbFamGroup(theId,*theMeshInfo);
PFamilyInfo anInfo = CrFamilyInfo(theMeshInfo,aNbGroup,aNbAttr);
GetFamilyInfo(theId,*anInfo,theErr);
#ifdef _DEBUG_
std::string aName = anInfo->GetName();
INITMSG(MYDEBUG,"GetPFamilyInfo - aFamilyName = '"<<aName<<
"'; andId = "<<anInfo->GetId()<<
"; aNbAttr = "<<aNbAttr<<
"; aNbGroup = "<<aNbGroup<<"\n");
for(TInt iGroup = 0; iGroup < aNbGroup; iGroup++){
aName = anInfo->GetGroupName(iGroup);
INITMSG(MYDEBUG,"aGroupName = '"<<aName<<"'\n");
}
#endif
return anInfo;
}
//----------------------------------------------------------------------------
PNodeInfo
TWrapper
::GetPNodeInfo(const PMeshInfo& theMeshInfo,
TErr* theErr)
{
TInt aNbElems = GetNbNodes(*theMeshInfo);
if(aNbElems == 0){
return PNodeInfo();
}
PNodeInfo anInfo = CrNodeInfo(theMeshInfo,aNbElems);
GetNodeInfo(*anInfo,theErr);
#ifdef _DEBUG_
TInt aDim = theMeshInfo->myDim;
TInt aNbElem = anInfo->GetNbElem();
INITMSG(MYDEBUG,"GetPNodeInfo: ");
{
INITMSG(MYDEBUG,"aCoords: "<<aNbElem<<": ");
TNodeCoord& aCoord = anInfo->myCoord;
for(TInt iElem = 0; iElem < aNbElem; iElem++){
for(TInt iDim = 0, anId = iElem*aDim; iDim < aDim; iDim++, anId++){
ADDMSG(MYVALUEDEBUG,aCoord[anId]<<",");
}
ADDMSG(MYVALUEDEBUG," ");
}
ADDMSG(MYDEBUG, std::endl);
BEGMSG(MYVALUEDEBUG, "GetFamNum: ");
for(TInt iElem = 0; iElem < aNbElem; iElem++){
ADDMSG(MYVALUEDEBUG,anInfo->GetFamNum(iElem)<<", ");
}
ADDMSG(MYVALUEDEBUG, std::endl);
if(anInfo->IsElemNum()){
BEGMSG(MYVALUEDEBUG,"GetElemNum: ");
for(TInt iElem = 0; iElem < aNbElem; iElem++){
ADDMSG(MYVALUEDEBUG,anInfo->GetElemNum(iElem)<<", ");
}
ADDMSG(MYVALUEDEBUG, std::endl);
}
}
ADDMSG(MYDEBUG, std::endl);
#endif
return anInfo;
}
//----------------------------------------------------------------------------
PPolygoneInfo
TWrapper
::GetPPolygoneInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
EConnectivite theConnMode)
{
if(theMeshInfo->GetType() != eNON_STRUCTURE)
return PPolygoneInfo();
TInt aNbElem = GetNbPolygones(theMeshInfo,theEntity,theGeom,theConnMode);
TInt aConnSize = GetPolygoneConnSize(theMeshInfo,theEntity,theGeom,theConnMode);
PPolygoneInfo anInfo = CrPolygoneInfo(theMeshInfo,theEntity,theGeom,aNbElem,aConnSize,theConnMode);
GetPolygoneInfo(anInfo);
#ifdef _DEBUG_
INITMSG(MYDEBUG,"GetPPolygoneInfo"<<
" - theGeom = "<<theGeom<<
"; aNbElem = "<<aNbElem<<": ");
for(TInt iElem = 1; iElem < aNbElem; iElem++){
TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
TInt aConnDim = aConnSlice.size();
for(TInt iConn = 0; iConn < aConnDim; iConn++){
ADDMSG(MYVALUEDEBUG,aConnSlice[iConn]<<",");
}
ADDMSG(MYDEBUG," ");
}
ADDMSG(MYDEBUG, std::endl);
#endif
return anInfo;
}
//----------------------------------------------------------------------------
PPolyedreInfo
TWrapper
::GetPPolyedreInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
EConnectivite theConnMode)
{
if(theMeshInfo->GetType() != eNON_STRUCTURE)
return PPolyedreInfo();
TInt aNbElem = GetNbPolyedres(theMeshInfo,theEntity,theGeom,theConnMode);
TInt aNbFaces, aConnSize;
GetPolyedreConnSize(theMeshInfo,aNbFaces,aConnSize,theConnMode);
PPolyedreInfo anInfo = CrPolyedreInfo(theMeshInfo,theEntity,theGeom,aNbElem,aNbFaces,aConnSize,theConnMode);
GetPolyedreInfo(anInfo);
#ifdef _DEBUG_
INITMSG(MYDEBUG,"GetPPolyedreInfo"<<
" - theGeom = "<<theGeom<<
"; aNbElem = "<<aNbElem<<": ");
for(TInt iElem = 0; iElem < aNbElem; iElem++){
TCConnSliceArr aConnSliceArr = anInfo->GetConnSliceArr(iElem);
TInt aNbFaces = aConnSliceArr.size();
ADDMSG(MYDEBUG,"{");
for(TInt iFace = 0; iFace < aNbFaces; iFace++){
TCConnSlice aConnSlice = aConnSliceArr[iFace];
TInt aNbConn = aConnSlice.size();
ADDMSG(MYDEBUG,"[");
for(TInt iConn = 0; iConn < aNbConn; iConn++){
ADDMSG(MYVALUEDEBUG,aConnSlice[iConn]<<",");
}
ADDMSG(MYDEBUG,"] ");
}
ADDMSG(MYDEBUG,"} ");
}
ADDMSG(MYDEBUG, std::endl);
#endif
return anInfo;
}
//----------------------------------------------------------------------------
PElemInfo
TWrapper
::GetPElemInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
EConnectivite theConnMode,
TErr* theErr)
{
EMaillage aType = theMeshInfo->GetType();
if(aType == eNON_STRUCTURE){
switch(theGeom){
case ePOINT1:
if(theEntity == eNOEUD)
return GetPNodeInfo(theMeshInfo,theErr);
return GetPCellInfo(theMeshInfo,theEntity,theGeom,theConnMode,theErr);
break;
case ePOLYGONE:
return GetPPolygoneInfo(theMeshInfo,theEntity,theGeom,theConnMode);
break;
case ePOLYEDRE:
return GetPPolyedreInfo(theMeshInfo,theEntity,theGeom,theConnMode);
break;
default:
return GetPCellInfo(theMeshInfo,theEntity,theGeom,theConnMode,theErr);
}
} else {
PGrilleInfo aGrille = GetPGrilleInfo(theMeshInfo);
TInt nbElems;
EBooleen theIsElemNum = eFAUX;
// nodes
switch(theGeom){
case ePOINT1:
nbElems = aGrille->GetNbNodes();
theIsElemNum = eVRAI;
break;
case eSEG2:
case eQUAD4:
case eHEXA8:
nbElems = aGrille->GetNbCells();
break;
default:
nbElems = 0;
}
TIntVector aFamNum;
TIntVector aElemNum;
TStringVector aElemNames;
PElemInfo aElemInfo;
if(theGeom == ePOINT1){
aElemInfo = CrElemInfo(theMeshInfo,
nbElems,
theIsElemNum);
MED::TElemInfo &aTElemInfo = *aElemInfo;
// must be reimplemente in connection with mesh type eSTRUCTURE
// GetNumeration(aTElemInfo,
// nbElems,
// theEntity,
// theGeom,
// theErr);
GetFamilies(aTElemInfo,
nbElems,
theEntity,
theGeom,
theErr);
// must be reimplemente in connection with mesh type eSTRUCTURE
// GetNames(aTElemInfo,
// nbElems,
// theEntity,
// theGeom,
// theErr);
} else {
aElemInfo = CrElemInfo(theMeshInfo,
nbElems,
aFamNum,
aElemNum,
aElemNames);
}
return aElemInfo;
}
return PElemInfo();
}
//----------------------------------------------------------------------------
PCellInfo
TWrapper
::GetPCellInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
EConnectivite theConnMode,
TErr* theErr)
{
if(theMeshInfo->GetType() != eNON_STRUCTURE)
return PCellInfo();
TInt aNbElem = GetNbCells(theMeshInfo,theEntity,theGeom,theConnMode);
PCellInfo anInfo = CrCellInfo(theMeshInfo,theEntity,theGeom,aNbElem,theConnMode);
GetCellInfo(anInfo,theErr);
#ifdef _DEBUG_
TInt aConnDim = anInfo->GetConnDim();
INITMSG(MYDEBUG,"GetPCellInfo - theEntity = "<<theEntity<<"; theGeom = "<<theGeom<<"; aConnDim: "<<aConnDim<<"\n");
BEGMSG(MYDEBUG,"GetPCellInfo - aNbElem: "<<aNbElem<<": ");
for(TInt iElem = 0; iElem < aNbElem; iElem++){
TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
for(TInt iConn = 0; iConn < aConnDim; iConn++){
ADDMSG(MYVALUEDEBUG,aConnSlice[iConn]<<",");
}
ADDMSG(MYVALUEDEBUG," ");
}
ADDMSG(MYDEBUG, std::endl);
BEGMSG(MYVALUEDEBUG,"GetPCellInfo - GetFamNum: ");
for(TInt iElem = 0; iElem < aNbElem; iElem++){
ADDMSG(MYVALUEDEBUG,anInfo->GetFamNum(iElem)<<", ");
}
ADDMSG(MYVALUEDEBUG, std::endl);
if(anInfo->IsElemNum()){
BEGMSG(MYVALUEDEBUG,"GetPCellInfo - GetElemNum: ");
for(TInt iElem = 0; iElem < aNbElem; iElem++){
ADDMSG(MYVALUEDEBUG,anInfo->GetElemNum(iElem)<<", ");
}
ADDMSG(MYVALUEDEBUG, std::endl);
}
ADDMSG(MYDEBUG, std::endl);
#endif
return anInfo;
}
//----------------------------------------------------------------------------
//! Read a MEDWrapped representation of MED Balls from the MED file
PBallInfo
TWrapper
::GetPBallInfo(const PMeshInfo& theMeshInfo)
{
TInt nbBalls = GetNbBalls(theMeshInfo);
if ( nbBalls < 1 ) return PBallInfo();
PBallInfo anInfo = CrBallInfo( theMeshInfo, nbBalls );
GetBallInfo(anInfo);
return anInfo;
}
//----------------------------------------------------------------------------
PFieldInfo
TWrapper
::GetPFieldInfo(const PMeshInfo& theMeshInfo,
TInt theId,
TErr* theErr)
{
TInt aNbComp = GetNbComp(theId);
PFieldInfo anInfo = CrFieldInfo(theMeshInfo,aNbComp);
GetFieldInfo(theId,*anInfo,theErr);
#ifdef _DEBUG_
INITMSG(MYDEBUG,
"GetPFieldInfo "<<
"- aName = '"<<anInfo->GetName()<<"'"<<
"; aType = "<<anInfo->GetType()<<
"; aNbComp = "<<aNbComp<<
std::endl);
#endif
return anInfo;
}
//----------------------------------------------------------------------------
PTimeStampInfo
TWrapper
::GetPTimeStampInfo(const PFieldInfo& theFieldInfo,
EEntiteMaillage theEntity,
const TGeom2Size& theGeom2Size,
TInt theId,
TErr* theErr)
{
PTimeStampInfo anInfo = CrTimeStampInfo(theFieldInfo,theEntity,theGeom2Size);
GetTimeStampInfo(theId,*anInfo,theErr);
#ifdef _DEBUG_
INITMSG(MYDEBUG,"GetPTimeStampInfo - anEntity = "<<anInfo->GetEntity()<<"\n");
TGeom2NbGauss& aGeom2NbGauss = anInfo->myGeom2NbGauss;
TGeom2NbGauss::const_iterator anIter = aGeom2NbGauss.begin();
for(; anIter != aGeom2NbGauss.end(); anIter++){
const EGeometrieElement& aGeom = anIter->first;
INITMSG(MYDEBUG,"aGeom = "<<aGeom<<" - "<<aGeom2NbGauss[aGeom]<<";\n");
}
#endif
return anInfo;
}
//----------------------------------------------------------------------------
PProfileInfo
TWrapper
::GetPProfileInfo(TInt theId,
EModeProfil theMode,
TErr* theErr)
{
TProfileInfo::TInfo aPreInfo = GetProfilePreInfo(theId);
PProfileInfo anInfo = CrProfileInfo(aPreInfo,theMode);
GetProfileInfo(theId,*anInfo,theErr);
return anInfo;
}
//----------------------------------------------------------------------------
PTimeStampValueBase
TWrapper
::CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
const TGeom2Profile& theGeom2Profile,
EModeSwitch theMode)
{
PFieldInfo aFieldInfo = theTimeStampInfo->GetFieldInfo();
return CrTimeStampValue(theTimeStampInfo,
aFieldInfo->GetType(),
theGeom2Profile,
theMode);
}
//----------------------------------------------------------------------------
PTimeStampValueBase
TWrapper
::CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
const PTimeStampValueBase& theInfo)
{
PFieldInfo aFieldInfo = theTimeStampInfo->GetFieldInfo();
return CrTimeStampValue(theTimeStampInfo,
theInfo,
aFieldInfo->GetType());
}
//----------------------------------------------------------------------------
template<class TimeStampValueType>
void
Print(SharedPtr<TimeStampValueType> theTimeStampValue)
{
INITMSG(MYDEBUG,"Print - TimeStampValue\n");
typename TimeStampValueType::TTGeom2Value& aGeom2Value = theTimeStampValue->myGeom2Value;
typename TimeStampValueType::TTGeom2Value::const_iterator anIter = aGeom2Value.begin();
for(; anIter != aGeom2Value.end(); anIter++){
const EGeometrieElement& aGeom = anIter->first;
const typename TimeStampValueType::TTMeshValue& aMeshValue = anIter->second;
TInt aNbElem = aMeshValue.myNbElem;
TInt aNbGauss = aMeshValue.myNbGauss;
TInt aNbComp = aMeshValue.myNbComp;
INITMSG(MYDEBUG,"aGeom = "<<aGeom<<" - "<<aNbElem<<": ");
for(TInt iElem = 0; iElem < aNbElem; iElem++){
typename TimeStampValueType::TTMeshValue::TCValueSliceArr aValueSliceArr = aMeshValue.GetGaussValueSliceArr(iElem);
ADDMSG(MYVALUEDEBUG,"{");
for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
const typename TimeStampValueType::TTMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[iGauss];
for(TInt iComp = 0; iComp < aNbComp; iComp++){
ADDMSG(MYVALUEDEBUG,aValueSlice[iComp]<<" ");
}
ADDMSG(MYVALUEDEBUG,"| ");
}
ADDMSG(MYVALUEDEBUG,"} ");
}
ADDMSG(MYDEBUG,"\n");
}
}
//----------------------------------------------------------------------------
PTimeStampValueBase
TWrapper
::GetPTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
const TMKey2Profile& theMKey2Profile,
const TKey2Gauss& theKey2Gauss,
TErr* theErr)
{
PFieldInfo aFieldInfo = theTimeStampInfo->GetFieldInfo();
PTimeStampValueBase anInfo = CrTimeStampValue(theTimeStampInfo,
aFieldInfo->GetType());
GetTimeStampValue(anInfo,
theMKey2Profile,
theKey2Gauss,
theErr);
#ifdef _DEBUG_
if(aFieldInfo->GetType() == eFLOAT64)
Print<TFloatTimeStampValue>(anInfo);
else
Print<TIntTimeStampValue>(anInfo);
#endif
return anInfo;
}
//----------------------------------------------------------------------------
void
TWrapper
::GetTimeStampVal(const PTimeStampVal& theVal,
const TMKey2Profile& theMKey2Profile,
const TKey2Gauss& theKey2Gauss,
TErr* theErr)
{
PTimeStampInfo aTimeStampInfo = theVal->GetTimeStampInfo();
PFieldInfo aFieldInfo = aTimeStampInfo->GetFieldInfo();
if(aFieldInfo->GetType() == eFLOAT64)
GetTimeStampValue(theVal,
theMKey2Profile,
theKey2Gauss,
theErr);
else{
PTimeStampValueBase aVal = CrTimeStampValue(aTimeStampInfo,
theVal,
eINT);
GetTimeStampValue(aVal,
theMKey2Profile,
theKey2Gauss,
theErr);
CopyTimeStampValueBase(aVal, theVal);
}
}
//----------------------------------------------------------------------------
void
TWrapper
::SetTimeStamp(const PTimeStampVal& theVal,
TErr* theErr)
{
PTimeStampInfo aTimeStampInfo = theVal->GetTimeStampInfo();
PFieldInfo aFieldInfo = aTimeStampInfo->GetFieldInfo();
if(aFieldInfo->GetType() == eFLOAT64)
SetTimeStampValue(theVal, theErr);
else{
PTimeStampValueBase aVal = CrTimeStampValue(aTimeStampInfo,
eINT,
theVal->GetGeom2Profile(),
theVal->GetModeSwitch());
CopyTimeStampValueBase(theVal, aVal);
SetTimeStampValue(aVal, theErr);
}
}
//----------------------------------------------------------------------------
PTimeStampVal
TWrapper
::CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
const TGeom2Profile& theGeom2Profile,
EModeSwitch theMode)
{
return CrTimeStampValue(theTimeStampInfo,
eFLOAT64,
theGeom2Profile,
theMode);
}
//----------------------------------------------------------------------------
PTimeStampVal
TWrapper
::CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
const PTimeStampVal& theInfo)
{
return CrTimeStampValue(theTimeStampInfo,
theInfo,
eFLOAT64);
}
//----------------------------------------------------------------------------
PTimeStampVal
TWrapper
::GetPTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
const TMKey2Profile& theMKey2Profile,
const TKey2Gauss& theKey2Gauss,
TErr* theErr)
{
PTimeStampVal anInfo = CrTimeStampVal(theTimeStampInfo);
GetTimeStampVal(anInfo,
theMKey2Profile,
theKey2Gauss,
theErr);
return anInfo;
}
//----------------------------------------------------------------------------
PGrilleInfo
TWrapper
::GetPGrilleInfo(const PMeshInfo& theMeshInfo)
{
if(theMeshInfo->GetType() != eSTRUCTURE)
return PGrilleInfo();
EGrilleType type;
GetGrilleType(*theMeshInfo,type);
PGrilleInfo anInfo;
if(type == eGRILLE_STANDARD){
const TInt nnoeuds = GetNbNodes(*theMeshInfo);
anInfo = CrGrilleInfo(theMeshInfo,type,nnoeuds);
}
else {
TIntVector aVec;
aVec.resize(theMeshInfo->GetDim());
for(int aAxe=0;aAxe<theMeshInfo->GetDim();aAxe++){
ETable aATable;
switch(aAxe){
case 0:
aATable = eCOOR_IND1;
break;
case 1:
aATable = eCOOR_IND2;
break;
case 2:
aATable = eCOOR_IND3;
break;
}
aVec[aAxe] = GetNbNodes(*theMeshInfo,aATable);
}
anInfo = CrGrilleInfo(theMeshInfo,type,aVec);
}
GetGrilleInfo(anInfo);
anInfo->SetGrilleType(type);
#ifdef _DEBUG_
INITMSG(MYDEBUG,"GetPGrilleInfo: ");
{
TInt aNbElem = anInfo->GetNbNodes();
BEGMSG(MYVALUEDEBUG,"GetFamNumNode: ");
for(TInt iElem = 0; iElem < aNbElem; iElem++){
ADDMSG(MYVALUEDEBUG,anInfo->GetFamNumNode(iElem)<<", ");
}
TInt aNbCells = anInfo->GetNbCells();
BEGMSG(MYVALUEDEBUG,"GetFamNum: ");
for(TInt iElem = 0; iElem < aNbCells; iElem++){
ADDMSG(MYVALUEDEBUG,anInfo->GetFamNum(iElem)<<", ");
}
ADDMSG(MYVALUEDEBUG, std::endl);
BEGMSG(MYVALUEDEBUG,"GetCoordName: ");
for(TInt iElem = 0; iElem < theMeshInfo->GetDim(); iElem++){
ADDMSG(MYVALUEDEBUG,anInfo->GetCoordName(iElem)<<", ");
}
ADDMSG(MYVALUEDEBUG, std::endl);
BEGMSG(MYVALUEDEBUG,"GetCoordUnit: ");
for(TInt iElem = 0; iElem < theMeshInfo->GetDim(); iElem++){
ADDMSG(MYVALUEDEBUG,anInfo->GetCoordUnit(iElem)<<", ");
}
ADDMSG(MYVALUEDEBUG, std::endl);
}
#endif
return anInfo;
}
//----------------------------------------------------------------------------
PGrilleInfo
TWrapper
::GetPGrilleInfo(const PMeshInfo& theMeshInfo,
const PGrilleInfo& theInfo)
{
PGrilleInfo anInfo = CrGrilleInfo(theMeshInfo,theInfo);
return anInfo;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : MED_WrapperBase.hxx
// Author : Alexander A. BORODIN
//
#ifndef _MED_WrapperBase_HXX_
#define _MED_WrapperBase_HXX_
#ifdef WIN32
#if defined MEDWRAPPER_BASE_EXPORTS || defined MEDWrapperBase_EXPORTS
#if defined WIN32
#define MEDWRAPPER_EXPORT __declspec( dllexport )
#else
#define MEDWRAPPER_EXPORT
#endif
#else
#if defined WIN32
#define MEDWRAPPER_EXPORT __declspec( dllimport )
#else
#define MEDWRAPPER_EXPORT
#endif
#endif
#else
#define MEDWRAPPER_EXPORT
#endif
#endif

View File

@ -0,0 +1,52 @@
# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES= libMEDWrapperBase.la
salomeinclude_HEADERS= \
MED_Common.hxx \
MED_Vector.hxx \
MED_SharedPtr.hxx \
MED_SliceArray.hxx \
MED_Wrapper.hxx \
MED_TWrapper.hxx \
MED_Structures.hxx \
MED_TStructures.hxx \
MED_Algorithm.hxx \
MED_GaussUtils.hxx \
MED_CoordUtils.hxx \
MED_Utilities.hxx \
MED_GaussDef.hxx \
MED_WrapperBase.hxx
dist_libMEDWrapperBase_la_SOURCES= \
MED_Structures.cxx \
MED_Wrapper.cxx \
MED_Algorithm.cxx \
MED_GaussUtils.cxx \
MED_CoordUtils.cxx \
MED_Utilities.cxx \
MED_GaussDef.cxx
libMEDWrapperBase_la_CPPFLAGS= $(BOOST_CPPFLAGS) $(HDF5_INCLUDES) -D@MACHINE@
libMEDWrapperBase_la_CPPFLAGS+= -I$(KERNEL_ROOT_DIR)/include/salome
libMEDWrapperBase_la_CPPFLAGS+= $(MED_CPPFLAGS)
libMEDWrapperBase_la_LDFLAGS= $(BOOST_LIB_THREAD) $(BOOST_LIB_SYSTEM) $(BOOST_LIB_DATE_TIME)

View File

@ -0,0 +1,22 @@
# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
ADD_SUBDIRECTORY(Base)
ADD_SUBDIRECTORY(V2_2)
ADD_SUBDIRECTORY(Factory)

View File

@ -0,0 +1,57 @@
# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
INCLUDE_DIRECTORIES(
${HDF5_INCLUDE_DIRS}
${BOOST_INCLUDE_DIRS}
${MED3_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/../Base
${CMAKE_CURRENT_SOURCE_DIR}/../V2_2
)
IF(MED_ENABLE_KERNEL)
INCLUDE_DIRECTORIES(${KERNEL_ROOT_DIR}/include/salome)
ELSE(MED_ENABLE_KERNEL)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/adm_local_without_kernel)
ENDIF(MED_ENABLE_KERNEL)
SET(MEDWrapper_SOURCES
MED_Factory.cxx
)
SET(mprint_version_SOURCES
mprint_version.cxx
)
ADD_LIBRARY(MEDWrapper SHARED ${MEDWrapper_SOURCES})
SET_TARGET_PROPERTIES(MEDWrapper PROPERTIES COMPILE_FLAGS "${BOOST_DEFINITIONS} ${MED3_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
TARGET_LINK_LIBRARIES(MEDWrapper MEDWrapper_V2_2)
INSTALL(TARGETS MEDWrapper DESTINATION ${MED_salomelib_LIBS})
ADD_EXECUTABLE(mprint_version ${mprint_version_SOURCES})
SET_TARGET_PROPERTIES(mprint_version PROPERTIES COMPILE_FLAGS "${BOOST_DEFINITIONS} ${MED3_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
TARGET_LINK_LIBRARIES(mprint_version MEDWrapper MEDWrapper_V2_2 MEDWrapperBase ${BOOST_LIBS} ${MED3_LIBS_C_ONLY})
ADD_EXECUTABLE(MED_Test ${mprint_version_SOURCES})
SET_TARGET_PROPERTIES(MED_Test PROPERTIES COMPILE_FLAGS "${BOOST_DEFINITIONS} ${MED3_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
TARGET_LINK_LIBRARIES(MED_Test MEDWrapper MEDWrapper_V2_2 MEDWrapperBase ${BOOST_LIBS})
FILE(GLOB MEDWrapper_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
INSTALL(FILES ${MEDWrapper_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS})
INSTALL(TARGETS mprint_version MED_Test DESTINATION ${MED_salomebin_BINS})

View File

@ -0,0 +1,164 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include "MED_Factory.hxx"
#include "MED_Utilities.hxx"
#include "MED_V2_2_Wrapper.hxx"
#include <stdio.h>
#include <sstream>
extern "C"
{
#include <med.h>
#ifndef WIN32
#include <unistd.h>
#endif
}
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
namespace MED
{
EVersion GetVersionId(const std::string& theFileName,
bool theDoPreCheckInSeparateProcess)
{
INITMSG(MYDEBUG,"GetVersionId - theFileName = '"<<theFileName<<"'"<<std::endl);
EVersion aVersion = eVUnknown;
#ifndef WIN32
if (access(theFileName.c_str(),F_OK))
return aVersion;
if(theDoPreCheckInSeparateProcess){
// First check, is it possible to deal with the file
std::ostringstream aStr;
// File name is in quotes for the case of space(s) inside it (PAL13009)
aStr<<"bash -c \""<<getenv("SMESH_ROOT_DIR")<<"/bin/salome/mprint_version \'"<<theFileName<<"\'\"";
if(!MYDEBUG)
aStr<<" 2>&1 > /dev/null";
std::string aCommand = aStr.str();
int aStatus = system(aCommand.c_str());
BEGMSG(MYDEBUG,"aCommand = '"<<aCommand<<"'; aStatus = "<<aStatus<<std::endl);
if(aStatus != 0)
return aVersion;
}
#endif
// check compatibility of hdf and med versions
med_bool hdfok, medok;
MEDfileCompatibility(theFileName.c_str(), &hdfok, &medok);
if ((!hdfok) /*|| (!medok)*/) // med-2.1 is KO since med-3.0.0
return aVersion;
// Next, try to open the file trough the MED API
const char* aFileName = theFileName.c_str();
med_idt aFid = MEDfileOpen(aFileName,MED_ACC_RDONLY);
MSG(MYDEBUG,"GetVersionId - theFileName = '"<<theFileName<<"'; aFid = "<<aFid<<std::endl);
if(aFid >= 0){
med_int aMajor, aMinor, aRelease;
med_err aRet = MEDfileNumVersionRd(aFid,&aMajor,&aMinor,&aRelease);
INITMSG(MYDEBUG,"GetVersionId - theFileName = '"<<theFileName<<"'; aRet = "<<aRet<<std::endl);
if(aRet >= 0){
if(aMajor == 2 && aMinor == 1)
aVersion = eV2_1;
else
aVersion = eV2_2;
}
else {
// VSR: simulate med 2.3.6 behavior, med file version is assumed to 2.1
aVersion = eV2_1;
}
}
MEDfileClose(aFid);
BEGMSG(MYDEBUG,"GetVersionId - theFileName = '"<<theFileName<<"'; aVersion = "<<aVersion<<std::endl);
return aVersion;
}
bool getMEDVersion( const std::string& fname, int& major, int& minor, int& release )
{
med_idt f = MEDfileOpen(fname.c_str(), MED_ACC_RDONLY );
if( f<0 )
return false;
med_int aMajor, aMinor, aRelease;
med_err aRet = MEDfileNumVersionRd( f, &aMajor, &aMinor, &aRelease );
major = aMajor;
minor = aMinor;
release = aRelease;
MEDfileClose( f );
if( aRet<0 ) {
// VSR: simulate med 2.3.6 behavior, med file version is assumed to 2.1
major = 2; minor = release = -1;
//return false;
}
return true;
}
PWrapper CrWrapper(const std::string& theFileName,
bool theDoPreCheckInSeparateProcess)
{
PWrapper aWrapper;
EVersion aVersion = GetVersionId(theFileName,theDoPreCheckInSeparateProcess);
switch(aVersion){
case eV2_2:
aWrapper.reset(new MED::V2_2::TVWrapper(theFileName));
break;
case eV2_1:
EXCEPTION(std::runtime_error,"Cannot open file '"<<theFileName<<"'. Med version 2.1 is not supported any more.");
//aWrapper.reset(new MED::V2_1::TVWrapper(theFileName));
break;
default:
EXCEPTION(std::runtime_error,"MED::CrWrapper - theFileName = '"<<theFileName<<"'");
}
return aWrapper;
}
PWrapper CrWrapper(const std::string& theFileName, EVersion theId)
{
EVersion aVersion = GetVersionId(theFileName);
if(aVersion != theId)
remove(theFileName.c_str());
PWrapper aWrapper;
switch(theId){
case eV2_2:
aWrapper.reset(new MED::V2_2::TVWrapper(theFileName));
break;
case eV2_1:
EXCEPTION(std::runtime_error,"Cannot open file '"<<theFileName<<"'. Med version 2.1 is not supported any more.");
//aWrapper.reset(new MED::V2_1::TVWrapper(theFileName));
break;
default:
aWrapper.reset(new MED::V2_2::TVWrapper(theFileName));
}
return aWrapper;
}
}

View File

@ -0,0 +1,48 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#ifndef MED_Factory_HeaderFile
#define MED_Factory_HeaderFile
#include "MED_WrapperFactory.hxx"
#include "MED_Wrapper.hxx"
namespace MED
{
MEDWRAPPER_FACTORY_EXPORT
EVersion
GetVersionId(const std::string& theFileName,
bool theDoPreCheckInSeparateProcess = false);
MEDWRAPPER_FACTORY_EXPORT
bool getMEDVersion( const std::string&, int&, int&, int& );
MEDWRAPPER_FACTORY_EXPORT
PWrapper
CrWrapper(const std::string& theFileName,
bool theDoPreCheckInSeparateProcess = false);
MEDWRAPPER_FACTORY_EXPORT
PWrapper
CrWrapper(const std::string& theFileName, EVersion theId);
}
#endif

View File

@ -0,0 +1,347 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MED_Utilities.hxx"
#include "MED_Algorithm.hxx"
#include "MED_GaussUtils.hxx"
#include "MED_Factory.hxx"
#ifdef _DEBUG_
static int MYDEBUG = 1;
#else
// static int MYDEBUG = 0;
#endif
static int MYWRITEDEBUG = 1;
using namespace MED;
#undef _DEBUG_
void CheckMed(const std::string& theFileName)
{
MSG(MYDEBUG,"CheckMed - theFileName = '"<<theFileName<<"'");
{
//TErr anErr;
PWrapper aMed = CrWrapper(theFileName);
TKey2Gauss aKey2Gauss = GetKey2Gauss(aMed);
TMKey2Profile aMKey2Profile = GetMKey2Profile(aMed);
INITMSG(MYDEBUG,"aMed->GetNbProfiles() = "<<aMed->GetNbProfiles()<<std::endl);
TInt aNbMeshes = aMed->GetNbMeshes();
BEGMSG(MYDEBUG,"GetNbMeshes() = "<<aNbMeshes<<std::endl);
for(TInt iMesh = 1; iMesh <= aNbMeshes; iMesh++){
PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
INITMSG(MYDEBUG,"aMeshInfo->GetName() = '"<<aMeshInfo->GetName()<<"'"<<std::endl);
TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo =
GetEntity2TGeom2ElemInfo(aMed,aMeshInfo,aEntityInfo);
TFieldInfo2TimeStampInfoSet aFieldInfo2TimeStampInfoSet =
GetFieldInfo2TimeStampInfoSet(aMed,aMeshInfo,aEntityInfo);
TEntite2TFieldInfo2TimeStampInfoSet anEntite2TFieldInfo2TimeStampInfoSet =
GetEntite2TFieldInfo2TimeStampInfoSet(aFieldInfo2TimeStampInfoSet);
TEntite2TFieldInfo2TimeStampInfoSet::const_iterator anEntite2TFieldInfo2TimeStampInfoSetIter =
anEntite2TFieldInfo2TimeStampInfoSet.begin();
for(; anEntite2TFieldInfo2TimeStampInfoSetIter != anEntite2TFieldInfo2TimeStampInfoSet.end(); anEntite2TFieldInfo2TimeStampInfoSetIter++){
const TFieldInfo2TimeStampInfoSet& aFieldInfo2TimeStampInfoSet = anEntite2TFieldInfo2TimeStampInfoSetIter->second;
TFieldInfo2TimeStampInfoSet::const_iterator aFieldInfo2TimeStampInfoSetIter = aFieldInfo2TimeStampInfoSet.begin();
for(; aFieldInfo2TimeStampInfoSetIter != aFieldInfo2TimeStampInfoSet.end(); aFieldInfo2TimeStampInfoSetIter++){
PFieldInfo aFieldInfo = aFieldInfo2TimeStampInfoSetIter->first;
INITMSG(MYDEBUG,
"GetPFieldInfo "<<
"- aName = '"<<aFieldInfo->GetName()<<"'"<<
"; aType = "<<aFieldInfo->GetType()<<
"; aNbComp = "<<aFieldInfo->GetNbComp()<<
std::endl);
const TTimeStampInfoSet& aTimeStampInfoSet = aFieldInfo2TimeStampInfoSetIter->second;
TTimeStampInfoSet::const_iterator aTimeStampInfoSettIter = aTimeStampInfoSet.begin();
for(; aTimeStampInfoSettIter != aTimeStampInfoSet.end(); aTimeStampInfoSettIter++){
PTimeStampInfo aTimeStampInfo = *aTimeStampInfoSettIter;
INITMSG(MYDEBUG,
"GetPTimeStampInfo "<<
"- anEntity = "<<aTimeStampInfo->GetEntity()<<
"; aNumDt = "<<aTimeStampInfo->GetNumDt()<<
std::endl);
PTimeStampValueBase aTimeStampValue =
aMed->GetPTimeStampValue(aTimeStampInfo,
aMKey2Profile,
aKey2Gauss);
}
}
}
continue;
TFamilyInfoSet aFamilyInfoSet = GetFamilyInfoSet(aMed,aMeshInfo);
TEntity2FamilySet aEntity2FamilySet =
GetEntity2FamilySet(aMed,anEntity2TGeom2ElemInfo,aFamilyInfoSet);
TGroupInfo aGroupInfo = GetGroupInfo(aFamilyInfoSet);
PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
TEntity2TGeom2ElemInfo::const_iterator anIter = anEntity2TGeom2ElemInfo.begin();
for(; anIter != anEntity2TGeom2ElemInfo.end(); anIter++){
const EEntiteMaillage& anEntity = anIter->first;
if(anEntity != eNOEUD){
const TGeom2ElemInfo& aGeom2ElemInfo = anIter->second;
TKey2Gauss::const_iterator anIter2 = aKey2Gauss.begin();
for(; anIter2 != aKey2Gauss.end(); anIter2++){
const TGaussInfo::TKey& aKey = anIter2->first;
EGeometrieElement aGeom = boost::get<0>(aKey);
TGeom2ElemInfo::const_iterator anIter3 = aGeom2ElemInfo.find(aGeom);
if(anIter3 != aGeom2ElemInfo.end()){
if(PCellInfo aCellInfo = anIter3->second){
PGaussInfo aGaussInfo = anIter2->second;
TGaussCoord aGaussCoord;
GetGaussCoord3D(aGaussInfo,aCellInfo,aNodeInfo,aGaussCoord);
}
}
}
}
}
}
}
MSG(MYDEBUG,"OK");
}
void CopyMed(const PWrapper& theMed,
const PWrapper& theMed2,
int theIncr)
{
TKey2Gauss aKey2Gauss = GetKey2Gauss(theMed);
TMKey2Profile aMKey2Profile = GetMKey2Profile(theMed);
TInt aNbMeshes = theMed->GetNbMeshes();
MSG(MYDEBUG,"aNbMeshes = "<<aNbMeshes);
std::string aName;
for(TInt iMesh = 0; iMesh < aNbMeshes; iMesh++){
PMeshInfo aMeshInfo = theMed->GetPMeshInfo(iMesh+1);
#ifdef _DEBUG_
TInt aDim = aMeshInfo->myDim;
aName = aMeshInfo->GetName();
INITMSG(MYDEBUG,"GetMeshInfo - aName = '"<<aName<<"'; aDim = "<<aDim<<"\n");
#endif
PMeshInfo aMeshInfo2 = theMed2->CrMeshInfo(aMeshInfo);
if(MYWRITEDEBUG){
aName = aMeshInfo2->GetName();
aName[0] += theIncr;
aMeshInfo2->SetName(aName);
theMed2->SetMeshInfo(aMeshInfo2);
BEGMSG(MYDEBUG,"aNbMeshes2 = "<<theMed2->GetNbMeshes()<<"\n");
}
TEntityInfo aEntityInfo = theMed->GetEntityInfo(aMeshInfo);
//continue;
TInt aNbFields = theMed->GetNbFields();
MSG(MYDEBUG,"GetNbFields() = "<<aNbFields);
for(TInt iField = 0; iField < aNbFields; iField++){
PFieldInfo aFieldInfo = theMed->GetPFieldInfo(aMeshInfo,iField+1);
#ifdef _DEBUG_
TInt aNbComp = aFieldInfo->GetNbComp();
INITMSG(MYDEBUG,"aName = '"<<aFieldInfo->GetName()<<"'; aNbComp = "<<aNbComp<<";\n");
#endif
PFieldInfo aFieldInfo2 = theMed->CrFieldInfo(aMeshInfo2,aFieldInfo);
if(MYWRITEDEBUG){
aName = aFieldInfo->GetName();
aName[0] += theIncr;
aFieldInfo2->SetName(aName);
theMed2->SetFieldInfo(aFieldInfo2);
}
EEntiteMaillage anEntity;
TGeom2Size aGeom2Size;
TInt aNbTimeStamps =
theMed->GetNbTimeStamps(aFieldInfo,aEntityInfo,anEntity,aGeom2Size);
{
INITMSG(MYDEBUG,"GetNbTimeStamps = "<<aNbTimeStamps<<std::endl);
for(TInt iTimeStamp = 0; iTimeStamp < aNbTimeStamps; iTimeStamp++){
PTimeStampInfo aTimeStampInfo =
theMed->GetPTimeStampInfo(aFieldInfo,anEntity,aGeom2Size,iTimeStamp+1);
#ifdef _DEBUG_
TInt aNumDt = aTimeStampInfo->GetNumDt();
INITMSG(MYDEBUG,"aNumDt = "<<aNumDt<<"\n");
#endif
PTimeStampInfo aTimeStampInfo2 =
theMed->CrTimeStampInfo(aFieldInfo2,aTimeStampInfo);
PTimeStampValueBase aTimeStampValue =
theMed->GetPTimeStampValue(aTimeStampInfo,
aMKey2Profile,
aKey2Gauss);
PTimeStampValueBase aTimeStampValue2 =
theMed->CrTimeStampValue(aTimeStampInfo2,
aTimeStampValue);
if(MYWRITEDEBUG) theMed2->SetTimeStamp(aTimeStampValue2);
}
}
}
TInt aNbFam = theMed->GetNbFamilies(aMeshInfo);
MSG(MYDEBUG,"GetNbFamilies() = "<<aNbFam);
for(TInt iFam = 0; iFam < aNbFam; iFam++){
PFamilyInfo aFamilyInfo = theMed->GetPFamilyInfo(aMeshInfo,iFam+1);
TInt aNbGroup = aFamilyInfo->GetNbGroup();
#ifdef _DEBUG_
TInt aNbAttr = aFamilyInfo->GetNbAttr();
#endif
TInt anId = aFamilyInfo->GetId();
if(anId == 0)
continue;
aName = aFamilyInfo->GetName();
#ifdef _DEBUG_
INITMSG(MYDEBUG,"aName = '"<<aName<<"'; anId = "<<anId<<
"; aNbAttr = "<<aNbAttr<<"; aNbGroup = "<<aNbGroup<<"\n");
#endif
PFamilyInfo aFamilyInfo2 = theMed->CrFamilyInfo(aMeshInfo2,aFamilyInfo);
for(TInt iGroup = 0; iGroup < aNbGroup; iGroup++){
aName = aFamilyInfo->GetGroupName(iGroup);
INITMSG(MYDEBUG,"aGroupName = '"<<aName<<"'\n");
aName[0] += theIncr;
aFamilyInfo2->SetGroupName(iGroup,aName);
}
if(MYWRITEDEBUG){
aName = aFamilyInfo->GetName();
aName[0] += theIncr;
aFamilyInfo2->SetName(aName);
theMed2->SetFamilyInfo(aFamilyInfo2);
INITMSG(MYDEBUG,"GetNbFamilies = "<<theMed2->GetNbFamilies(aMeshInfo2)<<std::endl);
}
}
MSG(MYDEBUG,"GetEntityInfo - aNbEntities = "<<aEntityInfo.size());
TEntityInfo::iterator anEntityInfoIter = aEntityInfo.begin();
for(; anEntityInfoIter != aEntityInfo.end(); anEntityInfoIter++){
const EEntiteMaillage& anEntity = anEntityInfoIter->first;
INITMSG(MYDEBUG,"anEntity = "<<anEntity<<"\n");
if(anEntity == eNOEUD){
PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo);
PNodeInfo aNodeInfo2 = theMed->CrNodeInfo(aMeshInfo2,aNodeInfo);
if(MYWRITEDEBUG) theMed2->SetNodeInfo(aNodeInfo2);
continue;
}
TGeom2Size& aGeom2Size = anEntityInfoIter->second;
TGeom2Size::iterator aGeomIter = aGeom2Size.begin();
for(; aGeomIter != aGeom2Size.end(); aGeomIter++){
const EGeometrieElement& aGeom = aGeomIter->first;
#ifdef _DEBUG_
const TInt& aNbElem = aGeomIter->second;
INITMSG(MYDEBUG,"aGeom = "<<aGeom<<"; aNbElem = "<<aNbElem<<": ");
#endif
switch(aGeom){
case ePOLYGONE: {
PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,anEntity,aGeom);
PPolygoneInfo aPolygoneInfo2 = theMed->CrPolygoneInfo(aMeshInfo2,aPolygoneInfo);
if(MYWRITEDEBUG) theMed2->SetPolygoneInfo(aPolygoneInfo2);
break;
}
case ePOLYEDRE: {
PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,anEntity,aGeom);
PPolyedreInfo aPolyedreInfo2 = theMed->CrPolyedreInfo(aMeshInfo2,aPolyedreInfo);
if(MYWRITEDEBUG) theMed2->SetPolyedreInfo(aPolyedreInfo2);
break;
}
default:
PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,anEntity,aGeom);
PCellInfo aCellInfo2 = theMed2->CrCellInfo(aMeshInfo2,aCellInfo);
if(MYWRITEDEBUG) theMed2->SetCellInfo(aCellInfo2);
}
}
}
}
MSG(MYDEBUG,"OK");
}
void CopyMed(const std::string& theFileName,
const std::string& theFileName2,
MED::EVersion theVersion,
int theNbCopy)
{
MSG(MYDEBUG,"CopyMed - theFileName = '"<<theFileName<<"'; theFileName2 = '"<<theFileName2<<"', theVersion = "<<theVersion);
PWrapper aMed = CrWrapper(theFileName);
PWrapper aMed2 = CrWrapper(theFileName2,theVersion);
for(int i = 0; i < theNbCopy; i++)
CopyMed(aMed,aMed2,i);
}
void ReadMed(const char* theFileName,
const char* theFileName2,
MED::EVersion theVersion = eV2_2,
int theNbCopy = 1)
{
MSG(MYDEBUG,"theFileName = '"<<theFileName<<"'; "<<
"theFileName2 = '"<<theFileName2<<"'; "<<
"theVersion = "<<theVersion<<"; "<<
"theNbCopy = "<<theNbCopy);
CopyMed(theFileName,theFileName2,theVersion,theNbCopy);
}
#ifdef WIN32
#pragma warning(disable:4101) // exc unreferenced ... ??
#endif
int main(int argc, char** argv){
#ifndef _DEBUG_
try{
#endif
if(argc == 2)
CheckMed(argv[1]);
if(argc == 3)
ReadMed(argv[1],argv[2]);
if(argc == 4)
ReadMed(argv[1],argv[2],MED::EVersion(atoi(argv[3])));
if(argc == 5)
ReadMed(argv[1],argv[2],MED::EVersion(atoi(argv[3])),atoi(argv[4]));
return 0;
#ifndef _DEBUG_
}catch(std::exception& exc){
MSG(MYDEBUG,"Follow exception was accured :\n"<<exc.what());
}catch(...){
MSG(MYDEBUG,"Unknown exception was accured");
}
#endif
return 1;
}

View File

@ -0,0 +1,46 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : MED_WrapperFactory.hxx
// Author : Alexander A. BORODIN
//
#ifndef _MED_WrapperFactory_HXX_
#define _MED_WrapperFactory_HXX_
#ifdef WIN32
#if defined MEDWRAPPER_FACTORY_EXPORTS || defined MEDWrapper_EXPORTS
#if defined WIN32
#define MEDWRAPPER_FACTORY_EXPORT __declspec( dllexport )
#else
#define MEDWRAPPER_FACTORY_EXPORT
#endif
#else
#if defined WIN32
#define MEDWRAPPER_FACTORY_EXPORT __declspec( dllimport )
#else
#define MEDWRAPPER_FACTORY_EXPORT
#endif
#endif
#else
#define MEDWRAPPER_FACTORY_EXPORT
#endif
#endif

View File

@ -0,0 +1,47 @@
# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES= libMEDWrapper.la
salomeinclude_HEADERS= \
MED_Factory.hxx \
MED_WrapperFactory.hxx
dist_libMEDWrapper_la_SOURCES= \
MED_Factory.cxx
libMEDWrapper_la_CPPFLAGS= $(BOOST_CPPFLAGS) $(MED3_INCLUDES) \
-I$(srcdir)/../Base
libMEDWrapper_la_CPPFLAGS+= -I$(KERNEL_ROOT_DIR)/include/salome
libMEDWrapper_la_CPPFLAGS+= -I$(srcdir)/../V2_2
libMEDWrapper_la_LDFLAGS= ../V2_2/libMEDWrapper_V2_2.la
# Executables targets
bin_PROGRAMS = MED_Test mprint_version
dist_MED_Test_SOURCES= MED_Test.cxx
MED_Test_CPPFLAGS= $(libMEDWrapper_la_CPPFLAGS)
MED_Test_LDADD= $(libMEDWrapper_la_LDFLAGS) ../Base/libMEDWrapperBase.la \
$(BOOST_LIB_THREAD) $(BOOST_LIB_SYSTEM) libMEDWrapper.la
dist_mprint_version_SOURCES= mprint_version.cxx
mprint_version_CPPFLAGS= $(libMEDWrapper_la_CPPFLAGS)
mprint_version_LDADD= $(libMEDWrapper_la_LDFLAGS) ../Base/libMEDWrapperBase.la \
$(BOOST_LIB_THREAD) $(BOOST_LIB_SYSTEM) libMEDWrapper.la $(MED3_LIBS_C_ONLY)

View File

@ -0,0 +1,44 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <med.h>
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
med_idt aFid = MEDfileOpen(argv[1],MED_ACC_RDONLY);
if(aFid < 0)
exit(1);
med_int aMajor, aMinor, aRelease;
med_err aRet = MEDfileNumVersionRd(aFid,&aMajor,&aMinor,&aRelease);
MEDfileClose(aFid);
if(aRet < 0) {
// VSR: simulate med 2.3.6 behavior, med file version is assumed to 2.1
aMajor=2;
aMinor=aRelease=-1;
}
printf("%d.%d.%d\n",aMajor,aMinor,aRelease);
}

View File

@ -0,0 +1,23 @@
# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = Base V2_2 Factory
DIST_SUBDIRS = Base V2_2 Factory

View File

@ -0,0 +1,43 @@
# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
INCLUDE_DIRECTORIES(
${MED3_INCLUDE_DIRS}
${HDF5_INCLUDE_DIRS}
${BOOST_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/../Base
)
SET(MEDWrapper_V2_2_SOURCES
MED_V2_2_Wrapper.cxx
)
IF(MED_ENABLE_KERNEL)
INCLUDE_DIRECTORIES(${KERNEL_ROOT_DIR}/include/salome)
ELSE(MED_ENABLE_KERNEL)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/adm_local_without_kernel)
ENDIF(MED_ENABLE_KERNEL)
ADD_LIBRARY(MEDWrapper_V2_2 SHARED ${MEDWrapper_V2_2_SOURCES})
SET_TARGET_PROPERTIES(MEDWrapper_V2_2 PROPERTIES COMPILE_FLAGS "${HDF5_DEFINITIONS} ${MED3_DEFINITIONS} ${BOOST_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
TARGET_LINK_LIBRARIES(MEDWrapper_V2_2 MEDWrapperBase ${MED3_LIBS_C_ONLY} ${HDF5_LIBS})
INSTALL(TARGETS MEDWrapper_V2_2 DESTINATION ${MED_salomelib_LIBS})
FILE(GLOB MEDWrapper_V2_2_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
INSTALL(FILES ${MEDWrapper_V2_2_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS})

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,490 @@
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#ifndef MED_V2_2_Wrapper_HeaderFile
#define MED_V2_2_Wrapper_HeaderFile
#ifdef WIN32
#if defined MEDWRAPPER_V2_2_EXPORTS || defined MEDWrapper_V2_2_EXPORTS
#if defined WIN32
#define MED_V22_WRAPPER_EXPORT __declspec( dllexport )
#else
#define MED_V22_WRAPPER_EXPORT
#endif
#else
#if defined WIN32
#define MED_V22_WRAPPER_EXPORT __declspec( dllimport )
#else
#define MED_V22_WRAPPER_EXPORT
#endif
#endif
#else
#define MED_V22_WRAPPER_EXPORT
#endif
#include "MED_Structures.hxx"
#include "MED_TWrapper.hxx"
namespace MED
{
template<>
TInt MED_V22_WRAPPER_EXPORT
GetDESCLength<eV2_2>();
template<>
TInt MED_V22_WRAPPER_EXPORT
GetIDENTLength<eV2_2>();
template<>
TInt MED_V22_WRAPPER_EXPORT
GetNOMLength<eV2_2>();
template<>
TInt MED_V22_WRAPPER_EXPORT
GetLNOMLength<eV2_2>();
template<>
TInt MED_V22_WRAPPER_EXPORT
GetPNOMLength<eV2_2>();
template<>
void MED_V22_WRAPPER_EXPORT
GetVersionRelease<eV2_2>(TInt& majeur, TInt& mineur, TInt& release);
template<>
TInt MED_V22_WRAPPER_EXPORT
GetNbConn<eV2_2>(EGeometrieElement typmai,
EEntiteMaillage typent,
TInt mdim);
namespace V2_2
{
//----------------------------------------------------------------------------
class TFile;
typedef boost::shared_ptr<TFile> PFile;
typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
//----------------------------------------------------------------------------
class MED_V22_WRAPPER_EXPORT TVWrapper: public MED::TTWrapper<eV2_2>
{
TVWrapper();
TVWrapper(const TVWrapper&);
TVWrapper& operator=(const TVWrapper&);
public:
TVWrapper(const std::string& theFileName);
//----------------------------------------------------------------------------
virtual
TInt
GetNbMeshes(TErr* theErr = NULL);
virtual
void
GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
TErr* theErr = NULL);
virtual
void
SetMeshInfo(const MED::TMeshInfo& theInfo,
TErr* theErr = NULL);
void SetMeshInfo(const MED::TMeshInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TInt
GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
TErr* theErr = NULL);
virtual
TInt
GetNbFamAttr(TInt theFamId,
const MED::TMeshInfo& theInfo,
TErr* theErr = NULL);
virtual
TInt
GetNbFamGroup(TInt theFamId,
const MED::TMeshInfo& theInfo,
TErr* theErr = NULL);
virtual
void
GetFamilyInfo(TInt theFamId,
MED::TFamilyInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetFamilyInfo(const MED::TFamilyInfo& theInfo,
TErr* theErr = NULL);
void
SetFamilyInfo(const MED::TFamilyInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
void
GetNames(TElemInfo& theInfo,
TInt nb,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
virtual
void
GetNumeration(TElemInfo& theInfo,
TInt nb,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
virtual
void
GetFamilies(TElemInfo& theInfo,
TInt nb,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
virtual
void
SetNames(const TElemInfo& theInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
void
SetNames(const TElemInfo& theInfo,
EModeAcces theMode,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
virtual
void
SetNumeration(const TElemInfo& theInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
void
SetNumeration(const TElemInfo& theInfo,
EModeAcces theMode,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
virtual
void
SetFamilies(const TElemInfo& theInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
void
SetFamilies(const TElemInfo& theInfo,
EModeAcces theMode,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TInt
GetNbNodes(const MED::TMeshInfo& theMeshInfo,
TErr* theErr = NULL)
{
return GetNbNodes(theMeshInfo,eCOOR,theErr);
}
TInt
GetNbNodes(const MED::TMeshInfo& theMeshInfo,
ETable theTable,
TErr* theErr = NULL);
virtual
void
GetNodeInfo(MED::TNodeInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetNodeInfo(const MED::TNodeInfo& theInfo,
TErr* theErr = NULL);
void
SetNodeInfo(const MED::TNodeInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
void
GetPolygoneInfo(TPolygoneInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetPolygoneInfo(const TPolygoneInfo& theInfo,
TErr* theErr = NULL);
void
SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
virtual
TInt
GetNbPolygones(const TMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
EConnectivite theConnMode = eNOD,
TErr* theErr = NULL);
virtual
TInt
GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
EConnectivite theConnMode = eNOD,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
void
GetPolyedreInfo(TPolyedreInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetPolyedreInfo(const TPolyedreInfo& theInfo,
TErr* theErr = NULL);
void
SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
virtual
TInt
GetNbPolyedres(const TMeshInfo& theMeshInfo,
EEntiteMaillage,
EGeometrieElement,
EConnectivite,
TErr* theErr = NULL);
virtual
void
GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
TInt& theNbFaces,
TInt& theConnSize,
EConnectivite theConnMode = eNOD,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TEntityInfo
GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
EConnectivite theConnMode = eNOD,
TErr* theErr = NULL);
virtual
TInt
GetNbCells(const MED::TMeshInfo& theMeshInfo,
EEntiteMaillage,
EGeometrieElement,
EConnectivite theConnMode = eNOD,
TErr* theErr = NULL);
virtual
void
GetCellInfo(MED::TCellInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetCellInfo(const MED::TCellInfo& theInfo,
TErr* theErr = NULL);
void
SetCellInfo(const MED::TCellInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
//! Read geom type of MED_BALL structural element
EGeometrieElement GetBallGeom(const TMeshInfo& theMeshInfo);
//! Read number of balls in the Mesh
virtual TInt GetNbBalls(const TMeshInfo& theMeshInfo);
//! Read a MEDWrapped representation of MED_BALL from the MED file
virtual void GetBallInfo(TBallInfo& theInfo, TErr* theErr = NULL);
//! Write a MEDWrapped representation of MED_BALL to the MED file
virtual void SetBallInfo(const TBallInfo& theInfo, TErr* theErr);
//! Write a MEDWrapped representation of MED_BALL to the MED file
void SetBallInfo(const TBallInfo& theInfo, EModeAcces theMode, TErr* theErr);
//----------------------------------------------------------------------------
virtual
TInt
GetNbFields(TErr* theErr = NULL);
virtual
TInt
GetNbComp(TInt theFieldId,
TErr* theErr = NULL);
virtual
void
GetFieldInfo(TInt theFieldId,
MED::TFieldInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetFieldInfo(const MED::TFieldInfo& theInfo,
TErr* theErr = NULL);
void
SetFieldInfo(const MED::TFieldInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TInt
GetNbGauss(TErr* theErr = NULL);
virtual
TGaussInfo::TInfo
GetGaussPreInfo(TInt theId,
TErr* theErr = NULL);
virtual
void
GetGaussInfo(TInt theId,
TGaussInfo& theInfo,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TInt
GetNbProfiles(TErr* theErr = NULL);
virtual
TProfileInfo::TInfo
GetProfilePreInfo(TInt theId,
TErr* theErr = NULL);
virtual
void
GetProfileInfo(TInt theId,
TProfileInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetProfileInfo(const TProfileInfo& theInfo,
TErr* theErr = NULL);
void
SetProfileInfo(const TProfileInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TInt
GetNbTimeStamps(const MED::TFieldInfo& theInfo,
const MED::TEntityInfo& theEntityInfo,
EEntiteMaillage& theEntity,
TGeom2Size& theGeom2Size,
TErr* theErr = NULL);
virtual
void
GetTimeStampInfo(TInt theTimeStampId,
MED::TTimeStampInfo& theInfo,
TErr* theErr = NULL);
virtual
void
GetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
const TMKey2Profile& theMKey2Profile,
const TKey2Gauss& theKey2Gauss,
TErr* theErr = NULL);
virtual
void
SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
TErr* theErr = NULL);
void
SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
void
GetGrilleInfo(TGrilleInfo& theGrilleInfo,
TErr* theErr = NULL);
virtual
void
SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
TErr* theErr = NULL);
void
SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
EModeAcces theMode,
TErr* theErr = NULL);
virtual
void
GetGrilleType(const MED::TMeshInfo& theMeshInfo,
EGrilleType& type,
TErr* theErr = NULL);
void
GetGrilleStruct(const MED::TMeshInfo& theMeshInfo,
TIntVector& theStruct,
TErr* theErr = NULL);
protected:
PFile myFile;
};
}
}
#endif

Some files were not shown because too many files have changed in this diff Show More