From: jfa Date: Tue, 14 Mar 2006 08:19:01 +0000 (+0000) Subject: Join modifications from branch V3_1_0_For_CCRT X-Git-Tag: T2_3_2_0a2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3bec735aad703bbfc01b774210bb3a7b5ba5b7f5;p=modules%2Fmed.git Join modifications from branch V3_1_0_For_CCRT --- diff --git a/build_configure b/build_configure index 8a0bacbd2..561a09d78 100755 --- a/build_configure +++ b/build_configure @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Tool for updating list of .in file for the SALOME project @@ -155,7 +155,7 @@ cat configure.in.base >> configure.in # make a link allowing AC_OUTPUT to find the salome_adm/.../*.in files echo "" >> configure.in_tmp1 -echo 'if test ${MED_WITH_KERNEL} == yes; then' >> configure.in_tmp1 +echo 'if test ${MED_WITH_KERNEL} = yes; then' >> configure.in_tmp1 echo ' ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/.' >> configure.in_tmp1 echo 'else' >> configure.in_tmp1 echo ' ln -fs ${ROOT_SRCDIR}/adm_local_without_kernel ${ROOT_SRCDIR}/salome_adm' >> configure.in_tmp1 @@ -177,7 +177,7 @@ echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1 echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1 echo " ])" >> configure.in_tmp1 echo "" >> configure.in_tmp1 -echo 'if test $MED_WITH_KERNEL == yes; then' >> configure.in_tmp1 +echo 'if test $MED_WITH_KERNEL = yes; then' >> configure.in_tmp1 echo "{" >> configure.in_tmp1 echo "AC_OUTPUT([ \\" >> configure.in_tmp1 echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1 diff --git a/configure.in.base b/configure.in.base index 4780640eb..0891d9967 100644 --- a/configure.in.base +++ b/configure.in.base @@ -39,13 +39,13 @@ dnl Update and re-run configure if there was build_configure --without-kernel dnl but configure --with-kernel=DIR is being called if test "x${old_with_kernel}" != "x${MED_WITH_KERNEL}"; then - if test "x${old_with_kernel}" == "xno" ; then + if test "x${old_with_kernel}" = "xno" ; then if test ! -d "${KERNEL_ROOT_DIR}"; then echo "failed : KERNEL_ROOT_DIR variable is not correct !" exit fi kernel_check_in_aclocal=`grep KERNEL_ROOT_DIR ${ROOT_SRCDIR}/aclocal.m4` - if test "x${kernel_check_in_aclocal}" == "x"; then + if test "x${kernel_check_in_aclocal}" = "x"; then echo "Configuration changed: without KERNEL -> with KERNEL" echo -n "Updating 'configure' script ... " cd $ROOT_SRCDIR @@ -71,7 +71,7 @@ dnl config.sub, config.guess are needed for AC_CANONICAL_HOST WITHOUT_KERNEL_CONFIG_DIR=${ROOT_SRCDIR}/adm_local_without_kernel/unix/config_files AUX_CONFIG_DIR="" -if test "${MED_WITH_KERNEL}" == "yes"; then +if test "${MED_WITH_KERNEL}" = "yes"; then AUX_CONFIG_DIR=${KERNEL_ROOT_DIR}/salome_adm/unix/config_files else AUX_CONFIG_DIR=${WITHOUT_KERNEL_CONFIG_DIR} @@ -142,8 +142,14 @@ dnl Fix up the INSTALL macro if it s a relative path. We want the dnl full-path to the binary instead. case "$INSTALL" in *install-sh*) - INSTALL="\${AUX_CONFIG_DIR}/install-sh -c" - ;; + case $host_os in + osf*) + INSTALL="${AUX_CONFIG_DIR}/install-sh -c" + ;; + *) + INSTALL="\${AUX_CONFIG_DIR}/install-sh -c" + ;; + esac esac echo @@ -165,12 +171,12 @@ cc_ok=yes dnl Library libdl : AC_CHECK_LIB(dl,dlopen) -dnl add library libm : -AC_CHECK_LIB(m,ceil) - dnl Library librt : for alpha/osf AC_CHECK_LIB(rt,nanosleep) +dnl add library libm : +AC_CHECK_LIB(m,ceil) + dnl dnl Check if we use std iostream by default or if we must add dnl a compiler directive for that @@ -195,47 +201,106 @@ AC_LINKER_OPTIONS echo echo --------------------------------------------- -echo testing LEX \& YACC +echo testing threads echo --------------------------------------------- echo -lex_yacc_ok=no -AC_PROG_YACC -AC_PROG_LEX -lex_yacc_ok=yes +ENABLE_PTHREADS + +dnl +dnl --------------------------------------------- +dnl testing WITHIHM +dnl --------------------------------------------- +dnl + +CHECK_WITHIHM echo echo --------------------------------------------- -echo testing python +echo BOOST Library echo --------------------------------------------- echo -CHECK_PYTHON +CHECK_BOOST + +dnl +dnl --------------------------------------------- +dnl testing sockets +dnl --------------------------------------------- +dnl + +CHECK_SOCKETS + +dnl +dnl --------------------------------------------- +dnl testing OpenPBS +dnl --------------------------------------------- +dnl echo echo --------------------------------------------- -echo testing swig +echo testing OpenPBS echo --------------------------------------------- echo -CHECK_SWIG +openpbs_ok=no +CHECK_OPENPBS +dnl openpbs_ok is set to yes by CHECK_OPENPBS + +dnl +dnl --------------------------------------------- +dnl testing LSF +dnl --------------------------------------------- +dnl echo echo --------------------------------------------- -echo testing threads +echo testing LSF echo --------------------------------------------- echo -ENABLE_PTHREADS +lsf_ok=no +CHECK_LSF +dnl lsf_ok is set to yes by CHECK_LSF + +dnl +dnl --------------------------------------------- +dnl testing Batch +dnl --------------------------------------------- +dnl + +WITH_BATCH=no +test x$openpbs_ok = xyes || test x$lsf_ok = xyes && WITH_BATCH=yes +AC_SUBST(WITH_BATCH) + +if test "X$WITHIHM" = "Xyes"; then + echo + echo --------------------------------------------- + echo testing LEX \& YACC + echo --------------------------------------------- + echo + + lex_yacc_ok=no + AC_PROG_YACC + AC_PROG_LEX + lex_yacc_ok=yes +fi -dnl BOOST is needed for MED Wrapper echo echo --------------------------------------------- -echo BOOST Library +echo testing python echo --------------------------------------------- echo -CHECK_BOOST +CHECK_PYTHON + +echo +echo --------------------------------------------- +echo testing swig +echo --------------------------------------------- +echo + +CHECK_SWIG echo echo --------------------------------------------- @@ -253,119 +318,122 @@ echo CHECK_MED2 +echo "MED_WITH_KERNEL ${MED_WITH_KERNEL}" -if test "${MED_WITH_KERNEL}" == "yes"; then +if test "${MED_WITH_KERNEL}" = "yes"; then { -#CPPFLAGS="$CPPFLAGS -DMED_WITH_KERNEL" -dnl echo -dnl echo --------------------------------------------- -dnl echo testing java -dnl echo --------------------------------------------- -dnl echo + dnl echo + dnl echo --------------------------------------------- + dnl echo testing java + dnl echo --------------------------------------------- + dnl echo -dnl CHECK_JAVA + dnl CHECK_JAVA -dnl -dnl --------------------------------------------- -dnl testing MPICH -dnl --------------------------------------------- -dnl + dnl + dnl --------------------------------------------- + dnl testing MPI + dnl --------------------------------------------- + dnl -CHECK_MPI -CHECK_MPICH + CHECK_MPI + CHECK_MPICH -dnl -dnl --------------------------------------------- -dnl testing WITHIHM -dnl --------------------------------------------- -dnl + echo + echo --------------------------------------------- + echo testing omniORB + echo --------------------------------------------- + echo -CHECK_WITHIHM + CHECK_OMNIORB -echo -echo --------------------------------------------- -echo testing omniORB -echo --------------------------------------------- -echo + echo + echo --------------------------------------------- + echo default ORB : omniORB + echo --------------------------------------------- + echo -CHECK_OMNIORB + DEFAULT_ORB=omniORB + CHECK_CORBA -echo -echo --------------------------------------------- -echo default ORB : omniORB -echo --------------------------------------------- -echo + AC_SUBST_FILE(CORBA) + corba=make_$ORB + CORBA=adm_local/unix/$corba -DEFAULT_ORB=omniORB -CHECK_CORBA -AC_SUBST_FILE(CORBA) -corba=make_$ORB -CORBA=adm_local/unix/$corba + echo + echo --------------------------------------------- + echo testing openGL + echo --------------------------------------------- + echo -echo -echo --------------------------------------------- -echo testing openGL -echo --------------------------------------------- -echo + CHECK_OPENGL -CHECK_OPENGL + echo + echo --------------------------------------------- + echo testing QT + echo --------------------------------------------- + echo -echo -echo --------------------------------------------- -echo testing QT -echo --------------------------------------------- -echo + CHECK_QT -CHECK_QT + if test "X$WITHIHM" = "Xyes"; then + echo + echo --------------------------------------------- + echo testing VTK + echo --------------------------------------------- + echo -echo -echo --------------------------------------------- -echo testing VTK -echo --------------------------------------------- -echo + CHECK_VTK + fi -CHECK_VTK + echo + echo --------------------------------------------- + echo Testing OpenCascade + echo --------------------------------------------- + echo -echo -echo --------------------------------------------- -echo Testing OpenCascade -echo --------------------------------------------- -echo + CHECK_CAS -CHECK_CAS + echo + echo --------------------------------------------- + echo Testing Kernel + echo --------------------------------------------- + echo -echo -echo --------------------------------------------- -echo Testing Kernel -echo --------------------------------------------- -echo + CHECK_KERNEL -CHECK_KERNEL + dnl echo + dnl echo --------------------------------------------- + dnl echo testing mico + dnl echo --------------------------------------------- + dnl echo -dnl echo -dnl echo --------------------------------------------- -dnl echo testing mico -dnl echo --------------------------------------------- -dnl echo + dnl CHECK_MICO -dnl CHECK_MICO + echo + echo --------------------------------------------- + echo testing MSG2QM + echo --------------------------------------------- + echo -echo -echo --------------------------------------------- -echo testing MSG2QM -echo --------------------------------------------- -echo + CHECK_MSG2QM + + echo + echo --------------------------------------------- + echo Testing html generators + echo --------------------------------------------- + echo -CHECK_MSG2QM + CHECK_HTML_GENERATORS } else { - WITHIHM="" - AC_SUBST(WITHIHM) - CPPFLAGS="$CPPFLAGS -DMED_WITHOUT_KERNEL" + WITHIHM="" + AC_SUBST(WITHIHM) + CPPFLAGS="$CPPFLAGS -DMED_WITHOUT_KERNEL" } fi # MED_WITH_KERNEL @@ -383,17 +451,39 @@ echo Summary echo --------------------------------------------- echo -if test "$MED_WITH_KERNEL" == "no"; then +if test "$MED_WITH_KERNEL" = "no"; then echo "Configure (without Kernel)" else echo Configure fi -variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok med2_ok boost_ok doxygen_ok graphviz_ok OpenGL_ok qt_ok vtk_ok omniORB_ok occ_ok Kernel_ok" +#variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok med2_ok boost_ok doxygen_ok graphviz_ok OpenGL_ok qt_ok vtk_ok omniORB_ok occ_ok Kernel_ok" + +if test "X$WITHIHM" = "Xyes"; then +variables="cc_ok lex_yacc_ok mpi_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok med2_ok omniORB_ok occ_ok sip_ok pyqt_ok qwt_ok Kernel_ok" +fi +if test "X$WITHIHM" = "Xno"; then +variables="cc_ok mpi_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok hdf5_ok med2_ok omniORB_ok occ_ok Kernel_ok" +fi + +for var in $variables +do + eval toto=\$$var + if test x$toto != "x"; then + printf " %10s : " `echo \$var | sed -e "s,_ok,,"` + eval echo \$$var + fi +done +echo "---Optional:" +variables="cppunit_ok openpbs_ok lsf_ok doxygen_ok graphviz_ok" + for var in $variables do - printf " %10s : " `echo \$var | sed -e "s,_ok,,"` - eval echo \$$var + eval toto=\$$var + if test x$toto != "x"; then + printf " %10s : " `echo \$var | sed -e "s,_ok,,"` + eval echo \$$var + fi done echo diff --git a/src/INTERPOLATION/MEDMEM_MappingTools.hxx b/src/INTERPOLATION/MEDMEM_MappingTools.hxx index eb31fe16b..b0e84f314 100644 --- a/src/INTERPOLATION/MEDMEM_MappingTools.hxx +++ b/src/INTERPOLATION/MEDMEM_MappingTools.hxx @@ -162,9 +162,10 @@ _TEMPLATE_SPE_ vector _COORDBARY_2D_::Calcule_Coord_Baryc(int num_maille { int i,j; // for PAL11458 + double zero = 0. ; //vector coord_baryc_M(3,0); int nbr_faces=coord_baryc[num_maille].size(); - vector coord_baryc_M(nbr_faces,0); + vector coord_baryc_M(nbr_faces,zero); for (i=0;isetPolyhedronIndex(tmp_PolyhedronIndex); + delete [] tmp_PolyhedronIndex ; + MED_EN::med_int * tmp_PolyhedronFacesIndex = new med_int[NumberOfFaces+1] ; + for ( i = 0 ; i < NumberOfFaces+1 ; i++ ) + tmp_PolyhedronFacesIndex[i] = PolyhedronFacesIndex[i] ; + _polyhedronNodal->setFacesIndex(tmp_PolyhedronFacesIndex); + delete [] tmp_PolyhedronFacesIndex ; + MED_EN::med_int * tmp_PolyhedronConnectivity = new med_int[ConnectivitySize] ; + for ( i = 0 ; i < ConnectivitySize ; i++ ) + tmp_PolyhedronConnectivity[i] = PolyhedronConnectivity[i] ; + _polyhedronNodal->setNodes(tmp_PolyhedronConnectivity); + delete [] tmp_PolyhedronConnectivity ; +#else _polyhedronNodal->setPolyhedronIndex(PolyhedronIndex); _polyhedronNodal->setFacesIndex(PolyhedronFacesIndex); _polyhedronNodal->setNodes(PolyhedronConnectivity); +#endif } else { @@ -746,16 +765,29 @@ const int* CONNECTIVITY::getPolyhedronConnectivity(medConnectivity ConnectivityT if (ConnectivityType == MED_NODAL) { ((CONNECTIVITY *)(this))->calculateNodalConnectivity(); - if (_polyhedronNodal != (POLYHEDRONARRAY*) NULL) + if (_polyhedronNodal != (POLYHEDRONARRAY*) NULL) { +//CCRT +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + int i ; + const MED_EN::med_int * tmp_PolyhedronConnectivity = _polyhedronNodal->getNodes(); + int * PolyhedronConnectivity = new int[_polyhedronNodal->getNumberOfNodes()] ; + for ( i = 0 ; i < _polyhedronNodal->getNumberOfNodes() ; i++ ) + PolyhedronConnectivity[i] = tmp_PolyhedronConnectivity[i] ; +//CCRT : return of a copy of PolyhedronConnectivity + return PolyhedronConnectivity ; +#else return _polyhedronNodal->getNodes(); +#endif + } else throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" : Polyhedron Nodal Connectivity not defined !")); } else { ((CONNECTIVITY *)(this))->calculateDescendingConnectivity(); - if (_polyhedronDescending != (MEDSKYLINEARRAY*) NULL) + if (_polyhedronDescending != (MEDSKYLINEARRAY*) NULL) { return _polyhedronDescending->getValue(); + } else throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" : Polyhedron Descending Connectivity not defined !")); } @@ -774,8 +806,20 @@ const int* CONNECTIVITY::getPolyhedronFacesIndex() const if (_entity == MED_CELL) //polyhedron can only be MED_CELL { // calculateNodalConnectivity(); - if (_polyhedronNodal != (POLYHEDRONARRAY*) NULL) + if (_polyhedronNodal != (POLYHEDRONARRAY*) NULL) { +//CCRT +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + int i ; + const MED_EN::med_int * tmp_PolyhedronFacesIndex = _polyhedronNodal->getFacesIndex(); + int * PolyhedronFacesIndex = new int[_polyhedronNodal->getNumberOfFaces()+1] ; + for ( i = 0 ; i < _polyhedronNodal->getNumberOfFaces()+1 ; i++ ) + PolyhedronFacesIndex[i] = tmp_PolyhedronFacesIndex[i] ; +//CCRT : return of a copy of PolyhedronFacesIndex + return PolyhedronFacesIndex ; +#else return _polyhedronNodal->getFacesIndex(); +#endif + } else throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" : No Polyhedron in that Connectivity !")); } @@ -795,8 +839,20 @@ const int* CONNECTIVITY::getPolyhedronIndex(medConnectivity ConnectivityType) co if (ConnectivityType == MED_NODAL) { // calculateNodalConnectivity(); - if (_polyhedronNodal != (POLYHEDRONARRAY*) NULL) + if (_polyhedronNodal != (POLYHEDRONARRAY*) NULL) { +//CCRT +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + int i ; + const MED_EN::med_int * tmp_PolyhedronIndex = _polyhedronNodal->getPolyhedronIndex(); + int * PolyhedronIndex = new int[_polyhedronNodal->getNumberOfPolyhedron()+1] ; + for ( i = 0 ; i < _polyhedronNodal->getNumberOfPolyhedron()+1 ; i++ ) + PolyhedronIndex[i] = tmp_PolyhedronIndex[i] ; +//CCRT : return of a copy of PolyhedronIndex + return PolyhedronIndex ; +#else return _polyhedronNodal->getPolyhedronIndex(); +#endif + } else throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" : Polyhedron Nodal Connectivity not defined !")); } @@ -1229,9 +1285,10 @@ void CONNECTIVITY::calculateDescendingConnectivity() _constituent->_numberOfTypes = 2; _constituent->_geometricTypes = new medGeometryElement[_constituent->_numberOfTypes]; _constituent->_type = new CELLMODEL[_constituent->_numberOfTypes]; - _constituent->_count = new med_int[_constituent->_numberOfTypes+1]; +//CCRT _constituent->_count = new med_int[_constituent->_numberOfTypes+1]; + _constituent->_count = new int[_constituent->_numberOfTypes+1]; _constituent->_count[0]=1; - int* tmp_NumberOfConstituentsForeachType = new med_int[_constituent->_numberOfTypes+1]; + med_int* tmp_NumberOfConstituentsForeachType = new med_int[_constituent->_numberOfTypes+1]; tmp_NumberOfConstituentsForeachType[0]=0; // to count constituent of each type for (int i=0; i<_constituent->_numberOfTypes;i++) { _constituent->_geometricTypes[i]=ConstituentsTypes[i]; @@ -1527,7 +1584,8 @@ void CONNECTIVITY::calculateDescendingConnectivity() int myNumberOfFaces = _polyhedronNodal->getPolyhedronIndex()[i+1]-_polyhedronNodal->getPolyhedronIndex()[i]; int myNumberOfNodes = _polyhedronNodal->getFacesIndex()[_polyhedronNodal->getPolyhedronIndex()[i+1]-1]-_polyhedronNodal->getFacesIndex()[_polyhedronNodal->getPolyhedronIndex()[i]-1]; POLYHEDRONARRAY myPolyhedra(1,myNumberOfFaces,myNumberOfNodes); - vector myFacesIndex(_polyhedronNodal->getFacesIndex() + _polyhedronNodal->getPolyhedronIndex()[i]-1, _polyhedronNodal->getFacesIndex() + _polyhedronNodal->getPolyhedronIndex()[i]-1 + myNumberOfFaces+1); +//CCRT vector myFacesIndex(_polyhedronNodal->getFacesIndex() + _polyhedronNodal->getPolyhedronIndex()[i]-1, _polyhedronNodal->getFacesIndex() + _polyhedronNodal->getPolyhedronIndex()[i]-1 + myNumberOfFaces+1); + vector myFacesIndex(_polyhedronNodal->getFacesIndex() + _polyhedronNodal->getPolyhedronIndex()[i]-1, _polyhedronNodal->getFacesIndex() + _polyhedronNodal->getPolyhedronIndex()[i]-1 + myNumberOfFaces+1); for (int j=myNumberOfFaces; j>=0; j--) myFacesIndex[j] -= myFacesIndex[0]-1; myPolyhedra.setFacesIndex(&myFacesIndex[0]); @@ -1536,7 +1594,24 @@ void CONNECTIVITY::calculateDescendingConnectivity() for (int j=0; j 0) { +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + int * tmp_PolyhedronIndex = new int[getNumberOfPolyhedron()+1] ; + const MED_EN::med_int * PolyhedronIndex = _polyhedronNodal->getPolyhedronIndex() ; + int ii ; + for ( ii = 0 ; ii < getNumberOfPolyhedron()+1 ; ii++ ) + tmp_PolyhedronIndex[ii] = PolyhedronIndex[ii] ; +//CCRT : copy of PolyhedronIndex + _polyhedronDescending = new MEDSKYLINEARRAY(getNumberOfPolyhedron(),_polyhedronNodal->getNumberOfFaces(),tmp_PolyhedronIndex,&PolyDescending[0]); // polyhedron index are the same for nodal and descending connectivities +#else _polyhedronDescending = new MEDSKYLINEARRAY(getNumberOfPolyhedron(),_polyhedronNodal->getNumberOfFaces(),_polyhedronNodal->getPolyhedronIndex(),&PolyDescending[0]); // polyhedron index are the same for nodal and descending connectivities +#endif if (_constituent->_polygonsNodal != NULL) delete [] _constituent->_polygonsNodal; diff --git a/src/MEDMEM/MEDMEM_DriverFactory.cxx b/src/MEDMEM/MEDMEM_DriverFactory.cxx index 64882d040..b75a172b6 100644 --- a/src/MEDMEM/MEDMEM_DriverFactory.cxx +++ b/src/MEDMEM/MEDMEM_DriverFactory.cxx @@ -39,12 +39,12 @@ using namespace MEDMEM; using namespace MED_EN; template<> -void fill<-1,0x3>(double *a, const double *b) +void MEDMEM::fill<-1,0x3>(double *a, const double *b) { } template<> -bool compare<-1>(const double *a, const double *b) +bool MEDMEM::compare<-1>(const double *a, const double *b) { return false; } diff --git a/src/MEDMEM/MEDMEM_GibiMeshDriver.cxx b/src/MEDMEM/MEDMEM_GibiMeshDriver.cxx index 21ccb6abb..269383e31 100644 --- a/src/MEDMEM/MEDMEM_GibiMeshDriver.cxx +++ b/src/MEDMEM/MEDMEM_GibiMeshDriver.cxx @@ -584,7 +584,7 @@ bool GIBI_MESH_RDONLY_DRIVER::readFile (_intermediateMED* medi, bool readFields // (2) CARACTERISTIQUES // (3) -15 317773 4 0 0 0 -2 0 3 // (4) 317581 - // (5) + // (5) 0 // (6) 317767 317761 317755 317815 // (7) YOUN NU H SIGY // (8) REAL*8 REAL*8 REAL*8 REAL*8 diff --git a/src/MEDMEM/MEDMEM_MedMedDriver22.cxx b/src/MEDMEM/MEDMEM_MedMedDriver22.cxx index 428ba8cdd..aec34b044 100644 --- a/src/MEDMEM/MEDMEM_MedMedDriver22.cxx +++ b/src/MEDMEM/MEDMEM_MedMedDriver22.cxx @@ -223,7 +223,8 @@ void MED_MED_RDONLY_DRIVER22::readFileStruct( void ) int numberOfMeshes; char meshName[MED_TAILLE_NOM+1]=""; char meshDescription[MED_TAILLE_DESC+1]=""; - int meshDim; +//CCRT int meshDim; + med_2_2::med_int meshDim; med_2_2::med_maillage meshType; MESH * ptrMesh; @@ -393,8 +394,10 @@ void MED_MED_RDONLY_DRIVER22::readFileStruct( void ) // char timeStepUnit[MED_TAILLE_PNOM]= ""; char timeStepUnit[MED_TAILLE_PNOM22+1] ; double timeStep = 0.0; - int orderNumber = -1; //???init????? - int numberOfRefMesh = 0; +//CCRT int orderNumber = -1; //???init????? + med_2_2::med_int orderNumber = -1; //???init????? +//CCRT int numberOfRefMesh = 0; + med_2_2::med_int numberOfRefMesh = 0; med_2_2::med_booleen meshLink; map & _meshes = _ptrMed->_meshes; map & _fields = _ptrMed->_fields; diff --git a/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx b/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx index eb8c8756c..f7e8a0143 100644 --- a/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx +++ b/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx @@ -255,7 +255,8 @@ void MED_MESH_RDONLY_DRIVER22::getGRID() { char meshName[MED_TAILLE_NOM+1]=""; char meshDescription[MED_TAILLE_DESC+1]=""; - int meshDim; +//CCRT int meshDim; + med_2_2::med_int meshDim; med_2_2::med_maillage meshType; err = med_2_2::MEDmaaInfo(_medIdt, (index+1),meshName, &meshDim, @@ -314,7 +315,8 @@ void MED_MESH_RDONLY_DRIVER22::getGRID() // if (gridType == MED_EN::MED_GRILLE_STANDARD) if (gridType == MED_EN::MED_BODY_FITTED) { - int * structure = new int[MeshDimension]; +//CCRT int * structure = new int[MeshDimension]; + med_int * structure = new med_int[MeshDimension]; err = med_2_2::MEDstructureCoordLire(_medIdt, const_cast @@ -489,7 +491,8 @@ int MED_MESH_RDONLY_DRIVER22::getCOORDINATE() { char meshName[MED_TAILLE_NOM+1]=""; char meshDescription[MED_TAILLE_DESC+1]=""; - int meshDim; +//CCRT int meshDim; + med_2_2::med_int meshDim; med_2_2::med_maillage meshType; err = med_2_2::MEDmaaInfo(_medIdt, (index+1), meshName, &meshDim, @@ -991,7 +994,8 @@ int MED_MESH_RDONLY_DRIVER22::getNodalConnectivity(CONNECTIVITY * Connectivity) NodalIndex[j]=NodalIndex[j-1]+NumberOfNodeByCell ; int tmp_numberOfCells = Connectivity->_count[i+1]-Connectivity->_count[i] ; - int * tmp_ConnectivityArray = new int[(NumberOfNodeByCell+multi)*tmp_numberOfCells]; +//CCRT int * tmp_ConnectivityArray = new int[(NumberOfNodeByCell+multi)*tmp_numberOfCells]; + med_2_2::med_int * tmp_ConnectivityArray = new med_2_2::med_int[(NumberOfNodeByCell+multi)*tmp_numberOfCells]; // int err=MEDconnLire(_medIdt,const_cast (_ptrMesh->_name.c_str()), // Connectivity->_entityDimension,tmp_ConnectivityArray, @@ -1112,15 +1116,18 @@ int MED_MESH_RDONLY_DRIVER22::getNodalConnectivity(CONNECTIVITY * Connectivity) int tmp_numberOfFaces = constituent->_count[i+1]-constituent->_count[i] ; // Il faut ajouter 1 pour le zero a la lecture !!! // ATTENTION UNIQUEMENT POUR MED < 2.2.x - int * tmp_constituentArray = NULL; +//CCRT int * tmp_constituentArray = NULL; + med_2_2::med_int * tmp_constituentArray = NULL; MESSAGE(LOC << "Med file version used here " << major << " " << minor << " " << release); if ((major == 2) && (minor <= 1)) - tmp_constituentArray = new int[(NumberOfNodeByFace+1)*tmp_numberOfFaces] ; +//CCRT tmp_constituentArray = new int[(NumberOfNodeByFace+1)*tmp_numberOfFaces] ; + tmp_constituentArray = new med_2_2::med_int[(NumberOfNodeByFace+1)*tmp_numberOfFaces] ; else if ((major == 2) && (minor >= 2)) { - tmp_constituentArray = new int[NumberOfNodeByFace*tmp_numberOfFaces] ; +//CCRT tmp_constituentArray = new int[NumberOfNodeByFace*tmp_numberOfFaces] ; + tmp_constituentArray = new med_2_2::med_int[NumberOfNodeByFace*tmp_numberOfFaces] ; MESSAGE(LOC<<": WE ARE USING MED2.2 so there is no +1 for calculating the size of tmp_constituentArray !") ; } @@ -1244,15 +1251,18 @@ int MED_MESH_RDONLY_DRIVER22::getNodalConnectivity(CONNECTIVITY * Connectivity) // Il faut ajouter 1 pour le zero a la lecture !!! // ATTENTION UNIQUEMENT POUR MED < 2.2.x - int * tmp_constituentArray = NULL; +//CCRT int * tmp_constituentArray = NULL; + med_2_2::med_int * tmp_constituentArray = NULL; MESSAGE(LOC << "Med file version used here " << major << " " << minor << " " << release); if ((major == 2) && (minor <= 1)) - tmp_constituentArray = new int[(NumberOfNodeByEdge+1)*tmp_numberOfEdges] ; +//CCRT tmp_constituentArray = new int[(NumberOfNodeByEdge+1)*tmp_numberOfEdges] ; + tmp_constituentArray = new med_2_2::med_int[(NumberOfNodeByEdge+1)*tmp_numberOfEdges] ; else if ((major == 2) && (minor >= 2)) { - tmp_constituentArray = new int[NumberOfNodeByEdge*tmp_numberOfEdges] ; +//CCRT tmp_constituentArray = new int[NumberOfNodeByEdge*tmp_numberOfEdges] ; + tmp_constituentArray = new med_2_2::med_int[NumberOfNodeByEdge*tmp_numberOfEdges] ; MESSAGE(LOC<<": WE ARE USING MED2.2 so there is no +1 for calculating the size of tmp_constituentArray !") ; } @@ -1381,13 +1391,41 @@ int MED_MESH_RDONLY_DRIVER22::getNodalConnectivity(CONNECTIVITY * Connectivity) return MED_ERROR; } - if (Connectivity->_entityDimension == 2) // 2D mesh : polygons in Connectivity + if (Connectivity->_entityDimension == 2) {// 2D mesh : polygons in Connectivity +//CCRT +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + int* tmp_PolygonsConnectivity = new int[ConnectivitySize]; + int i ; + for ( i = 0 ; i < ConnectivitySize ; i++ ) + tmp_PolygonsConnectivity[i] = PolygonsConnectivity[i] ; + int* tmp_PolygonsConnectivityIndex = new int[NumberOfPolygons+1]; + for ( i = 0 ; i < NumberOfPolygons+1 ; i++ ) + tmp_PolygonsConnectivityIndex[i] = PolygonsConnectivityIndex[i] ; + Connectivity->setPolygonsConnectivity(MED_NODAL,(medEntityMesh) Entity,tmp_PolygonsConnectivity,tmp_PolygonsConnectivityIndex,ConnectivitySize,NumberOfPolygons); + delete [] tmp_PolygonsConnectivity ; + delete [] tmp_PolygonsConnectivityIndex ; +#else Connectivity->setPolygonsConnectivity(MED_NODAL,(medEntityMesh) Entity,PolygonsConnectivity,PolygonsConnectivityIndex,ConnectivitySize,NumberOfPolygons); +#endif + } else if (Connectivity->_entityDimension == 3) { if (Connectivity->_constituent == NULL) // 3D mesh : polygons in Connectivity->_constituent Connectivity->_constituent = new CONNECTIVITY(MED_FACE); +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + int* tmp_PolygonsConnectivity = new int[ConnectivitySize]; + int i ; + for ( i = 0 ; i < ConnectivitySize ; i++ ) + tmp_PolygonsConnectivity[i] = PolygonsConnectivity[i] ; + int* tmp_PolygonsConnectivityIndex = new int[NumberOfPolygons+1]; + for ( i = 0 ; i < NumberOfPolygons+1 ; i++ ) + tmp_PolygonsConnectivityIndex[i] = PolygonsConnectivityIndex[i] ; + Connectivity->_constituent->setPolygonsConnectivity(MED_NODAL,MED_FACE,tmp_PolygonsConnectivity,tmp_PolygonsConnectivityIndex,ConnectivitySize,NumberOfPolygons); + delete [] tmp_PolygonsConnectivity ; + delete [] tmp_PolygonsConnectivityIndex ; +#else Connectivity->_constituent->setPolygonsConnectivity(MED_NODAL,MED_FACE,PolygonsConnectivity,PolygonsConnectivityIndex,ConnectivitySize,NumberOfPolygons); +#endif } delete[] PolygonsConnectivity; @@ -1448,7 +1486,25 @@ int MED_MESH_RDONLY_DRIVER22::getNodalConnectivity(CONNECTIVITY * Connectivity) return MED_ERROR; } +//CCRT +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + int* tmp_Nodes = new int[NumberOfNodes]; + int i ; + for ( i = 0 ; i < NumberOfNodes ; i++ ) + tmp_Nodes[i] = Nodes[i] ; + int* tmp_FacesIndex = new int[NumberOfFaces+1]; + for ( i = 0 ; i < NumberOfFaces+1 ; i++ ) + tmp_FacesIndex[i] = FacesIndex[i] ; + int* tmp_PolyhedronIndex = new int[NumberOfPolyhedron+1]; + for ( i = 0 ; i < NumberOfPolyhedron+1 ; i++ ) + tmp_PolyhedronIndex[i] = PolyhedronIndex[i] ; + Connectivity->setPolyhedronConnectivity(MED_NODAL,tmp_Nodes,tmp_PolyhedronIndex,NumberOfNodes,NumberOfPolyhedron,tmp_FacesIndex,NumberOfFaces); + delete[] tmp_Nodes; + delete[] tmp_FacesIndex; + delete[] tmp_PolyhedronIndex; +#else Connectivity->setPolyhedronConnectivity(MED_NODAL,Nodes,PolyhedronIndex,NumberOfNodes,NumberOfPolyhedron,FacesIndex,NumberOfFaces); +#endif delete[] Nodes; delete[] FacesIndex; @@ -1581,16 +1637,30 @@ int MED_MESH_RDONLY_DRIVER22::getFAMILY() for (int i=0;i + (_meshName.c_str()), + (i+1)); + int NumberOfAttributes = tmp_NumberOfAttributes ; +#else int NumberOfAttributes = med_2_2::MEDnAttribut(_medIdt, const_cast (_meshName.c_str()), (i+1)); +#endif if (NumberOfAttributes < 0) throw MEDEXCEPTION("MED_MESH_RDONLY_DRIVER22::getFAMILY() : NumberOfAttributes" ); +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + med_int tmp_NumberOfGroups = med_2_2::MEDnGroupe(_medIdt, const_cast + (_meshName.c_str()),(i+1)) ; + int NumberOfGroups = tmp_NumberOfGroups ; +#else int NumberOfGroups = med_2_2::MEDnGroupe(_medIdt, const_cast (_meshName.c_str()),(i+1)) ; +#endif if (NumberOfGroups < 0) throw MEDEXCEPTION("MED_MESH_RDONLY_DRIVER22::getFAMILY() : NumberOfGroups" ); @@ -1601,6 +1671,30 @@ int MED_MESH_RDONLY_DRIVER22::getFAMILY() int * AttributesValues = new int[NumberOfAttributes] ; string AttributesDescription(MED_TAILLE_DESC*NumberOfAttributes,' ') ; string GroupsNames(MED_TAILLE_LNOM*NumberOfGroups+1,'\0') ; +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + med_int tmp_FamilyIdentifier ; + med_int * tmp_AttributesIdentifier = new med_int[NumberOfAttributes] ; + med_int * tmp_AttributesValues = new med_int[NumberOfAttributes] ; + err = med_2_2::MEDfamInfo(_medIdt,const_cast + (_meshName.c_str()), + (i+1),const_cast + (FamilyName.c_str()), &tmp_FamilyIdentifier, + tmp_AttributesIdentifier,tmp_AttributesValues, + const_cast + (AttributesDescription.c_str()), + &tmp_NumberOfAttributes, const_cast + (GroupsNames.c_str()),&tmp_NumberOfGroups); + FamilyIdentifier = tmp_FamilyIdentifier ; + int ii ; + for ( ii = 0 ; ii < NumberOfAttributes ; ii++ ) { + AttributesIdentifier[ii] = tmp_AttributesIdentifier[ii] ; + AttributesValues[ii] = tmp_AttributesValues[ii] ; + } + NumberOfAttributes = tmp_NumberOfAttributes ; + NumberOfGroups = tmp_NumberOfGroups ; + delete [] tmp_AttributesIdentifier ; + delete [] tmp_AttributesValues ; +#else err = med_2_2::MEDfamInfo(_medIdt,const_cast (_meshName.c_str()), (i+1),const_cast @@ -1610,6 +1704,7 @@ int MED_MESH_RDONLY_DRIVER22::getFAMILY() (AttributesDescription.c_str()), &NumberOfAttributes, const_cast (GroupsNames.c_str()),&NumberOfGroups); +#endif SCRUTE(GroupsNames); @@ -1710,10 +1805,21 @@ int MED_MESH_RDONLY_DRIVER22::getNodesFamiliesNumber(int * MEDArrayNodeFamily) { int err = 0 ; +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + med_int * tmp_MEDArrayNodeFamily = new med_int[_ptrMesh->getNumberOfNodes()] ; + err = MEDfamLire(_medIdt, const_cast + (_ptrMesh->_name.c_str()), tmp_MEDArrayNodeFamily, + _ptrMesh->getNumberOfNodes(), med_2_2::MED_NOEUD, + (med_2_2::med_geometrie_element) MED_NONE); + int i ; + for ( i = 0 ; i < _ptrMesh->getNumberOfNodes() ; i++ ) + MEDArrayNodeFamily[i] = tmp_MEDArrayNodeFamily[i] ; +#else err = MEDfamLire(_medIdt, const_cast (_ptrMesh->_name.c_str()), MEDArrayNodeFamily, _ptrMesh->getNumberOfNodes(), med_2_2::MED_NOEUD, (med_2_2::med_geometrie_element) MED_NONE); +#endif if ( err != MED_VALID) throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "There is no family for the |"<< _ptrMesh->getNumberOfNodes() << "| nodes in mesh |" << _ptrMesh->_name.c_str() << "|")); @@ -1740,6 +1846,27 @@ int MED_MESH_RDONLY_DRIVER22::getCellsFamiliesNumber(int **MEDArrayFamily, for (i=0;igetNumberOfTypesWithPoly(Connectivity->_entity);i++) { int NumberOfCell=Connectivity->getNumberOfElementsWithPoly(Connectivity->_entity,types[i]); +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + med_2_2::med_int * tmp_MEDArrayFamily = new med_2_2::med_int[NumberOfCell] ; + err=MEDfamLire(_medIdt,const_cast (_ptrMesh->_name.c_str()), + tmp_MEDArrayFamily,NumberOfCell, + (med_2_2::med_entite_maillage) Connectivity->_entity, + (med_2_2::med_geometrie_element)types[i]); + if (err != MED_VALID) + { + err=MEDfamLire(_medIdt,const_cast + (_ptrMesh->_name.c_str()), + tmp_MEDArrayFamily,NumberOfCell, + med_2_2::MED_MAILLE, + (med_2_2::med_geometrie_element)types[i]); + if (err != MED_VALID) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Family not found for entity "<_entity<<" and geometric type "<_geometricTypes[i])); + } + int ii ; + for ( ii = 0 ; ii < NumberOfCell ; ii++ ) + MEDArrayFamily[i][ii] = tmp_MEDArrayFamily[ii] ; + delete [] tmp_MEDArrayFamily ; +#else err=MEDfamLire(_medIdt,const_cast (_ptrMesh->_name.c_str()), MEDArrayFamily[i],NumberOfCell, (med_2_2::med_entite_maillage) Connectivity->_entity, @@ -1754,6 +1881,7 @@ int MED_MESH_RDONLY_DRIVER22::getCellsFamiliesNumber(int **MEDArrayFamily, if (err != MED_VALID) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Family not found for entity "<_entity<<" and geometric type "<_geometricTypes[i])); } +#endif } delete [] types; return MED_VALID; @@ -1851,7 +1979,8 @@ void MED_MESH_WRONLY_DRIVER22::write(void) const err = med_2_2::MEDfamCr( _medIdt, const_cast ( _meshName.c_str() ), familyName, 0, - (int*)NULL, (int*)NULL, (char*)NULL, 0, +//CCRT (int*)NULL, (int*)NULL, (char*)NULL, 0, + (med_2_2::med_int*)NULL, (med_2_2::med_int*)NULL, (char*)NULL, 0, (char*)NULL, 0); SCRUTE(familyName); @@ -2009,7 +2138,8 @@ int MED_MESH_WRONLY_DRIVER22::writeGRID() const << "| and units |" << tmp_unit << " |")) ; - int* structure = new int [meshDimension]; +//CCRT int* structure = new int [meshDimension]; + med_2_2::med_int* structure = new med_2_2::med_int [meshDimension]; for (int idim = 0; idim < meshDimension; ++idim) structure[idim] = ArrayLen [idim]; @@ -2177,10 +2307,23 @@ int MED_MESH_WRONLY_DRIVER22::writeCoordinates() const { if (_ptrMesh->_arePresentOptionnalNodesNumbers==1) { +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + const int * NodesNumbers = _ptrMesh->_coordinate->getNodesNumbers() ; + med_2_2::med_int * tmp_NodesNumbers = new med_int[_ptrMesh->_numberOfNodes] ; + int ii ; + for ( ii = 0 ; ii < _ptrMesh->_numberOfNodes ; ii++ ) + tmp_NodesNumbers[ii] = NodesNumbers[ii] ; + err = MEDnumEcr(_medIdt, const_cast (_meshName.c_str()), + tmp_NodesNumbers , + _ptrMesh->_numberOfNodes, med_2_2::MED_NOEUD, + med_2_2::med_geometrie_element(0) ); + delete [] tmp_NodesNumbers ; +#else err = MEDnumEcr(_medIdt, const_cast (_meshName.c_str()), const_cast (_ptrMesh->_coordinate->getNodesNumbers() ), _ptrMesh->_numberOfNodes, med_2_2::MED_NOEUD, med_2_2::med_geometrie_element(0) ); +#endif if (err != MED_VALID) throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't write optionnal numbers of mesh |" << @@ -2233,7 +2376,8 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const // if ( (types[i]/ 100) < _ptrMesh->_spaceDimension) // multi=1 ; int numberOfNodes = types[i]%100 ; - int * connectivityArray = new int[numberOfElements*(numberOfNodes+multi)]; +//CCRT int * connectivityArray = new int[numberOfElements*(numberOfNodes+multi)]; + med_2_2::med_int * connectivityArray = new med_2_2::med_int[numberOfElements*(numberOfNodes+multi)]; // version originale sans prise en compte des numéros optionnels // @@ -2306,6 +2450,26 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const // Polygons writing if (_ptrMesh->existPolygonsConnectivity(MED_NODAL,entity)) { +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + med_2_2::med_int * tmp_PolygonsConnectivityIndex = new med_2_2::med_int[_ptrMesh->getNumberOfPolygons()+1] ; + const int * PolygonsConnectivityIndex = _ptrMesh->getPolygonsConnectivityIndex(MED_NODAL,entity) ; + int ii ; + for ( ii = 0 ; ii < _ptrMesh->getNumberOfPolygons()+1 ; ii++ ) + tmp_PolygonsConnectivityIndex[ii] = PolygonsConnectivityIndex[ii] ; + med_2_2::med_int * tmp_PolygonsConnectivity = new med_2_2::med_int[_ptrMesh->getNumberOfPolygons()+1] ; + const int * PolygonsConnectivity = _ptrMesh->getPolygonsConnectivity(MED_NODAL,entity) ; + for ( ii = 0 ; ii < _ptrMesh->getNumberOfPolygons()+1 ; ii++ ) + tmp_PolygonsConnectivity[ii] = PolygonsConnectivity[ii] ; + err = MEDpolygoneConnEcr(_medIdt, + const_cast (_meshName.c_str()), + tmp_PolygonsConnectivityIndex, + _ptrMesh->getNumberOfPolygons()+1, + tmp_PolygonsConnectivity, + (med_2_2::med_entite_maillage) entity, + med_2_2::MED_NOD); + delete [] tmp_PolygonsConnectivityIndex ; + delete [] tmp_PolygonsConnectivity ; +#else err = MEDpolygoneConnEcr(_medIdt, const_cast (_meshName.c_str()), const_cast (_ptrMesh->getPolygonsConnectivityIndex(MED_NODAL,entity)), @@ -2313,6 +2477,7 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const const_cast (_ptrMesh->getPolygonsConnectivity(MED_NODAL,entity)), (med_2_2::med_entite_maillage) entity, med_2_2::MED_NOD); +#endif if (err<0) throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't write polygons nodal connectivities of mesh |" << _meshName.c_str() << "| in file |" << _fileName @@ -2324,6 +2489,32 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const // Polyhedron writing if (_ptrMesh->existPolyhedronConnectivity(MED_NODAL,entity)) { +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + med_2_2::med_int * tmp_PolyhedronIndex = new med_2_2::med_int[_ptrMesh->getNumberOfPolyhedron()+1] ; + const int * PolyhedronIndex = _ptrMesh->getPolyhedronIndex(MED_NODAL) ; + int ii ; + for ( ii = 0 ; ii < _ptrMesh->getNumberOfPolyhedron()+1 ; ii++ ) + tmp_PolyhedronIndex[ii] = PolyhedronIndex[ii] ; + med_2_2::med_int * tmp_PolyhedronFacesIndex = new med_2_2::med_int[_ptrMesh->getNumberOfPolyhedronFaces()+1] ; + const int * PolyhedronFacesIndex = _ptrMesh->getPolyhedronFacesIndex() ; + for ( ii = 0 ; ii < _ptrMesh->getNumberOfPolyhedronFaces()+1 ; ii++ ) + tmp_PolyhedronFacesIndex[ii] = PolyhedronFacesIndex[ii] ; + med_2_2::med_int * tmp_PolyhedronConnectivity = new med_2_2::med_int[_ptrMesh->getNumberOfPolyhedronFaces()+1] ; + const int * PolyhedronConnectivity = _ptrMesh->getPolyhedronConnectivity(MED_NODAL) ; + for ( ii = 0 ; ii < _ptrMesh->getNumberOfPolyhedronFaces()+1 ; ii++ ) + tmp_PolyhedronConnectivity[ii] = PolyhedronConnectivity[ii] ; + err = MEDpolyedreConnEcr(_medIdt, + const_cast (_meshName.c_str()), + tmp_PolyhedronIndex, + _ptrMesh->getNumberOfPolyhedron()+1, + tmp_PolyhedronFacesIndex, + _ptrMesh->getNumberOfPolyhedronFaces()+1, + tmp_PolyhedronConnectivity, + med_2_2::MED_NOD); + delete [] tmp_PolyhedronIndex ; + delete [] tmp_PolyhedronFacesIndex ; + delete [] tmp_PolyhedronConnectivity ; +#else err = MEDpolyedreConnEcr(_medIdt, const_cast (_meshName.c_str()), const_cast (_ptrMesh->getPolyhedronIndex(MED_NODAL)), @@ -2332,6 +2523,7 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const _ptrMesh->getNumberOfPolyhedronFaces()+1, const_cast (_ptrMesh->getPolyhedronConnectivity(MED_NODAL)), med_2_2::MED_NOD); +#endif if (err<0) throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't write polyhedron nodal connectivities of mesh |" << _meshName.c_str() << "| in file |" << _fileName @@ -2365,6 +2557,22 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const // (MED_FR::med_geometrie_element) types[i], // MED_FR::MED_DESC ); +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + med_2_2::med_int * tmp_Connectivity = new med_2_2::med_int[numberOfElements] ; + int ii ; + for ( ii = 0 ; ii < numberOfElements ; ii++ ) + tmp_Connectivity[ii] = connectivity[ii] ; + err = med_2_2::MEDconnEcr(_medIdt, + const_cast ( _meshName.c_str()), + _ptrMesh->_spaceDimension, + tmp_Connectivity, + med_2_2::MED_FULL_INTERLACE, + numberOfElements, + (med_2_2::med_entite_maillage ) entity, + (med_2_2::med_geometrie_element) types[i], + med_2_2::MED_DESC ); + delete [] tmp_Connectivity ; +#else err = med_2_2::MEDconnEcr(_medIdt, const_cast ( _meshName.c_str()), _ptrMesh->_spaceDimension, @@ -2374,6 +2582,7 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const (med_2_2::med_entite_maillage ) entity, (med_2_2::med_geometrie_element) types[i], med_2_2::MED_DESC ); +#endif if (err<0) // ETENDRE LES EXPLICATIONS throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't write connectivities of mesh |" << _meshName.c_str() << "| in file |" << _fileName @@ -2387,6 +2596,26 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const // Polygons writing if (_ptrMesh->existPolygonsConnectivity(MED_DESCENDING,entity)) { +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + med_2_2::med_int * tmp_PolygonsConnectivityIndex = new med_2_2::med_int[_ptrMesh->getNumberOfPolygons()+1] ; + const int * PolygonsConnectivityIndex = _ptrMesh->getPolygonsConnectivityIndex(MED_DESCENDING,entity) ; + int ii ; + for ( ii = 0 ; ii < _ptrMesh->getNumberOfPolygons()+1 ; ii++ ) + tmp_PolygonsConnectivityIndex[ii] = PolygonsConnectivityIndex[ii] ; + med_2_2::med_int * tmp_PolygonsConnectivity = new med_2_2::med_int[_ptrMesh->getNumberOfPolygons()+1] ; + const int * PolygonsConnectivity = _ptrMesh->getPolygonsConnectivity(MED_DESCENDING,entity) ; + for ( ii = 0 ; ii < _ptrMesh->getNumberOfPolygons()+1 ; ii++ ) + tmp_PolygonsConnectivity[ii] = PolygonsConnectivity[ii] ; + err = MEDpolygoneConnEcr(_medIdt, + const_cast (_meshName.c_str()), + tmp_PolygonsConnectivityIndex, + _ptrMesh->getNumberOfPolygons()+1, + tmp_PolygonsConnectivity, + (med_2_2::med_entite_maillage) entity, + med_2_2::MED_DESC); + delete [] tmp_PolygonsConnectivityIndex ; + delete [] tmp_PolygonsConnectivity ; +#else err = MEDpolygoneConnEcr(_medIdt, const_cast (_meshName.c_str()), const_cast (_ptrMesh->getPolygonsConnectivityIndex(MED_DESCENDING,entity)), @@ -2394,6 +2623,7 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const const_cast (_ptrMesh->getPolygonsConnectivity(MED_DESCENDING,entity)), (med_2_2::med_entite_maillage) entity, med_2_2::MED_DESC); +#endif if (err<0) throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't write polygons descending connectivities of mesh |" << _meshName.c_str() << "| in file |" << _fileName @@ -2408,6 +2638,27 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const med_int NumberOfFaces = _ptrMesh->getPolyhedronIndex(MED_DESCENDING)[_ptrMesh->getNumberOfPolyhedron()]-1; vector FacesGeometricTypes(NumberOfFaces,MED_POLYGON); // by default all polyhedron faces are polygons +#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) + med_2_2::med_int * tmp_PolyhedronIndex = new med_2_2::med_int[_ptrMesh->getNumberOfPolyhedron()+1] ; + const int * PolyhedronIndex = _ptrMesh->getPolyhedronIndex(MED_DESCENDING) ; + int ii ; + for ( ii = 0 ; ii < _ptrMesh->getNumberOfPolyhedron()+1 ; ii++ ) + tmp_PolyhedronIndex[ii] = PolyhedronIndex[ii] ; + med_2_2::med_int * tmp_PolyhedronConnectivity = new med_2_2::med_int[_ptrMesh->getNumberOfPolyhedronFaces()+1] ; + const int * PolyhedronConnectivity = _ptrMesh->getPolyhedronConnectivity(MED_DESCENDING) ; + for ( ii = 0 ; ii < _ptrMesh->getNumberOfPolyhedronFaces()+1 ; ii++ ) + tmp_PolyhedronConnectivity[ii] = PolyhedronConnectivity[ii] ; + err = MEDpolyedreConnEcr(_medIdt, + const_cast (_meshName.c_str()), + tmp_PolyhedronIndex, + _ptrMesh->getNumberOfPolyhedron()+1, + &FacesGeometricTypes[0], + NumberOfFaces, + tmp_PolyhedronConnectivity, + med_2_2::MED_DESC); + delete [] tmp_PolyhedronIndex ; + delete [] tmp_PolyhedronConnectivity ; +#else err = MEDpolyedreConnEcr(_medIdt, const_cast (_meshName.c_str()), const_cast (_ptrMesh->getPolyhedronIndex(MED_DESCENDING)), @@ -2416,6 +2667,7 @@ int MED_MESH_WRONLY_DRIVER22::writeConnectivities(medEntityMesh entity) const NumberOfFaces, const_cast (_ptrMesh->getPolyhedronConnectivity(MED_DESCENDING)), med_2_2::MED_DESC); +#endif if (err<0) throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't write polyhedron descending connectivities of mesh |" << _meshName.c_str() << "| in file |" << _fileName @@ -2441,7 +2693,8 @@ int MED_MESH_WRONLY_DRIVER22::writeFamilyNumbers() const { // We build the array from the families list objects : int NumberOfNodes = _ptrMesh->getNumberOfNodes() ; - int * MEDArrayNodeFamily = new int[NumberOfNodes] ; +//CCRT int * MEDArrayNodeFamily = new int[NumberOfNodes] ; + med_2_2::med_int * MEDArrayNodeFamily = new med_2_2::med_int[NumberOfNodes] ; // family 0 by default for (int i=0; i ( _meshName.c_str() ), temp+typeCount[i]-1,typeCount[i+1]-typeCount[i], - med_2_2::MED_REMP , +//CCRT med_2_2::MED_REMP , (med_2_2::med_entite_maillage) entity, (med_2_2::med_geometrie_element) types[i] ); @@ -2578,9 +2831,10 @@ int MED_MESH_WRONLY_DRIVER22::writeFamilyNumbers() const { << "| cells of geometric type |" << geoNames[types[i]] <<"|in mesh |" << _ptrMesh->_name.c_str() << "|" )); } -#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) - delete [] temp; -#endif +//CCRT Clutter +//CCRT#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) +//CCRT delete [] temp; +//CCRT#endif delete[] MEDArrayFamily ; //if (true == ToDestroy) { // int NumberOfFamilies = myFamilies->size(); @@ -2636,12 +2890,13 @@ int MED_MESH_WRONLY_DRIVER22::writeFamilyNumbers() const { } const int * typeCount = _ptrMesh->getGlobalNumberingIndex(entity) ; -#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) - int lgth=numberOfElements; - med_2_2::med_int *temp=new med_2_2::med_int[lgth]; - for(int i2=0;i2_name.c_str() << "|" )); } +//CCRT there was "temp" for OSF and "familyArray" for Linux ... #if defined(IRIX64) || defined(OSF1) || defined(VPP5000) delete [] temp; -#endif +//CCRT#endif +#else delete[] familyArray ; +#endif //if (true == ToDestroy) { // int NumberOfFamilies = myFamilies->size(); // for (int i=0; igetTypes (entity) ; int numberOfElements = _ptrMesh->getNumberOfElements(entity, MED_ALL_ELEMENTS) ; - int * familyArray = new int[numberOfElements] ; +//CCRT int * familyArray = new int[numberOfElements] ; + med_2_2::med_int * familyArray = new med_2_2::med_int[numberOfElements] ; for (int i=0;igetGlobalNumberingIndex(entity) ; -#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) - int lgth=numberOfElements; - med_2_2::med_int *temp=new med_2_2::med_int[lgth]; - for(int i2=0;i2_name.c_str() << "|" )); } -#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) - delete [] temp; -#endif +//CCRT : clutter : +//CCRT#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) +//CCRT delete [] temp; +//CCRT#endif delete[] familyArray ; //if (true == ToDestroy) { // int NumberOfFamilies = myFamilies->size(); diff --git a/src/MEDMEM/MEDMEM_PolyhedronArray.cxx b/src/MEDMEM/MEDMEM_PolyhedronArray.cxx index f8956af93..466aee083 100644 --- a/src/MEDMEM/MEDMEM_PolyhedronArray.cxx +++ b/src/MEDMEM/MEDMEM_PolyhedronArray.cxx @@ -17,8 +17,9 @@ // // See http://www.salome-platform.org/ // -using namespace std; #include "MEDMEM_PolyhedronArray.hxx" + +using namespace std; using namespace MEDMEM; using MED_EN::med_int; diff --git a/src/MEDMEM/Makefile.in b/src/MEDMEM/Makefile.in index 7a6e4b67b..401566816 100644 --- a/src/MEDMEM/Makefile.in +++ b/src/MEDMEM/Makefile.in @@ -177,8 +177,8 @@ LDFLAGSFORBIN+=-lm $(MED2_LIBS) $(HDF5_LIBS) -lmed_V2_1 ifeq ($(MED_WITH_KERNEL),yes) CPPFLAGS+= -I${KERNEL_ROOT_DIR}/include/salome CXXFLAGS+= -I${KERNEL_ROOT_DIR}/include/salome - LDFLAGS+= -lSALOMELocalTrace -L${KERNEL_ROOT_DIR}/lib/salome - LDFLAGSFORBIN+= -lSALOMELocalTrace -lSALOMEBasics -L${KERNEL_ROOT_DIR}/lib/salome + LDFLAGS+= -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace + LDFLAGSFORBIN+= -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace -lSALOMEBasics endif LIBSFORBIN= diff --git a/src/MEDMEM/test_MEDMEM_PolyConnectivity.cxx b/src/MEDMEM/test_MEDMEM_PolyConnectivity.cxx index bfc08d661..2cdb88bea 100644 --- a/src/MEDMEM/test_MEDMEM_PolyConnectivity.cxx +++ b/src/MEDMEM/test_MEDMEM_PolyConnectivity.cxx @@ -33,33 +33,40 @@ int main(void) //POLYGONS const med_int NumberOfPolygons = 2; const med_int ConnectivitySize = 12; - med_int PolygonsConnectivityIndex[NumberOfPolygons+1] = {1,7,13}; +//CCRT med_int PolygonsConnectivityIndex[NumberOfPolygons+1] = {1,7,13}; + int PolygonsConnectivityIndex[NumberOfPolygons+1] = {1,7,13}; //Nodal - med_int PolygonsNodalConnectivity[ConnectivitySize] = {1,2,3,4,5,10,10,5,6,7,8,9}; +//CCRT med_int PolygonsNodalConnectivity[ConnectivitySize] = {1,2,3,4,5,10,10,5,6,7,8,9}; + int PolygonsNodalConnectivity[ConnectivitySize] = {1,2,3,4,5,10,10,5,6,7,8,9}; myNodalConnectivity.setPolygonsConnectivity(MED_NODAL,MED_CELL,PolygonsNodalConnectivity,PolygonsConnectivityIndex,ConnectivitySize,NumberOfPolygons); //Descending - med_int PolygonsDescendingConnectivity[ConnectivitySize] = {1,2,3,4,11,10,11,5,6,7,8,9}; +//CCRT med_int PolygonsDescendingConnectivity[ConnectivitySize] = {1,2,3,4,11,10,11,5,6,7,8,9}; + int PolygonsDescendingConnectivity[ConnectivitySize] = {1,2,3,4,11,10,11,5,6,7,8,9}; myDescendingConnectivity.setPolygonsConnectivity(MED_DESCENDING,MED_CELL,PolygonsDescendingConnectivity,PolygonsConnectivityIndex,ConnectivitySize,NumberOfPolygons); //POLYHEDRON const med_int NumberOfPolyhedron = 2; - med_int PolyhedronIndex[NumberOfPolyhedron+1] = {1,10,20}; +//CCRT med_int PolyhedronIndex[NumberOfPolyhedron+1] = {1,10,20}; + int PolyhedronIndex[NumberOfPolyhedron+1] = {1,10,20}; //Nodal const med_int NumberOfFaces = 19; const med_int NumberOfNodes = 74; - med_int PolyhedronFacesIndex[NumberOfFaces+1] = {1,7,11,15,19,23,27,31,34,39,44,48,52,55,58,61,64,68,72,75}; - med_int PolyhedronNodalConnectivity[NumberOfNodes] = {1,2,3,4,5,6,1,7,8,2,2,8,9,3,4,3,9,10,5,4,10,11,6,5,11,12,1,6,12,7,7,12,8,10,9,8,12,11,13,14,15,3,2,13,2,8,16,14,13,16,17,15,14,17,15,17,18,15,18,9,3,15,9,2,3,9,8,8,9,17,16,9,18,17}; +//CCRT med_int PolyhedronFacesIndex[NumberOfFaces+1] = {1,7,11,15,19,23,27,31,34,39,44,48,52,55,58,61,64,68,72,75}; + int PolyhedronFacesIndex[NumberOfFaces+1] = {1,7,11,15,19,23,27,31,34,39,44,48,52,55,58,61,64,68,72,75}; +//CCRT med_int PolyhedronNodalConnectivity[NumberOfNodes] = {1,2,3,4,5,6,1,7,8,2,2,8,9,3,4,3,9,10,5,4,10,11,6,5,11,12,1,6,12,7,7,12,8,10,9,8,12,11,13,14,15,3,2,13,2,8,16,14,13,16,17,15,14,17,15,17,18,15,18,9,3,15,9,2,3,9,8,8,9,17,16,9,18,17}; + int PolyhedronNodalConnectivity[NumberOfNodes] = {1,2,3,4,5,6,1,7,8,2,2,8,9,3,4,3,9,10,5,4,10,11,6,5,11,12,1,6,12,7,7,12,8,10,9,8,12,11,13,14,15,3,2,13,2,8,16,14,13,16,17,15,14,17,15,17,18,15,18,9,3,15,9,2,3,9,8,8,9,17,16,9,18,17}; myNodalConnectivity.setPolyhedronConnectivity(MED_NODAL,PolyhedronNodalConnectivity,PolyhedronIndex,NumberOfNodes,NumberOfPolyhedron,PolyhedronFacesIndex,NumberOfFaces); //Descending const med_int DescendingConnectivitySize = 19; - med_int PolyhedronDescendingConnectivity[DescendingConnectivitySize] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,3,17,18}; +//CCRT med_int PolyhedronDescendingConnectivity[DescendingConnectivitySize] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,3,17,18}; + int PolyhedronDescendingConnectivity[DescendingConnectivitySize] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,3,17,18}; myDescendingConnectivity.setPolyhedronConnectivity(MED_DESCENDING,PolyhedronDescendingConnectivity,PolyhedronIndex,DescendingConnectivitySize,NumberOfPolyhedron); diff --git a/src/MEDMEM_I/Makefile.in b/src/MEDMEM_I/Makefile.in index 3634a9e47..e95ff91df 100644 --- a/src/MEDMEM_I/Makefile.in +++ b/src/MEDMEM_I/Makefile.in @@ -66,7 +66,7 @@ LDFLAGSFORBIN= -L$(top_builddir)/lib/salome CPPFLAGS+= $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CXXFLAGS+= -I${KERNEL_ROOT_DIR}/include/salome -LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -lmedmem -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace -lSalomeCommunication -lSalomeGenericObj +LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -lmedmem -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace -lSalomeCommunication -lSalomeGenericObj #LDFLAGS+=-lmedmem -L. -lSalomeContainer -lSalomeNS -lRegistry -lOpUtil -lSalomeNotification # does we put only -lSalomeContainer and compiler retrieves -lSalomeNS -lRegistry -lOpUtil ????