From: vsr Date: Thu, 9 Aug 2012 11:52:00 +0000 (+0000) Subject: Merge from V6_main_20120808 08Aug12 X-Git-Tag: V7_0_0~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=922619aad64bf90317b241a166222674263995ce;p=plugins%2Fghs3dprlplugin.git Merge from V6_main_20120808 08Aug12 --- diff --git a/AUTHORS b/AUTHORS index d59af62..c92da15 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,6 +16,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- # # File : AUTHORS diff --git a/ChangeLog b/ChangeLog index 2d8966e..bc79b5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,6 +16,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- # # File : ChangeLog diff --git a/GHS3DPRLPLUGIN_version.h.in b/GHS3DPRLPLUGIN_version.h.in index 76ecf03..b9bbf78 100644 --- a/GHS3DPRLPLUGIN_version.h.in +++ b/GHS3DPRLPLUGIN_version.h.in @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : GHS3DPRLPLUGIN_version.h // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -// // --- - +// #if !defined(__GHS3DPRLPLUGIN_VERSION_H__) #define __GHS3DPRLPLUGIN_VERSION_H__ @@ -32,5 +31,6 @@ #define GHS3DPRLPLUGIN_VERSION_STR "@VERSION@" #define GHS3DPRLPLUGIN_VERSION @XVERSION@ +#define GHS3DPRLPLUGIN_DEVELOPMENT @VERSION_DEV@ #endif // __GHS3DPRLPLUGIN_VERSION_H__ diff --git a/INSTALL b/INSTALL index 827ab1b..0d2e0c5 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,6 +16,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- # # File : INSTALL diff --git a/Makefile.am b/Makefile.am index 5a82da2..9391fff 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am if GHS3DPRLPLUGIN_ENABLE_GUI @@ -40,11 +39,11 @@ else !GHS3DPRLPLUGIN_ENABLE_GUI -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files endif -SUBDIRS = idl adm_local resources src bin +SUBDIRS = idl adm_local resources src bin doc -DIST_SUBDIRS = idl adm_local resources src bin +DIST_SUBDIRS = idl adm_local resources src bin doc -DISTCLEANFILES = a.out aclocal.m4 configure +DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh hack_libtool salomeinclude_DATA = GHS3DPRLPLUGIN_version.h diff --git a/NEWS b/NEWS index 4c13d67..d22503a 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,6 +16,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- # # File : NEWS diff --git a/adm_local/Makefile.am b/adm_local/Makefile.am index 6516664..4e47880 100644 --- a/adm_local/Makefile.am +++ b/adm_local/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am SUBDIRS = unix diff --git a/adm_local/unix/Makefile.am b/adm_local/unix/Makefile.am index 386058f..55a47ce 100644 --- a/adm_local/unix/Makefile.am +++ b/adm_local/unix/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am SUBDIRS = config_files diff --git a/adm_local/unix/config_files/Makefile.am b/adm_local/unix/config_files/Makefile.am index 52d567c..faadda9 100644 --- a/adm_local/unix/config_files/Makefile.am +++ b/adm_local/unix/config_files/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am dist_admlocalm4_DATA = \ diff --git a/adm_local/unix/config_files/check_GHS3DPRL.m4 b/adm_local/unix/config_files/check_GHS3DPRL.m4 index 604d3be..1ccd67a 100755 --- a/adm_local/unix/config_files/check_GHS3DPRL.m4 +++ b/adm_local/unix/config_files/check_GHS3DPRL.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,6 +16,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- # # File : check_GHS3DPRL.m4 diff --git a/adm_local/unix/config_files/check_GHS3DPRLPLUGIN.m4 b/adm_local/unix/config_files/check_GHS3DPRLPLUGIN.m4 index 5b9fbb8..3105f0e 100755 --- a/adm_local/unix/config_files/check_GHS3DPRLPLUGIN.m4 +++ b/adm_local/unix/config_files/check_GHS3DPRLPLUGIN.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,6 +16,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- # # File : check_GHS3DPRLPLUGIN.m4 diff --git a/adm_local/unix/make_common_starter.am b/adm_local/unix/make_common_starter.am index 1ea9fb9..fabd7a0 100644 --- a/adm_local/unix/make_common_starter.am +++ b/adm_local/unix/make_common_starter.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,13 +16,19 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : make_common_starter.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- +# ============================================================ +# The following is to avoid PACKAGE_... env variable +# redefinition compilation warnings +# ============================================================ # +AM_CXXFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h +AM_CPPFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h + # ============================================================ # This file defines the common definitions used in several # Makefile. This file must be included, if needed, by the file diff --git a/bin/Makefile.am b/bin/Makefile.am index 7839332..24e249a 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am # non-distributed files diff --git a/bin/VERSION.in b/bin/VERSION.in index e3551b5..ac37cb2 100755 --- a/bin/VERSION.in +++ b/bin/VERSION.in @@ -1 +1,3 @@ -THIS IS SALOME - GHS3DPRLPLUGIN VERSION: @VERSION@ +[SALOME GHS3DPRLPLUGIN] : @VERSION@ +[DEVELOPMENT] : @VERSION_DEV@ +[DESCRIPTION] : DISTENE TetGen-GHS3d parallel meshing plug-in for SALOME Mesh module diff --git a/build_cmake b/build_cmake new file mode 100755 index 0000000..d2f451a --- /dev/null +++ b/build_cmake @@ -0,0 +1,27 @@ +#!/bin/sh +# Copyright (C) 2007-2012 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 +# + +CURRENT_DIR=`pwd` +CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"` +cd ${CONF_DIR} +python $KERNEL_ROOT_DIR/salome_adm/cmake_files/am2cmake.py --ghs3dprlplugin +status=$? +cd ${CURRENT_DIR} +exit $status diff --git a/build_cmake.bat b/build_cmake.bat new file mode 100644 index 0000000..6533456 --- /dev/null +++ b/build_cmake.bat @@ -0,0 +1,20 @@ +@REM Copyright (C) 2007-2012 CEA/DEN, EDF R&D +@REM +@REM This library is free software; you can redistribute it and/or +@REM modify it under the terms of the GNU Lesser General Public +@REM License as published by the Free Software Foundation; either +@REM version 2.1 of the License. +@REM +@REM This library is distributed in the hope that it will be useful, +@REM but WITHOUT ANY WARRANTY; without even the implied warranty of +@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +@REM Lesser General Public License for more details. +@REM +@REM You should have received a copy of the GNU Lesser General Public +@REM License along with this library; if not, write to the Free Software +@REM Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +@REM +@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +@REM + +%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --ghs3dprlplugin diff --git a/build_configure b/build_configure index c0fa009..1b0e6de 100755 --- a/build_configure +++ b/build_configure @@ -1,6 +1,5 @@ #!/bin/bash - -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -18,16 +17,14 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : build_configure # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# ORIG_DIR=`pwd` CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"` -GHS3DPRLPLUGIN_WITH_GUI="yes" ######################################################################## # Test if the KERNEL_ROOT_DIR is set correctly @@ -44,28 +41,6 @@ fi # exit #fi -for option -do - case $option in - -with-gui | --with-gui) - GHS3DPRLPLUGIN_WITH_GUI="yes" - break;; - -without-gui | --without-gui | -with-gui=no | --with-gui=no) - GHS3DPRLPLUGIN_WITH_GUI="no" - break;; - esac -done - -######################################################################## -# Test if the GUI_ROOT_DIR is set correctly - -if test ${GHS3DPRLPLUGIN_WITH_GUI} = yes; then - if test ! -d "${GUI_ROOT_DIR}"; then - echo "failed : GUI_ROOT_DIR variable is not correct !" - exit - fi -fi - ######################################################################## # Test if the MED_ROOT_DIR is set correctly @@ -94,40 +69,17 @@ cd ${CONF_DIR} ABS_CONF_DIR=`pwd` ####################################################################### -# Update configure.ac script: to set GHS3DPRLPLUGIN_WITH_GUI variable -sed -e s/GHS3DPRLPLUGIN_WITH_GUI=[a-z]*/GHS3DPRLPLUGIN_WITH_GUI=${GHS3DPRLPLUGIN_WITH_GUI}/g configure.ac > configure.tmp -mv -f configure.tmp configure.ac - -mkdir -p salome_adm/unix/config_files -#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files -#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix - -cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix - -#cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files -#cp -f ${MED_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files -#cp -f ${GEOM_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files -#cp -f ${SMESH_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files - -# remove KERNEL deprecated configure files -#for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \ -# check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \ -# check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing -# do -# rm -f salome_adm/unix/config_files/${deprecated} -# done - # ____________________________________________________________________ # aclocal creates the aclocal.m4 file from the standard macro and the -# custom macro embedded in the directory salome_adm/unix/config_files +# custom macro embedded in the directory adm_local/unix/config_files # and KERNEL config_files directory. # output: # aclocal.m4 # autom4te.cache (directory) -echo "====================================================== aclocal" +echo "======================================================= aclocal" -if test ${GHS3DPRLPLUGIN_WITH_GUI} = yes; then +if test -d "${GUI_ROOT_DIR}"; then aclocal -I adm_local/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ @@ -148,10 +100,10 @@ fi # version. The files are created in the directory specified with the # AC_CONFIG_AUX_DIR() tag (see configure.ac). # output: -# salome_adm/unix/config_files/config.guess -# salome_adm/unix/config_files/config.sub -# salome_adm/unix/config_files/ltmain.sh -#echo "====================================================== libtoolize" +# adm_local/unix/config_files/config.guess +# adm_local/unix/config_files/config.sub +# adm_local/unix/config_files/ltmain.sh +echo "==================================================== libtoolize" libtoolize --force --copy --automake || exit 1 @@ -171,11 +123,11 @@ autoconf # AC_CONFIG_AUX_DIR() tag (see configure.ac). This step also # creates the Makefile.in files from the Makefile.am files. # output: -# salome_adm/unix/config_files/compile -# salome_adm/unix/config_files/depcomp -# salome_adm/unix/config_files/install-sh -# salome_adm/unix/config_files/missing -# salome_adm/unix/config_files/py-compile +# adm_local/unix/config_files/compile +# adm_local/unix/config_files/depcomp +# adm_local/unix/config_files/install-sh +# adm_local/unix/config_files/missing +# adm_local/unix/config_files/py-compile # Makefile.in (from Makefile.am) echo "====================================================== automake" diff --git a/clean_configure b/clean_configure index 9f42b6d..9997669 100755 --- a/clean_configure +++ b/clean_configure @@ -1,6 +1,5 @@ #!/bin/bash - -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -18,23 +17,17 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : clean_configure # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# rm -rf autom4te.cache aclocal.m4 configure make_config find . -name "*~" -print -exec rm {} \; find . -name "*.pyc" -print -exec rm {} \; # ... -find bin -name Makefile.in | xargs rm -f -find doc -name Makefile.in | xargs rm -f -find idl -name Makefile.in | xargs rm -f -find resources -name Makefile.in | xargs rm -f -find salome_adm -name Makefile.in | xargs rm -f -find src -name Makefile.in | xargs rm -f -rm -f Makefile.in +find . -name Makefile.in | xargs rm -f +( cd adm_local/unix/config_files && rm -f config.* depcomp install-sh ltmain.sh missing py-compile ) diff --git a/configure.ac b/configure.ac index 23af624..e5bd0bc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,5 @@ #!/bin/bash - -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -18,21 +17,22 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : configure.ac # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - -AC_INIT([Salome2 Project GHS3DPRLPLUGIN module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeGHS3DPRLPLUGIN]) -AC_CONFIG_AUX_DIR(salome_adm/unix/config_files) +# +AC_INIT([Salome2 Project GHS3DPRLPLUGIN module], [6.5.0], [webmaster.salome@opencascade.com], [SalomeGHS3DPRLPLUGIN]) +AC_CONFIG_AUX_DIR(adm_local/unix/config_files) AC_CANONICAL_HOST AC_CANONICAL_TARGET -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([-Wno-portability]) XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'` AC_SUBST(XVERSION) +VERSION_DEV=1 +AC_SUBST(VERSION_DEV) # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.) MODULE_NAME=ghs3dprlplugin @@ -74,6 +74,7 @@ echo AC_PROG_MAKE_SET AC_PROG_INSTALL +AC_LOCAL_INSTALL dnl dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques ! @@ -95,7 +96,7 @@ 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='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh + INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh ;; esac @@ -155,7 +156,15 @@ dnl testing MPICH dnl --------------------------------------------- dnl -CHECK_MPICH +dnl CHECK_MPICH + +echo +echo --------------------------------------------- +echo testing MPI +echo --------------------------------------------- +echo + +CHECK_MPI echo echo --------------------------------------------- @@ -231,11 +240,34 @@ AC_SUBST_FILE(CORBA) corba=make_$ORB CORBA=adm_local/unix/$corba -GHS3DPRLPLUGIN_WITH_GUI=yes +echo +echo --------------------------------------------- +echo Testing GUI +echo --------------------------------------------- +echo + +CHECK_GUI_MODULE -AM_CONDITIONAL(GHS3DPRLPLUGIN_ENABLE_GUI, [test "${GHS3DPRLPLUGIN_WITH_GUI}" = "yes"]) +gui_ok=no +if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then + gui_ok=yes +fi -if test "${GHS3DPRLPLUGIN_WITH_GUI}" = "yes"; then +AM_CONDITIONAL(GHS3DPRLPLUGIN_ENABLE_GUI, [test "${gui_ok}" = "yes"]) + +if test "${SalomeGUI_need}" == "yes"; then + if test "${FullGUI_ok}" != "yes"; then + AC_MSG_WARN(For configure GHS3DPRLPLUGIN module necessary full GUI!) + fi +elif test "${SalomeGUI_need}" == "auto"; then + if test "${FullGUI_ok}" != "yes"; then + AC_MSG_WARN(Full GUI not found. Build will be done without GUI!) + fi +elif test "${SalomeGUI_need}" == "no"; then + echo Build without GUI option has been chosen +fi + +if test "${gui_ok}" = "yes"; then echo echo --------------------------------------------- echo testing openGL @@ -251,35 +283,15 @@ if test "${GHS3DPRLPLUGIN_WITH_GUI}" = "yes"; then echo CHECK_QT +fi - echo - echo --------------------------------------------- - echo testing VTK - echo --------------------------------------------- - echo - - CHECK_VTK - - echo - echo --------------------------------------------- - echo Testing GUI - echo --------------------------------------------- - echo - - CHECK_SALOME_GUI - - echo - echo --------------------------------------------- - echo Testing full GUI - echo --------------------------------------------- - echo +echo +echo --------------------------------------------- +echo testing VTK +echo --------------------------------------------- +echo - CHECK_CORBA_IN_GUI - if test "x${CORBA_IN_GUI}" != "xyes"; then - echo "failed : For configure GHS3DPRLPLUGIN module necessary full GUI !" - exit - fi -fi +CHECK_VTK echo echo --------------------------------------------- @@ -362,13 +374,15 @@ echo #AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"]) -if test "${GHS3DPRLPLUGIN_WITH_GUI}" = "yes"; then -variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok SMesh_ok SalomeGUI_ok libxml_ok" -opt_variables="GHS3DPRL_ok" -fi -if test "${GHS3DPRLPLUGIN_WITH_GUI}" = "no"; then -variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok SMesh_ok libxml_ok" -opt_variables="GHS3DPRL_ok" +if test "${gui_ok}" = "yes"; then + variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok SMesh_ok gui_ok libxml_ok" + opt_variables="GHS3DPRL_ok" +elif test "${SalomeGUI_need}" != "no"; then + variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok SMesh_ok gui_ok libxml_ok" + opt_variables="GHS3DPRL_ok" +else + variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok SMesh_ok libxml_ok" + opt_variables="GHS3DPRL_ok" fi echo @@ -419,23 +433,42 @@ echo # chmod +x ./bin/salome/*; #]) +AC_HACK_LIBTOOL +AC_CONFIG_COMMANDS([hack_libtool],[ +sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\ + $(pwd)/hack_libtool \1 \"\$[@]\" \n\ +}\n\ +CC=\"hack_libtool\"%g" libtool +sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool +sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool +sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1 if ! test -d \$sss; then continue; fi\n\1 ssss=\$(cd \$sss; pwd)\n\1 if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1 case \$ssss in\n\1 /usr/lib | /usr/lib64 ) ;;\n\1 * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1 esac\n\1 fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool +],[]) + # This list is initiated using autoscan and must be updated manually # when adding a new file .in to manage. When you execute # autoscan, the Makefile list is generated in the output file configure.scan. # This could be helpfull to update de configuration. AC_OUTPUT([ \ - ./salome_adm/unix/SALOMEconfig.h \ - ./adm_local/Makefile \ - ./adm_local/unix/Makefile \ - ./adm_local/unix/config_files/Makefile \ - ./bin/VERSION \ - ./bin/Makefile \ - ./idl/Makefile \ - ./resources/Makefile \ - ./src/Makefile \ - ./src/GHS3DPRLPlugin/Makefile \ - ./src/gui/Makefile \ - ./src/tepal2med/Makefile \ - ./GHS3DPRLPLUGIN_version.h \ + adm_local/Makefile \ + adm_local/unix/Makefile \ + adm_local/unix/config_files/Makefile \ + bin/VERSION \ + bin/Makefile \ + idl/Makefile \ + resources/Makefile \ + doc/Makefile \ + doc/salome/Makefile \ + doc/salome/gui/Makefile \ + doc/salome/gui/GHS3DPRLPLUGIN/Makefile \ + doc/salome/gui/GHS3DPRLPLUGIN/doxyfile \ + doc/salome/gui/GHS3DPRLPLUGIN/static/header.html \ + doc/salome/gui/GHS3DPRLPLUGIN/doxyfile_py \ + doc/salome/gui/GHS3DPRLPLUGIN/static/header_py.html \ + src/Makefile \ + src/GHS3DPRLPlugin/Makefile \ + src/gui/Makefile \ + src/tepal2med/Makefile \ + src/tools/Makefile \ + GHS3DPRLPLUGIN_version.h \ Makefile \ ]) diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..395d3aa --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,24 @@ +# Copyright (C) 2007-2012 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 +# +SUBDIRS = salome + +usr_docs: + (cd salome && $(MAKE) $(AM_MAKEFLAGS) usr_docs) + +docs: usr_docs \ No newline at end of file diff --git a/doc/salome/Makefile.am b/doc/salome/Makefile.am new file mode 100644 index 0000000..15038d3 --- /dev/null +++ b/doc/salome/Makefile.am @@ -0,0 +1,28 @@ +# Copyright (C) 2007-2012 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 +# + +SUBDIRS = gui +SUBDIRSGUI = gui + +usr_docs: + @@SETX@; for d in $(SUBDIRSGUI); do \ + (cd $$d && $(MAKE) $@) || exit 1; \ + done; + +docs: usr_docs \ No newline at end of file diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/Makefile.am b/doc/salome/gui/GHS3DPRLPLUGIN/Makefile.am new file mode 100755 index 0000000..ef5f90d --- /dev/null +++ b/doc/salome/gui/GHS3DPRLPLUGIN/Makefile.am @@ -0,0 +1,62 @@ +# Copyright (C) 2007-2012 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 + +EXTRA_DIST += images input static/footer.html static/doxygen.css + +guidocdir = $(docdir)/gui/GHS3DPRLPLUGIN +guidoc_DATA = images/head.png + + +usr_docs: doxyfile + echo "===========================================" ; \ + echo "Generating Python interface documentation"; \ + echo "===========================================" ; \ + $(DOXYGEN) doxyfile_py \ + echo "===========================================" ; \ + echo "Generating GUI documentation" ; \ + echo "===========================================" ; \ + $(DOXYGEN) doxyfile ; + +docs: usr_docs + +clean-local: + @for filen in `find . -maxdepth 1` ; do \ + case $${filen} in \ + ./Makefile | ./doxyfile | ./doxyfile_py ) ;; \ + . | .. | ./static ) ;; \ + *) echo "Removing $${filen}" ; rm -rf $${filen} ;; \ + esac ; \ + done ; + +install-data-local: usr_docs + $(INSTALL) -d $(DESTDIR)$(docdir)/gui/GHS3DPRLPLUGIN + @for filen in `find . -maxdepth 1` ; do \ + case $${filen} in \ + ./Makefile | ./doxyfile | ./doxyfile_py ) ;; \ + ./doxyfile.bak | ./doxyfile_py.bak ) ;; \ + . | .. | ./static ) ;; \ + *) echo "Installing $${filen}" ; cp -rp $${filen} $(DESTDIR)$(docdir)/gui/GHS3DPRLPLUGIN ;; \ + esac ; \ + done ; + cp -rp $(srcdir)/images/head.png $(DESTDIR)$(docdir)/gui/GHS3DPRLPLUGIN/ghs3dprlpluginpy_doc/ ; + +uninstall-local: + rm -rf $(DESTDIR)$(docdir)/gui/GHS3DPRLPLUGIN + diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile.in b/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile.in new file mode 100755 index 0000000..51cfcb8 --- /dev/null +++ b/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile.in @@ -0,0 +1,80 @@ +# Copyright (C) 2007-2012 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 +# + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "SALOME GHS3DPRLPLUGIN User's Guide" +OUTPUT_DIRECTORY = . +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +TAB_SIZE = 5 + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES + +#--------------------------------------------------------------------------- +#Input related options +#--------------------------------------------------------------------------- +INPUT = @srcdir@/input +FILE_PATTERNS = *.doc +EXCLUDE = +IMAGE_PATH = @srcdir@/images +EXAMPLE_PATH = + +#--------------------------------------------------------------------------- +#HTML related options +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = . +HTML_HEADER = @builddir@/static/header.html +HTML_FOOTER = @srcdir@/static/footer.html +HTML_STYLESHEET = @srcdir@/static/doxygen.css +TOC_EXPAND = YES +DISABLE_INDEX = NO +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 300 + +#--------------------------------------------------------------------------- +#SORT related options +#--------------------------------------------------------------------------- +SORT_GROUP_NAMES = NO + + +#--------------------------------------------------------------------------- +#LaTeX related option +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +EXTRA_PACKAGES = amsmath + +#--------------------------------------------------------------------------- +#RTF related options +#--------------------------------------------------------------------------- +GENERATE_RTF = NO + +#--------------------------------------------------------------------------- +#External reference options +#--------------------------------------------------------------------------- +#rnv: 07.04.2011 Workaround for the doxygen 1.7.3: +#because it wrongly defines location of the html files for search. +TAGFILES = ghs3dprlpluginpy_doc.tag=../GHS3DPRLPLUGIN/ghs3dprlpluginpy_doc +SEARCHENGINE = YES \ No newline at end of file diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile_py.in b/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile_py.in new file mode 100755 index 0000000..a085321 --- /dev/null +++ b/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile_py.in @@ -0,0 +1,159 @@ +# Copyright (C) 2007-2012 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 +# + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "SALOME GHS3DPRLPLUGIN User's Guide" +OUTPUT_DIRECTORY = . +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = YES +FULL_PATH_NAMES = NO +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 5 +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = YES +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = YES +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +MAX_INITIALIZER_LINES = 25 +SHOW_USED_FILES = NO +SHOW_DIRECTORIES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +EXCLUDE_SYMLINKS = NO +EXAMPLE_RECURSIVE = NO + +#--------------------------------------------------------------------------- +#Input related options +#--------------------------------------------------------------------------- +INPUT = @top_srcdir@/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py +FILE_PATTERNS = +IMAGE_PATH = @srcdir@/images +RECURSIVE = NO +EXAMPLE_PATH = + +#--------------------------------------------------------------------------- +#HTML related options +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = ghs3dprlpluginpy_doc +HTML_HEADER = @builddir@/static/header_py.html +HTML_FOOTER = @srcdir@/static/footer.html +HTML_STYLESHEET = @srcdir@/static/doxygen.css +TOC_EXPAND = YES +DISABLE_INDEX = NO +GENERATE_TREEVIEW = NO + +#--------------------------------------------------------------------------- +#LaTeX related option +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO + +#--------------------------------------------------------------------------- +#RTF related options +#--------------------------------------------------------------------------- +GENERATE_RTF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +HIDE_UNDOC_RELATIONS = NO +HAVE_DOT = NO +CLASS_GRAPH = NO +COLLABORATION_GRAPH = NO +GROUP_GRAPHS = NO +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = NO +INCLUDED_BY_GRAPH = NO +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = NO +DIRECTORY_GRAPH = NO +DOT_IMAGE_FORMAT = jpg +DOT_FONTNAME = Arial +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1200 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = NO +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +#External reference options +#--------------------------------------------------------------------------- +GENERATE_TAGFILE = ghs3dprlpluginpy_doc.tag +SEARCHENGINE = YES \ No newline at end of file diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/images/ghs3dprl_parameters_basic.png b/doc/salome/gui/GHS3DPRLPLUGIN/images/ghs3dprl_parameters_basic.png new file mode 100644 index 0000000..0628058 Binary files /dev/null and b/doc/salome/gui/GHS3DPRLPLUGIN/images/ghs3dprl_parameters_basic.png differ diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/images/head.png b/doc/salome/gui/GHS3DPRLPLUGIN/images/head.png new file mode 100755 index 0000000..307d9ef Binary files /dev/null and b/doc/salome/gui/GHS3DPRLPLUGIN/images/head.png differ diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/images/image2.gif b/doc/salome/gui/GHS3DPRLPLUGIN/images/image2.gif new file mode 100755 index 0000000..1983513 Binary files /dev/null and b/doc/salome/gui/GHS3DPRLPLUGIN/images/image2.gif differ diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/input/ghs3dprl_hypo.doc b/doc/salome/gui/GHS3DPRLPLUGIN/input/ghs3dprl_hypo.doc new file mode 100644 index 0000000..a7f69df --- /dev/null +++ b/doc/salome/gui/GHS3DPRLPLUGIN/input/ghs3dprl_hypo.doc @@ -0,0 +1,471 @@ +/*! + +\page ghs3dprl_hypo_page GHS3DPRL Parameters hypothesis + +\n GHS3DPRL Parameters hypothesis works only with Tetrahedron (Tepal with TetMesh-GHS3D) algorithm. +This algorithm is a commercial software, its use requires a licence (http://www.distene.com/fr/build/offer.html). +\n Tepal_V1.4 gives the possibility to generate a partitioned +mesh with 200 million tetrahedrons on a computer with average memory size +(2Go RAM) in about 50 hours on one CPU (Xeon, 2008). +\n New Tepal_V2.0 gives the possibility to generate a partitioned mesh with (for the moment) no more than 100 million +tetrahedrons on computers using MPI, (Total 16 Go RAM) +in about 900 seconds (!yes! : !seconds!) on 2 octo processors (Xeon, 2009). +The launch of this beta-version is described below. +\n This is a serious alternative to GHS3D, which requires a much less common +configuration with 64Go RAM to only try to make a partition of a mesh with +200 million tetrahedrons, no result guaranteed. +\n +\note The Plugin doesn't load in the Memory the supposedly large resulting meshes. +The meshes are saved in MED files and can be imported in the user-defined location via menu File-Import-MED Files. +\n Pay attention, that Salome GUI needs 2Go RAM to load a MED +file with 5 million tetrahedrons. + +\image html ghs3dprl_parameters_basic.png + +
    +
  • +Name - allows to define the name of the hypothesis (GHS3DPRL Parameters by default). +
  • +
  • +MED_Name - allows to define the path and the prefix of the +resulting MED files ("DOMAIN" by default). +If the path is not defined, the environment variable $SALOME_TMP_DIR +is used. If $SALOME_TMP_DIR is not defined as well, the environment +variable $TMP is used. +
  • +
  • +Nb_Part - allows to define the number of generated MED files. +The initial skin (triangles) will be meshed (tetrahedrons) and partitioned +in Nb_Part by the elementary algorithm implemented in Tepal.
    +
  • +
  • +Keep_Files - if this box is checked, input files of Tepal +(GHS3DPRL.points and GHS3DPRL.faces) are not deleted after use (...if the +background mode was not used). +
  • +
  • +Tepal_in_Background - if this box is checked, Tepal execution +and MED file generation are launched in background mode and the user +can even exit Salome. Pay attention that in this case Tepal algorithm works +independently of "killSalome.py", and sometimes on another host. +
  • +
  • +To_Mesh_Holes - if this box is checked, the parameter component +of tetmesh-ghs3d will mesh holes. +
  • + +

    Modifying GHS3DPRL Advanced Parameters


    +GHS3DPRL Plugin launches a standalone binary executable tepal2med.
    +tepal2med launches tepal, waits for the end of computation, and +converts the resulting output tepal files into MED files.
    +Some advanced optional parameters are accessible as arguments.
    + +If keep_files option is checked, it is possible to re-launch tepal2med +or tepal in the Terminal as a command with custom parameters.
    + +
  • +Advanced tepal2med Parameters - type "tepal2med --help" in the Terminal.

    + +\verbatim +myname@myhost > /export/home/myname/salome_5/GHS3DPRLPLUGIN_5/bin/salome/tepal2med --help +Available options: + --help : produces this help message + --casename : path and name of input tepal2med files which are + - output files of tepal .msg .noboite .faces .points .glo + - output file of GHS3DPRL_Plugin casename_skin.med (optional) + with initial skin and its initial groups + --number : number of partitions + --medname : path and name of output MED files + --limitswap : max size of working cpu memory (Mo) (before swapping on .temp files) + --verbose : trace of execution (0->6) + --test : more tests about joints, before generation of output files + --menu : a GUI menu for option number + --launchtepal : also launch tepal on files casename.faces and casename.points and option number + --meshholes : force parameter component of tetmesh-ghs3d to mesh holes + --background : force background mode from launch tepal and generation of final MED files (big meshes) + --deletegroups : regular expression (see QRegExp) which matches unwanted groups in final MED files + (try --deletegroups="(\bAll_Nodes|\bAll_Faces)" + (try --deletegroups="((\bAll_|\bNew_)(N|F|T))" +example: + tepal2med --casename=/tmp/GHS3DPRL --number=2 --medname=DOMAIN --limitswap=1000 + --verbose=0 --test=yes --menu=no --launchtepal=no + +\endverbatim +\n +

  • +
  • +Advanced Tepal_V1.4 Parameters

    + +\verbatim + +USAGE : tepal options + +With options : + --filename name (-f name) : + Prefix of the input case (MANDATORY) + + --ndom n (-n n) : + Number of subdomains to make (MANDATORY) + + --ghs3d ghs3d options (-g ghs3d options) : + Runs temesh ghs3d on a previously generated subdomain. (ghs3d options must be "quoted") + + --memory m (-m m) : + Max amount of memory (megabytes) allowed for ghs in the cutting process. (default is 0 : unlimited) + + --mesh_only (-Z ) : + Only (re)meshes all subdomains and updates communications messages + + --mesh_call command (-c command) : + Calls the user specified command for meshing all the + subomains after their skin has been generated + + --stats_only (-S ) : + Only computes and shows some statistics on subdomains + + --rebuild (-r ) : + Merges final subdomains skins + + --rebuild_tetra (-R ) : + Merges final subdomains skins and tetraedra + + --rebuild_iface (-i ) : + Includes interfaces in final subdomains merge + + --rebuild_retag (-t ) : + Tags vertices, faces (and tetra if selected) with their + subdomain number in the final merge of subdomains (keeps the lowest tag for shared elements) + + --rebuild_ensight_parts (-e ) : + Builds ensight geom file with parts + + --tetmesh_args str (-G str) : + Arguments to pass to Tetmesh during cutting process + +\endverbatim +\n +

  • +
  • +Advanced ghs3d Parameters (through Tepal_V1.4's --tetmesh_args) - type "ghs3d -h" in a Terminal.

    + +\verbatim +myname@myhost > ghs3d -h + +USE + /export/home/myname/ghs3d-4.0/DISTENE/Tools/TetMesh-GHS3D4.0/bin/Linux/ghs3dV4.0 + [-u] [-m memory>] [-M MEMORY] [-f prefix] [-v verbose] + [-c component] [-p0] [-C] [-E count] [-t] [-o level] + [-I filetype] [-a/-b] [-O n m] + +DESCRIPTION + + -u (-h) : prints this message. + + -m memory : launches the software with memory in Megabytes. + The default value of this parameter is 64 Megabytes and its + minimum value is 10 Megabytes. + It is also possible to set this parameter with the + environment variable GHS3D_MEMORY by means of an operation + equivalent to: + setenv GHS3D_MEMORY memory, + the value specified in the command line has the priority on + the environment variable. + + -M MEMORY : provides the automatic memory adjustment feature. + If MEMORY (in Megabytes) is equal to zero, the size of the work space is + calculated from the input. If MEMORY is not equal to + zero, the software starts with MEMORY amount of work space. + The software reallocates memory as necessary. + The start value of MEMORY can range from 0 to 64 Megabytes, + the maximum depends on -m option and the actual memory available. + + -f prefix : defines the generic prefix of the files. + + -v verbose : sets the output level parameter (the verbose parameter + must be in the range 0 to 10). + + -c component : chooses the meshed component. If the parameter is + 0, all components will be meshed, if + 1, only the main (outermost) component will be meshed + + -p0 : disables creation of internal points. + + -C : uses an alternative boundary recovery mechanism. It should be used only + when the standard boundary recovery fails. + + -E count : sets the extended output for error messages. If -E is used, + the error messages will be printed, it is possible + to indicate the maximum number of printed messages between 1 and 100. + + -t : generates an error file prefix.Log + + -o level : sets the required optimisation level. + Valid optimisation levels are: + none, light, standard or strong, + with increase of "quality vs speed" ratio. + + -I filetype : defines the input mesh format as follows: + -IP input files are ascii files, named prefix.points + and prefix.faces - this is the default type of files + -IPb input files are binary files, named prefix.pointsb + and prefix.facesb + -IM input file is ascii file, named prefix.mesh + where prefix is defined with -f option + + -a/-b : selects the output file type: + -a for ascii (the default) and + -b for binary. + + -On : saves a NOPO file in addition. NOPO is the mesh data + structure of the Simail and Modulef software packages. + -Om : saves a mesh file in addition. + -Omn : saves both NOPO and mesh files. + + ============================================================================== + TETMESH-GHS3D SOFTWARE 4.0-3 (December, 2006) + END OF SESSION + COPYRIGHT (C)1989-2006 INRIA ALL RIGHTS RESERVED + ============================================================================== + ( Distene SAS + Phone: +33(0)1-69-26-62-10 Fax: +33(0)1-69-26-90-33 + EMail: support@distene.com ) + +\endverbatim +\n +

  • +

    Saving user's preferred GHS3DPRL Advanced Parameters


    +GHS3DPRL Plugin launches standalone binary executable tepal2med.
    +You may rename file tepal2med as tepal2med.exe for example, and replace +tepal2med by a shell script at your convenience to overriding parameters. +
    ... or else $PATH modification... .
    Idem for file tepal.

    +
  • +Advanced tepal2med Parameters - overriding parameter deletegroups

    +You may rename tepal2med as tepal2med.exe for example. + +\code +#!/bin/bash +#script tepal2med overriding parameter deletegroups +#we have renamed binary executable tepal2med as tepal2med.exe +#echo tepal2med initial parameters are $1 $2 $3 $4 ... or $* +#$0 is ignored + +tepal2med.exe $* --deletegroups="(\bAll_Nodes|\bAll_Faces)" + +\endcode +\n +

  • +
  • +Advanced Tepal_V1.4 Parameters - overriding parameter component of ghs3d (to mesh holes).

    +You may rename tepal as tepal.exe for example. + +\code +#!/bin/bash +#script tepal overriding parameter component of tetmesh-ghs3d +#we have renamed binary executable tepal as tepal.exe + +#optionnaly we could set licence only for us +DISTENE_LICENSE_FILE="Use global envvar: DLIM8VAR" +DLIM8VAR="dlim8 1:1:29030@is142356/0016175ef08c::a1ba1...etc...e19" +SIMULOGD_LICENSE_FILE=29029@is142356 + +tepal.exe $* --tetmesh_args "-c 0" + +\endcode +\n +

  • +
  • +Advanced tepal Parameters - overriding launching tepal on other host.

    +You may rename tepal as tepal.exe for example. + +\code +#!/bin/bash +#script tepal overriding launching tepal on other host (tepal run 64 bits only) +#we have renamed binary executable tepal as tepal.exe +#common file system (same path) otherwise scp... on input or result files +#ssh -keygen -t rsa done and files id_rsa et id-rsa.pub move in ~/.ssh + +#example of typical command +#tepal -f /home/myname/tmp/GHS3DPRL -n 4 > /home/myname/tmp/tepal.log +#echo parameters $1 $2 $3 $4 ... or $* + +#tepal licence ought to be known on otherhost +ssh otherhost "tepal.exe $* > /home/myname/tmp/tepal.log" + +#or more and more +#ssh otherhost "tepal.exe $* --tetmesh_args \"-c 0\"" > /home/myname/tmp/tepal.log + +\endcode +\n +

  • + +

    Tepal_V2.0 and MPI use.


    +This all new beta-version needs MPI, (openmpi-1.3.1 was used). To use it you have to proceed +as done in "overriding parameter component of ghs3d". +Advanced ghs3d Parameters (through Tepal_V1.4's --tetmesh_args) are not assumed yet. +It meshes holes. +\n You may rename tepal as tepal64_v2.exe for example, and replace tepal by a shell script like below. + +
  • +example tepal_v2_mpirun.

    + +\code + +#!/bin/bash +#script tepal overriding launching Tepal_V2.0 with MPI (tepal run 64 bits only). +#we have renamed binary executable tepal as tepal64_v2.exe. +#typical command to launch tepal v1 : +#tepal -f /tmp/myname/GHS3DPRL -n 16 > /tmp/myname/tepal.log +#this file is an exemple to transform this call for tepal v2.0, +# (beta version using .mesh input file) +#you have to adapt for your convenience. + +#first problem is convert v1 input files GHS3DPRL.faces and GHS3DPRL.points +# to v2 input file GHS3DPRL.mesh. +#second problem is to launch on heterogeneous system linux cluster of +# 2 hosts (64 bits) of 8 nodes (by example) +# with different 2 executables codes linked on 2 different +# openmpi shared library codes. +#third problem is convert tepal v2 output files GHS3DPRL*.mesh +# to v1 input files GHS3DPRL*.faces an GHS3DPRL*.points. + +#you have to work on the same physical disk and same path input and ouput files : $SAME_DIR +#you have to work on different physical disk but same path and name for executable files +# (and shared libraries) : $DIFF_DIR + +echo "parameter 0="$0 +echo "parameter 1="$1 +echo "parameter 2="$2 +echo "parameter 3="$3 +echo "parameter 4="$4 + +export SAME_DIR=/same_physical_disk_and_same path/tmp +export DIFF_DIR=/different_physical_disk_but_same path/myname + +#copy input local files from local current directory (something like /tmp/myname) +#in this case we need /tmp/myname and $SAME_DIR different +cd $SAME_DIR +rm * +cp $2* . + +export IN_FILES=`basename $2` +export IN_DIR=`dirname $2` +#created .mesh from .faces et .points +/through_salome_path/facespoints2mesh.py $IN_FILES + +#there are 2 executable openmpi and library through 2 physical DIFF_DIR +export PATH=$DIFF_DIR/openmpi-1.3.1_install/bin:${PATH} +export LD_LIBRARY_PATH=$DIFF_DIR/openmpi-1.3.1_install/lib:${LD_LIBRARY_PATH} + +#there are 2 executables tepal_v2 through 2 physical DIFF_DIR +export LD_LIBRARY_PATH=$DIFF_DIR/tepal-2.0.0/bin/Linux_64:${LD_LIBRARY_PATH} +export PATH=$DIFF_DIR/tepal-2.0.0/bin/Linux_64:$PATH + +#small test betweeen friends +#rm hostnames.log +#mpirun -n $4 hostname >> hostnames.log + +#there necessary set env licence file for tepal v2 +export DISTENE_LICENSE_FILE="Use global envvar: DLIM8VAR" +export DLIM8VAR="dlim8 1:1:29030@is142356/0016175ef08c::a1ba...9e19" +export SIMULOGD_LICENSE_FILE=29029@is142356 +export LICENSE_FILE=/product/distene/dlim8.var.sh + +#mpirun with necessary set envenvironment +export TMP_ENV="-x PATH -x LD_LIBRARY_PATH -x DISTENE_LICENSE_FILE -x DLIM8VAR \ + -x SIMULOGD_LICENSE_FILE -x LICENSE_FILE" +#mpirun $TMPENV -n $4 which tepal64_v2.exe >> hostnames.log + +#real mpirun uncomment after verify small test +mpirun $TMPENV -n $4 tepal64_v2.exe --in $IN_FILES.mesh --out $IN_FILES.mesh --verbose 100 + +#convert output files tepalv1 format +/through_salome_path/mesh2facespoints.py $IN_FILES + +#copy ouputs files from $SAME_DIR to local current directory (something like /tmp/myname) +cp -f hostnames.log $IN_DIR +cp -f $IN_FILES* $IN_DIR + +#ls -al $SAME_DIR +#cat $SAME_DIR/hostnames.log +#cat /tmp/myname/tepal.log + +\endcode +\n +

  • + +

    TUI use.


    + +
  • +example ex30_tepal.py.

    + +\code + +#!/bin/python +import os + +import geompy +import smesh + +# Parameters +# ---------- + +results = "/tmp/ZZ" + +radius = 50 +height = 200 + +# Build a cylinder +# ---------------- + +base = geompy.MakeVertex(0, 0, 0) +direction = geompy.MakeVectorDXDYDZ(0, 0, 1) + +cylinder = geompy.MakeCylinder(base, direction, radius, height) + +geompy.addToStudy(cylinder, "Cylinder") + +# Define a mesh on a geometry +# --------------------------- + +m = smesh.Mesh(cylinder) + +# 2D mesh with BLSURF +# ------------------- + +algo2d = m.Triangle(smesh.BLSURF) + +algo2d.SetPhysicalMesh(1) +algo2d.SetPhySize(5) + +algo2d.SetGeometricMesh(0) + +# 3D mesh with tepal +# ------------------ + +algo3d = m.Tetrahedron(smesh.GHS3DPRL) + +algo3d.SetMEDName(results) +algo3d.SetNbPart(4) +algo3d.SetBackground(False) +algo3d.SetKeepFiles(False) +algo3d.SetToMeshHoles(True) + +# Launch meshers +# -------------- + +status = m.Compute() + +# Test if ok +# ---------- + +if os.access(results+".xml", os.F_OK): + print "Ok: tepal" +else: + print "KO: tepal" +\endcode +\n +

  • +
+ + +*/ diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/input/ghs3dprlplugin_python_interface.doc b/doc/salome/gui/GHS3DPRLPLUGIN/input/ghs3dprlplugin_python_interface.doc new file mode 100644 index 0000000..d1591e1 --- /dev/null +++ b/doc/salome/gui/GHS3DPRLPLUGIN/input/ghs3dprlplugin_python_interface.doc @@ -0,0 +1,9 @@ +/*! + +\page ghs3dprlplugin_python_interface_page Python Interface + +Python package \ref GHS3DPRLPluginDC "GHS3DPRLPlugin" defines several classes, destined for creation of the 3D meshes. + +Documentation for GHS3DPRLPlugin package is available in linear form grouped by classes, declared in the GHS3DPRLPluginDC.py file. + +*/ diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/input/index.doc b/doc/salome/gui/GHS3DPRLPLUGIN/input/index.doc new file mode 100644 index 0000000..9f0df8a --- /dev/null +++ b/doc/salome/gui/GHS3DPRLPLUGIN/input/index.doc @@ -0,0 +1,25 @@ +/*! + +\mainpage Introduction to GHS3DPRLPLUGIN + +\note GHS3DPRLPLUGIN plugin used GHS3D commercial mesher and require a +license to be used within the Mesh module. + +\n \b GHS3DPRLPLUGIN plugin is destined for: + +
    +
  • Meshing 3D geometric entities.
  • + - Volumes are split into tetrahedral (pyramidal) elements. +
  • Generating 3D meshes from 2D meshes, working without geometrical objects.
  • +
+ +To manage parameters of the GHS3DPRLPLUGIN use \subpage ghs3dprl_hypo_page. + +Also all GHS3DPRLPLUGIN functionalities are accessible via +\subpage ghs3dprlplugin_python_interface_page "GHS3DPRLPLUGIN Python interface". + + +\image html image2.gif "Example of a tetrahedral 3D mesh" + + +*/ diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/static/doxygen.css b/doc/salome/gui/GHS3DPRLPLUGIN/static/doxygen.css new file mode 100755 index 0000000..7a2dcbd --- /dev/null +++ b/doc/salome/gui/GHS3DPRLPLUGIN/static/doxygen.css @@ -0,0 +1,836 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + font-size: 150%; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { + color: #4665A2; +} + +a.codeRef { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.version { + border:1px solid #0000FF; + color: #CCCCCC; + font-family: Arial, Helvetica, sans-serif; + font-size: 9pt; + text-align: center; + width:100px; + -moz-border-radius: 8px; + margin: 5px; +} + +div.footer1 { + background-color: #DFE5F1; + border: 1px solid #AAAAAA; + font-family: Arial, Helvetica, sans-serif; + font-size: 11px; + padding: 10px; + margin-top: 15px; +} + + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C4CFE5; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.memitem { + padding: 0; + margin-bottom: 10px; +} + +.memname { + white-space: nowrap; + font-weight: bold; + margin-left: 6px; +} + +.memproto { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 8px; + border-top-left-radius: 8px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + +} + +.memdoc { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 2px 5px; + background-color: #FBFCFD; + border-top-width: 0; + /* opera specific markup */ + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +.params, .retval, .exception, .tparams { + border-spacing: 6px 2px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + + + + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0px; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; + margin: 5px; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + font-size: 8pt; + padding-left: 5px; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +.title { + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +dl +{ + padding: 0 0 0 10px; +} + +dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug +{ + border-left:4px solid; + padding: 0 0 0 6px; +} + +dl.note +{ + border-color: #D0D000; +} + +dl.warning, dl.attention +{ + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + border-color: #00D000; +} + +dl.deprecated +{ + border-color: #505050; +} + +dl.todo +{ + border-color: #00C0E0; +} + +dl.test +{ + border-color: #3030E0; +} + +dl.bug +{ + border-color: #C08050; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + background-color: #175783; + border: 1px solid; + height: 80px; + background-repeat: no-repeat; +/* font: 300% arial,sans-serif;*/ + margin: 0px; + padding: 0px; +} + +#projectbrief +{ + font: 120% arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + background: url("head.png"); + background-color: #175783; + border: 1px solid; + height: 80px; + background-repeat: no-repeat; + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/static/footer.html b/doc/salome/gui/GHS3DPRLPLUGIN/static/footer.html new file mode 100755 index 0000000..4c89a2b --- /dev/null +++ b/doc/salome/gui/GHS3DPRLPLUGIN/static/footer.html @@ -0,0 +1,12 @@ + + + +
+
+ Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+
+ + + \ No newline at end of file diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/static/header.html.in b/doc/salome/gui/GHS3DPRLPLUGIN/static/header.html.in new file mode 100755 index 0000000..4571b43 --- /dev/null +++ b/doc/salome/gui/GHS3DPRLPLUGIN/static/header.html.in @@ -0,0 +1,20 @@ + + + + + +$title + +$treeview +$search +$mathjax + + + + +
+
Version: @VERSION@
+ +
diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/static/header_py.html.in b/doc/salome/gui/GHS3DPRLPLUGIN/static/header_py.html.in new file mode 100644 index 0000000..61414bb --- /dev/null +++ b/doc/salome/gui/GHS3DPRLPLUGIN/static/header_py.html.in @@ -0,0 +1,21 @@ + + + + + +$title + +$treeview +$search +$mathjax + + + + +
+
Version: @VERSION@
+ + +
diff --git a/doc/salome/gui/Makefile.am b/doc/salome/gui/Makefile.am new file mode 100644 index 0000000..a8fc025 --- /dev/null +++ b/doc/salome/gui/Makefile.am @@ -0,0 +1,26 @@ +# Copyright (C) 2007-2012 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 = GHS3DPRLPLUGIN + +usr_docs: + (cd GHS3DPRLPLUGIN && $(MAKE) $(AM_MAKEFLAGS) usr_docs) + +docs: usr_docs diff --git a/idl/GHS3DPRLPlugin_Algorithm.idl b/idl/GHS3DPRLPlugin_Algorithm.idl index 952a300..61c77bc 100755 --- a/idl/GHS3DPRLPlugin_Algorithm.idl +++ b/idl/GHS3DPRLPlugin_Algorithm.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : GHS3DPRLPlugin_Algorithm.idl // Author : Christian VAN WAMBEKE (CEA) -// // --- - +// #ifndef _SMESH_GHS3DPRLALGORITHM_IDL_ #define _SMESH_GHS3DPRLALGORITHM_IDL_ diff --git a/idl/Makefile.am b/idl/Makefile.am index 3f15614..b22ef8e 100644 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,24 +16,22 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - -# # This Makefile is responsible of generating the client and server # implementation of IDL interfaces for both C++ and python usage. # The building process of the C++ files is in charge of each source # package and then is not manage here. # - include $(top_srcdir)/adm_local/unix/make_common_starter.am BASEIDL_FILES = GHS3DPRLPlugin_Algorithm.idl +BASEIDL_FILES_PY=$(BASEIDL_FILES:%.idl=%_idl.py) + # This variable defines the files to be installed dist_salomeidl_DATA = $(BASEIDL_FILES) @@ -52,7 +50,6 @@ libSalomeIDLGHS3DPRLPLUGIN_la_CPPFLAGS = \ $(SMESH_CXXFLAGS) \ @CORBA_CXXFLAGS@ \ @CORBA_INCLUDES@ \ - -I$(top_builddir)/salome_adm/unix \ -I$(top_builddir)/idl libSalomeIDLGHS3DPRLPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0 @@ -77,8 +74,7 @@ IDLCXXFLAGS = \ -I$(top_builddir)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(GEOM_ROOT_DIR)/idl/salome \ - -I$(SMESH_ROOT_DIR)/idl/salome \ - -I$(top_builddir)/salome_adm/unix + -I$(SMESH_ROOT_DIR)/idl/salome IDLPYFLAGS = \ @IDLPYFLAGS@ \ -I$(KERNEL_ROOT_DIR)/idl/salome \ @@ -98,9 +94,15 @@ install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%) $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \ done -# uninstall-local removes too much, but it works in distcheck +# we want to remove only staff generated for IDL files and nothing more uninstall-local: - rm -rf $(DESTDIR)$(salomepythondir)/* + @for modulen in GHS3DPRLPlugin ; do \ + test -d $(DESTDIR)$(salomepythondir)/$${modulen} && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen} ; \ + test -d $(DESTDIR)$(salomepythondir)/$${modulen}__POA && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}__POA" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen}__POA ; \ + done ; \ + for filen in $(BASEIDL_FILES_PY) ; do \ + echo "Removing $(DESTDIR)$(salomepythondir)/$${filen}" && rm -f $(DESTDIR)$(salomepythondir)/$${filen}* ; \ + done mostlyclean-local: -rm -f *.hh *.cc .depidl @@ -114,7 +116,7 @@ mostlyclean-local: @for dep in $^ dummy; do \ if [ $$dep != "dummy" ]; then \ echo Building dependencies for $$dep; \ - $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome -I$(top_builddir)/salome_adm/unix $$dep 2>/dev/null | \ + $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \ sed 's/\.o/\SK.cc/' >>$@; \ fi; \ done ; diff --git a/resources/GHS3DPRLPlugin.xml b/resources/GHS3DPRLPlugin.xml index b5552f5..cc13596 100755 --- a/resources/GHS3DPRLPlugin.xml +++ b/resources/GHS3DPRLPlugin.xml @@ -1,5 +1,25 @@ + @@ -19,9 +39,15 @@ + dim="3"> + + GHS3DPRL_3D=Tetrahedron(algo=smesh.GHS3DPRL) + GHS3DPRL_Parameters=Parameters() + + + diff --git a/resources/Makefile.am b/resources/Makefile.am index d310ed8..ba9697a 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am dist_salomeres_DATA = \ diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index c03dd1a..2e440d9 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -1,3 +1,23 @@ +
@@ -6,4 +26,7 @@
+
+ +
diff --git a/resources/mesh_tree_algo_GHS3DPRL.png b/resources/mesh_tree_algo_GHS3DPRL.png index 092eae3..ad5e9f3 100755 Binary files a/resources/mesh_tree_algo_GHS3DPRL.png and b/resources/mesh_tree_algo_GHS3DPRL.png differ diff --git a/resources/mesh_tree_hypo_GHS3DPRL.png b/resources/mesh_tree_hypo_GHS3DPRL.png index cd813c8..ad5e9f3 100755 Binary files a/resources/mesh_tree_hypo_GHS3DPRL.png and b/resources/mesh_tree_hypo_GHS3DPRL.png differ diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py b/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py new file mode 100644 index 0000000..b9bb2a3 --- /dev/null +++ b/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py @@ -0,0 +1,79 @@ +# Copyright (C) 2007-2012 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 +# + +from smesh import Mesh_Algorithm, AssureGeomPublished + +# import GHS3DPRLPlugin module if possible +noGHS3DPRLPlugin = 0 +try: + import GHS3DPRLPlugin +except ImportError: + noGHS3DPRLPlugin = 1 + pass + +# Optimization level of GHS3D +# V3.1 +None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization = 0,1,2,3 +# V4.1 (partialy redefines V3.1). Issue 0020574 +None_Optimization, Light_Optimization, Standard_Optimization, StandardPlus_Optimization, Strong_Optimization = 0,1,2,3,4 + +GHS3DPRL = "GHS3DPRL_3D" + + +## Tetrahedron GHS3DPRL 3D algorithm +# It is created by calling Mesh.Tetrahedron( GHS3DPRL, geom=0 ) +# +class GHS3DPRL_Algorithm(Mesh_Algorithm): + + meshMethod = "Tetrahedron" + algoType = GHS3DPRL + + ## Private constructor. + def __init__(self, mesh, geom=0): + Mesh_Algorithm.__init__(self) + if none_optimization: print "Warning: GHS3DPRLPlugin module unavailable" + self.Create(mesh, geom, self.algoType, "libGHS3DPRLEngine.so") + + ## Defines hypothesis having several parameters + # + def Parameters(self): + if not self.params: + self.params = self.Hypothesis("GHS3DPRL_Parameters", [], + "libGHS3DPRLEngine.so", UseExisting=0) + return self.params + + ## To keep working files or remove them. Log file remains in case of errors anyway. + def SetKeepFiles(self, toKeep): + self.Parameters().SetKeepFiles(toKeep) + + ## Sets MED files name and path. + def SetMEDName(self, value): + self.Parameters().SetMEDName(value) + + ## Sets the number of partition of the initial mesh + def SetNbPart(self, value): + self.Parameters().SetNbPart(value) + + ## When big mesh, start tepal in background + def SetBackground(self, value): + self.Parameters().SetBackground(value) + + ## To mesh "holes" in a solid or not. Default is to mesh. + def SetToMeshHoles(self, toMesh): + self.Parameters().SetToMeshHoles(toMesh) diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Defs.hxx b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Defs.hxx new file mode 100755 index 0000000..3c5d519 --- /dev/null +++ b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Defs.hxx @@ -0,0 +1,37 @@ +// Copyright (C) 2004-2012 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 +// + +//============================================================================= +// File : GHS3DPlugin_Defs.hxx +// Author : Alexander A. BORODIN +// +#ifndef _GHS3DPRLPlugin_DEFS_HXX_ +#define _GHS3DPRLPlugin_DEFS_HXX_ + +#ifdef WIN32 + #if defined GHS3DPRLPLUGIN_EXPORTS || defined GHS3DPRLEngine_EXPORTS + #define GHS3DPRLPLUGIN_EXPORT __declspec( dllexport ) + #else + #define GHS3DPRLPLUGIN_EXPORT __declspec( dllimport ) + #endif +#else + #define GHS3DPRLPLUGIN_EXPORT +#endif + +#endif diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_GHS3DPRL.cxx b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_GHS3DPRL.cxx index 0278eac..cb93731 100755 --- a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_GHS3DPRL.cxx +++ b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_GHS3DPRL.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : GHS3DPRLPlugin_GHS3DPRL.cxx // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) -// // --- - +// #include "GHS3DPRLPlugin_GHS3DPRL.hxx" #include "GHS3DPRLPlugin_Hypothesis.hxx" @@ -50,7 +49,12 @@ #include #include +#include #include +#include +#include +#include +#include /* extern "C" { @@ -62,6 +66,16 @@ extern "C" { } using namespace med_2_2;*/ +static void removeFile( const TCollection_AsciiString& fileName ) +{ + try { + OSD_File( fileName ).Remove(); + } + catch ( Standard_ProgramError ) { + MESSAGE("Can't remove file: " << fileName.ToCString() << " ; file does not exist or permission denied"); + } +} + //============================================================================= GHS3DPRLPlugin_GHS3DPRL::GHS3DPRLPlugin_GHS3DPRL(int hypId, int studyId, SMESH_Gen* gen) : SMESH_3D_Algo(hypId, studyId, gen) @@ -126,11 +140,11 @@ static bool writeGHS3DPRLFiles (const TCollection_AsciiString & GHS3DPRL_In, int ifam=0; TCollection_AsciiString namefile(GHS3DPRL_In); namefile+=".points"; - OSD_File(namefile).Remove(); + removeFile(namefile); ofstream theFile; theFile.open(namefile.ToCString(),ios::out); #ifdef WIN32 - Ok=theFile->is_open(); + Ok = theFile.is_open(); #else Ok=theFile.rdbuf()->is_open(); #endif @@ -169,10 +183,10 @@ static bool writeGHS3DPRLFiles (const TCollection_AsciiString & GHS3DPRL_In, theFile.close(); namefile=GHS3DPRL_In+".faces"; - OSD_File(namefile).Remove(); + removeFile(namefile); theFile.open(namefile.ToCString(),ios::out); #ifdef WIN32 - Ok=theFile->is_open(); + Ok=theFile.is_open(); #else Ok=theFile.rdbuf()->is_open(); #endif @@ -281,10 +295,10 @@ static bool readResult(FILE * theFile, int shapeID = theMesh->ShapeToIndex( theShape ); int line = 1, EndOfFile = 0, nbElem = 0, nField = 10, nbRef = 0, aGHS3DPRLNodeID = 0; - char * theField; + const char * theField; - char * tabField [nField]; - int tabRef [nField]; + vector tabField = vector(nField); + vector tabRef = vector(nField); tabField[0] = "MeshVersionFormatted"; tabRef[0] = 0; tabField[1] = "Dimension"; tabRef[1] = 0; @@ -331,7 +345,7 @@ static bool readResult(FILE * theFile, if ( strcmp(theField, "Vertices") == 0 ) { int aGHS3DPRLID; - double coord[nbRef]; + vector coord = vector(nbRef); SMDS_MeshNode * aGHS3DPRLNode; for ( int iElem = 0; iElem < nbElem; iElem++ ) { @@ -345,7 +359,7 @@ static bool readResult(FILE * theFile, } } else { - const SMDS_MeshNode * node[nbRef]; + vector node = vector(nbRef); SMDS_MeshElement* aGHS3DPRLElement; map ::iterator itOnGHS3DPRLNode; @@ -506,7 +520,7 @@ bool GHS3DPRLPlugin_GHS3DPRL::Compute(SMESH_Mesh& theMesh, cout<<"GHS3DPRL command : "<> (istream & load, GHS3DPRLPlugin_GHS3DPRL & hyp) { return hyp.LoadFrom( load ); } + + +//============================================================================= +/*! + * + */ +//============================================================================= +bool GHS3DPRLPlugin_GHS3DPRL::Evaluate(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + MapShapeNbElems& aResMap) +{ + int nbtri = 0, nbqua = 0; + double fullArea = 0.0; + for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next()) { + TopoDS_Face F = TopoDS::Face( exp.Current() ); + SMESH_subMesh *sm = aMesh.GetSubMesh(F); + MapShapeNbElemsItr anIt = aResMap.find(sm); + if( anIt==aResMap.end() ) { + SMESH_ComputeErrorPtr& smError = sm->GetComputeError(); + smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED, + "Submesh can not be evaluated",this)); + return false; + } + std::vector aVec = (*anIt).second; + nbtri += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + nbqua += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + GProp_GProps G; + BRepGProp::SurfaceProperties(F,G); + double anArea = G.Mass(); + fullArea += anArea; + } + + // collect info from edges + int nb0d_e = 0, nb1d_e = 0; + bool IsQuadratic = false; + bool IsFirst = true; + TopTools_MapOfShape tmpMap; + for (TopExp_Explorer exp(aShape, TopAbs_EDGE); exp.More(); exp.Next()) { + TopoDS_Edge E = TopoDS::Edge(exp.Current()); + if( tmpMap.Contains(E) ) + continue; + tmpMap.Add(E); + SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current()); + MapShapeNbElemsItr anIt = aResMap.find(aSubMesh); + std::vector aVec = (*anIt).second; + nb0d_e += aVec[SMDSEntity_Node]; + nb1d_e += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + if(IsFirst) { + IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]); + IsFirst = false; + } + } + tmpMap.Clear(); + + double ELen = sqrt(2.* ( fullArea/(nbtri+nbqua*2) ) / sqrt(3.0) ); + + GProp_GProps G; + BRepGProp::VolumeProperties(aShape,G); + double aVolume = G.Mass(); + double tetrVol = 0.1179*ELen*ELen*ELen; + double CoeffQuality = 0.9; + int nbVols = (int)aVolume/tetrVol/CoeffQuality; + int nb1d_f = (nbtri*3 + nbqua*4 - nb1d_e) / 2; + int nb1d_in = (int) ( nbVols*6 - nb1d_e - nb1d_f ) / 5; + std::vector aVec(SMDSEntity_Last); + for(int i=0; i #include CORBA_SERVER_HEADER(GHS3DPRLPlugin_Algorithm) #include CORBA_SERVER_HEADER(SALOME_Exception) @@ -36,7 +37,7 @@ // ====================================================== // GHS3DPRL 3d algorithm // ====================================================== -class GHS3DPRLPlugin_GHS3DPRL_i: +class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_GHS3DPRL_i: public virtual POA_GHS3DPRLPlugin::GHS3DPRLPlugin_GHS3DPRL, public virtual SMESH_3D_Algo_i { diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.cxx b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.cxx index 8f29b51..04bb483 100755 --- a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.cxx +++ b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.cxx @@ -1,27 +1,28 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 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. +// 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 +// 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- // File : GHS3DPRLPlugin_Hypothesis.cxx // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) // --- - -#include +// +#include "GHS3DPRLPlugin_Hypothesis.hxx" #include //============================================================================= @@ -61,7 +62,7 @@ static std::string cutOrReplaceBlancs(std::string theIn) for (int i = 0, j = 0; i < len; i++) { - ushort ucs = (ushort)(str1[i]); + unsigned short ucs = (unsigned short)(str1[i]); if ((9 <= ucs && ucs <= 13) || ucs == 32) { if (!del) diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.hxx b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.hxx index 7dd85b3..8d9808a 100755 --- a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.hxx +++ b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.hxx @@ -1,36 +1,39 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 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. +// 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 +// 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- // File : GHS3DPRLPlugin_Hypothesis.hxx // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) // --- - +// #ifndef _GHS3DPRLPlugin_Hypothesis_HXX_ #define _GHS3DPRLPlugin_Hypothesis_HXX_ +#include "GHS3DPRLPlugin_Defs.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" // Parameters for work of GHS3DPRL // -class GHS3DPRLPlugin_Hypothesis: public SMESH_Hypothesis +class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_Hypothesis: public SMESH_Hypothesis { public: diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis_i.cxx b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis_i.cxx index c7f044d..70c4bcf 100755 --- a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis_i.cxx +++ b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis_i.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : GHS3DPRLPlugin_Hypothesis_i.cxx // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) -// // --- - +// #include "GHS3DPRLPlugin_Hypothesis_i.hxx" #include "SMESH_Gen.hxx" #include "SMESH_PythonDump.hxx" diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis_i.hxx b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis_i.hxx index e62fb30..0c9d0fb 100755 --- a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis_i.hxx +++ b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis_i.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,16 +16,17 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : GHS3DPRLPlugin_Hypothesis_i.hxx // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) -// // --- - +// #ifndef _GHS3DPRLPlugin_Hypothesis_i_HXX_ #define _GHS3DPRLPlugin_Hypothesis_i_HXX_ +#include "GHS3DPRLPlugin_Defs.hxx" + #include #include CORBA_SERVER_HEADER(GHS3DPRLPlugin_Algorithm) @@ -36,7 +37,7 @@ class SMESH_Gen; // GHS3DPRLPlugin parameters hypothesis -class GHS3DPRLPlugin_Hypothesis_i: +class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_Hypothesis_i: public virtual POA_GHS3DPRLPlugin::GHS3DPRLPlugin_Hypothesis, public virtual SMESH_Hypothesis_i { diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_i.cxx b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_i.cxx index bd5fd31..026c483 100755 --- a/src/GHS3DPRLPlugin/GHS3DPRLPlugin_i.cxx +++ b/src/GHS3DPRLPlugin/GHS3DPRLPlugin_i.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,13 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : GHS3DPRLPlugin_i.cxx // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) -// // --- - +// +#include "GHS3DPRLPlugin_Defs.hxx" #include "SMESH_Hypothesis_i.hxx" #include "utilities.h" @@ -44,7 +44,10 @@ template class GHS3DPRLPlugin_Creator_i:public HypothesisCreator_i extern "C" { - GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName) + + GHS3DPRLPLUGIN_EXPORT GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName); + + GHS3DPRLPLUGIN_EXPORT GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName) { MESSAGE("GetHypothesisCreator " << aHypName); diff --git a/src/GHS3DPRLPlugin/Makefile.am b/src/GHS3DPRLPlugin/Makefile.am index cafa635..8a6c8c1 100644 --- a/src/GHS3DPRLPlugin/Makefile.am +++ b/src/GHS3DPRLPlugin/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am # header files @@ -32,8 +31,9 @@ salomeinclude_HEADERS = lib_LTLIBRARIES = libGHS3DPRLEngine.la dist_libGHS3DPRLEngine_la_SOURCES = \ - GHS3DPRLPlugin_GHS3DPRL.hxx \ - GHS3DPRLPlugin_GHS3DPRL.cxx \ + GHS3DPRLPlugin_Defs.hxx \ + GHS3DPRLPlugin_GHS3DPRL.hxx \ + GHS3DPRLPlugin_GHS3DPRL.cxx \ GHS3DPRLPlugin_GHS3DPRL_i.hxx \ GHS3DPRLPlugin_GHS3DPRL_i.cxx \ GHS3DPRLPlugin_Hypothesis.hxx \ @@ -48,14 +48,20 @@ libGHS3DPRLEngine_la_CPPFLAGS = \ $(MED_CXXFLAGS) \ $(GEOM_CXXFLAGS) \ $(CAS_CPPFLAGS) \ + $(VTK_INCLUDES) \ $(SMESH_CXXFLAGS) \ $(CORBA_CXXFLAGS) \ $(CORBA_INCLUDES) \ $(BOOST_CPPFLAGS) \ - -I$(top_builddir)/idl \ - -I$(top_builddir)/salome_adm/unix + -I$(top_builddir)/idl libGHS3DPRLEngine_la_LDFLAGS = \ ../../idl/libSalomeIDLGHS3DPRLPLUGIN.la \ - $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \ - $(KERNEL_LDFLAGS) -lSalomeGenericObj + $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \ + $(KERNEL_LDFLAGS) -lSalomeGenericObj -lSALOMELocalTrace \ + $(MED_LDFLAGS) -lSalomeIDLMED \ + $(CAS_LDFLAGS) -lTKBRep -lTKG3d -lTKTopAlgo\ + $(SMESH_LDFLAGS) -lSMDS -lSMESHDS -lTKG2d + +# Scripts to be installed. +dist_salomescript_DATA= GHS3DPRLPluginDC.py diff --git a/src/Makefile.am b/src/Makefile.am index 57db467..20ada46 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,19 +16,18 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am -SUBDIRS = GHS3DPRLPlugin +SUBDIRS = GHS3DPRLPlugin tools if GHS3DPRLPLUGIN_ENABLE_GUI SUBDIRS += gui tepal2med endif -DIST_SUBDIRS = GHS3DPRLPlugin gui tepal2med +DIST_SUBDIRS = GHS3DPRLPlugin gui tepal2med tools diff --git a/src/gui/GHS3DPRLPluginGUI.cxx b/src/gui/GHS3DPRLPluginGUI.cxx index b5210f1..d4d8f40 100755 --- a/src/gui/GHS3DPRLPluginGUI.cxx +++ b/src/gui/GHS3DPRLPluginGUI.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : GHS3DPRLPluginGUI.cxx // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) -// // --- - +// #include "GHS3DPRLPluginGUI_HypothesisCreator.h" //============================================================================= @@ -32,7 +31,7 @@ //============================================================================= extern "C" { - SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType ) + GHS3DPRLPLUGINGUI_EXPORT SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType ) { SMESHGUI_GenericHypothesisCreator* aCreator = NULL; if( aHypType=="GHS3DPRL_Parameters" ) diff --git a/src/gui/GHS3DPRLPluginGUI_HypothesisCreator.cxx b/src/gui/GHS3DPRLPluginGUI_HypothesisCreator.cxx index 5927a6c..c0f9e48 100755 --- a/src/gui/GHS3DPRLPluginGUI_HypothesisCreator.cxx +++ b/src/gui/GHS3DPRLPluginGUI_HypothesisCreator.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : GHS3DPRLPluginGUI_HypothesisCreator.cxx // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) -// // --- - +// #include "GHS3DPRLPluginGUI_HypothesisCreator.h" #include @@ -47,6 +46,7 @@ GHS3DPRLPluginGUI_HypothesisCreator::GHS3DPRLPluginGUI_HypothesisCreator( const : SMESHGUI_GenericHypothesisCreator( theHypType ), myIs3D( true ) { + printf("Hypo creator !!!!!!!!!!!!!!!!!!!!!!!!!! RNV"); } GHS3DPRLPluginGUI_HypothesisCreator::~GHS3DPRLPluginGUI_HypothesisCreator() diff --git a/src/gui/GHS3DPRLPluginGUI_HypothesisCreator.h b/src/gui/GHS3DPRLPluginGUI_HypothesisCreator.h index fd59e9c..b7717c9 100755 --- a/src/gui/GHS3DPRLPluginGUI_HypothesisCreator.h +++ b/src/gui/GHS3DPRLPluginGUI_HypothesisCreator.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,16 +16,26 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : GHS3DPRLPluginGUI_HypothesisCreator.h // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) -// // --- - +// #ifndef GHS3DPRLPLUGINGUI_HypothesisCreator_H #define GHS3DPRLPLUGINGUI_HypothesisCreator_H +#ifdef WIN32 + #if defined GHS3DPRLPluginGUI_EXPORTS + #define GHS3DPRLPLUGINGUI_EXPORT __declspec( dllexport ) + #else + #define GHS3DPRLPLUGINGUI_EXPORT __declspec( dllimport ) + #endif +#else + #define GHS3DPRLPLUGINGUI_EXPORT +#endif + + #include class QtxIntSpinBox; @@ -45,7 +55,7 @@ typedef struct /*! * \brief Class for creation of GHS3DPRL hypotheses */ -class GHS3DPRLPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator +class GHS3DPRLPLUGINGUI_EXPORT GHS3DPRLPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator { Q_OBJECT diff --git a/src/gui/GHS3DPRLPlugin_images.ts b/src/gui/GHS3DPRLPlugin_images.ts index b46d1aa..e19cd0a 100644 --- a/src/gui/GHS3DPRLPlugin_images.ts +++ b/src/gui/GHS3DPRLPlugin_images.ts @@ -1,5 +1,6 @@ + - + @default diff --git a/src/gui/GHS3DPRLPlugin_msg_en.ts b/src/gui/GHS3DPRLPlugin_msg_en.ts index 5c65fc0..1cc4e4f 100644 --- a/src/gui/GHS3DPRLPlugin_msg_en.ts +++ b/src/gui/GHS3DPRLPlugin_msg_en.ts @@ -1,58 +1,59 @@ + - - - @default - - GHS3DPRL_3D_HYPOTHESIS - GHS3DPRL 3D - - - GHS3DPRL_3D_TITLE - Hypothesis Construction - - - GHS3DPRL_KeepFiles - Keep_Files - - - GHS3DPRL_Background - Tepal_in_Background - - - GHS3DPRL_ToMeshHoles - To_Mesh_Holes - - - GHS3DPRL_MEDName - MED_Name - - - GHS3DPRL_NbPart - Nb_Part - - - GHS3DPRL_WhatsThis_KeepFiles - Keep intemediates tepal Files (.faces,.points,.msg,.noboite...) - - - GHS3DPRL_WhatsThis_Background - lanch tepal in background (for a big mesh, a long time...) - - - GHS3DPRL_WhatsThis_ToMeshHoles - tepal meshes holes - - - GHS3DPRL_WhatsThis_MEDName - Generic path/name of finals outputs files (.med) - - - GHS3DPRL_WhatsThis_Name - Name of applied hypothese - - - GHS3DPRL_WhatsThis_NbPart - Number of partitions of initial wrap - - + + + @default + + GHS3DPRL_3D_HYPOTHESIS + GHS3DPRL 3D + + + GHS3DPRL_3D_TITLE + Hypothesis Construction + + + GHS3DPRL_KeepFiles + Keep files + + + GHS3DPRL_Background + Tepal in background + + + GHS3DPRL_ToMeshHoles + To mesh holes + + + GHS3DPRL_MEDName + MED Name + + + GHS3DPRL_NbPart + Nb partitions + + + GHS3DPRL_WhatsThis_KeepFiles + Keep intemediates Tepal Files (.faces,.points,.msg,.noboite...) + + + GHS3DPRL_WhatsThis_Background + Lanch Tepal in background (for a big mesh, a long time...) + + + GHS3DPRL_WhatsThis_ToMeshHoles + Tepal meshes holes + + + GHS3DPRL_WhatsThis_MEDName + Generic path/name of finals outputs files (.med) + + + GHS3DPRL_WhatsThis_Name + Name of applied hypothese + + + GHS3DPRL_WhatsThis_NbPart + Number of partitions of initial wrap + + diff --git a/src/gui/GHS3DPRLPlugin_msg_fr.ts b/src/gui/GHS3DPRLPlugin_msg_fr.ts new file mode 100755 index 0000000..2758ea7 --- /dev/null +++ b/src/gui/GHS3DPRLPlugin_msg_fr.ts @@ -0,0 +1,59 @@ + + + + + @default + + GHS3DPRL_3D_HYPOTHESIS + GHS3DPRL 3D + + + GHS3DPRL_3D_TITLE + Construction d'une hypothèse + + + GHS3DPRL_KeepFiles + Sauvegarder les fichiers + + + GHS3DPRL_Background + Tepal en arrière plan + + + GHS3DPRL_ToMeshHoles + Mailler les trous + + + GHS3DPRL_MEDName + Nom MED + + + GHS3DPRL_NbPart + Nombre de partitions + + + GHS3DPRL_WhatsThis_KeepFiles + Préserver les fichiers Tepal intermédiaires (.faces,.points,.msg,.noboite...) + + + GHS3DPRL_WhatsThis_Background + Lancer Tepal en arrière-plan (prend du temps pour un maillage de grand volume...) + + + GHS3DPRL_WhatsThis_ToMeshHoles + Tepal maille les trous + + + GHS3DPRL_WhatsThis_MEDName + Chemin/nom générique des fichiers de sortie finaux (.med) + + + GHS3DPRL_WhatsThis_Name + Nom de l'hypothèse appliquée + + + GHS3DPRL_WhatsThis_NbPart + Nombre de partitions de l'enveloppe initiale + + + diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 185164e..386397f 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am # header files @@ -57,15 +56,17 @@ libGHS3DPRLPluginGUI_la_CPPFLAGS = \ $(CORBA_CXXFLAGS) \ $(CORBA_INCLUDES) \ -I$(srcdir)/../GHS3DPRLPlugin \ - -I$(top_builddir)/idl \ - -I$(top_builddir)/salome_adm/unix + -I$(top_builddir)/idl libGHS3DPRLPluginGUI_la_LDFLAGS = \ + $(QT_LIBS) \ ../GHS3DPRLPlugin/libGHS3DPRLEngine.la \ ${SMESH_LDFLAGS} -lSMESH \ - $(CAS_KERNEL) + $(CAS_KERNEL) \ + $(GUI_LDFLAGS) -lsuit -lqtx -lSalomeApp # resources files nodist_salomeres_DATA = \ GHS3DPRLPlugin_images.qm \ - GHS3DPRLPlugin_msg_en.qm + GHS3DPRLPlugin_msg_en.qm \ + GHS3DPRLPlugin_msg_fr.qm diff --git a/src/tepal2med/Makefile.am b/src/tepal2med/Makefile.am index a64fd0a..bafa2f1 100644 --- a/src/tepal2med/Makefile.am +++ b/src/tepal2med/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # --- -# # File : Makefile.am # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# # --- - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am bin_PROGRAMS = tepal2med @@ -44,6 +43,6 @@ BUILT_SOURCES = $(UIC_FILES) nodist_tepal2med_SOURCES = $(MOC_FILES) $(UIC_FILES) -tepal2med_CPPFLAGS = $(QT_INCLUDES) $(MED2_INCLUDES) $(HDF5_INCLUDES) $(LIBXML_INCLUDES) +tepal2med_CPPFLAGS = -I. $(QT_INCLUDES) $(MED3_INCLUDES) $(HDF5_INCLUDES) $(LIBXML_INCLUDES) -tepal2med_LDADD = $(QT_LIBS) $(MED2_LIBS) $(HDF5_LIBS) $(LIBXML_LIBS) +tepal2med_LDADD = $(QT_LIBS) $(MED3_LIBS) $(HDF5_LIBS) $(LIBXML_LIBS) diff --git a/src/tepal2med/dlg_ghs3dmain.cxx b/src/tepal2med/dlg_ghs3dmain.cxx index d56048c..0e4cdcd 100755 --- a/src/tepal2med/dlg_ghs3dmain.cxx +++ b/src/tepal2med/dlg_ghs3dmain.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : dlg_gsh3dmain.cxx // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -// // --- - +// #include "dlg_ghs3dmain.h" dlg_ghs3dmain::dlg_ghs3dmain() diff --git a/src/tepal2med/dlg_ghs3dmain.h b/src/tepal2med/dlg_ghs3dmain.h index cc10918..c28e886 100755 --- a/src/tepal2med/dlg_ghs3dmain.h +++ b/src/tepal2med/dlg_ghs3dmain.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : dlg_gsh3dmain.h // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -// // --- - +// #ifndef DLG_GHS3DMAIN_H #define DLG_GHS3DMAIN_H diff --git a/src/tepal2med/ghs3dprl_mesh_wrap.cxx b/src/tepal2med/ghs3dprl_mesh_wrap.cxx index 090425d..aaeb05c 100755 --- a/src/tepal2med/ghs3dprl_mesh_wrap.cxx +++ b/src/tepal2med/ghs3dprl_mesh_wrap.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,37 +16,52 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : ghs3dprl_mesh_wrap.cxx // Author : Christian VAN WAMBEKE (CEA) -// // --- - +// #include "ghs3dprl_mesh_wrap.h" #include #include #include #include +#ifndef WIN32 +#include +#endif #include #include #include #include +#ifdef WIN32 +#include +#include +#include +#define F_OK 0 +#undef max +#undef min +#endif #include #include +#include -using namespace std; -using namespace med_2_2; +extern "C" { +#include +//#include +//#include +//#include +} //utils procedures //************************************ -string i2a(const int &v) +std::string i2a(const int &v) { - ostringstream ss; + std::ostringstream ss; ss<\tGroups="; + nbf++; + std::cout<<"Family=<"<<(*it1).first.toLatin1().constData()<<">\tGroups="; gb=(*it1).second; for (it2=gb.begin(); it2!=gb.end(); ++it2){ - cout<<"<"<<(*it2).first.toLatin1().constData()<<"> "; + std::cout<<"<"<<(*it2).first.toLatin1().constData()<<"> "; } - cout<\tFamilies="; + nbg++; + std::cout<<"Group=<"<<(*it1).first.toLatin1().constData()<<">\tFamilies="; gb=(*it1).second; for (it2=gb.begin(); it2!=gb.end(); ++it2){ - cout<<"<"<<(*it2).first.toLatin1().constData()<<"> "; + std::cout<<"<"<<(*it2).first.toLatin1().constData()<<"> "; } - cout<\t<"<\n"; + //std::cout<<"add family <"<\t<"<\n"; fagr::iterator it; it=fam.find(nomfam); if (it==fam.end()){ - //cout<<"add new family <"<\t<"<\n"; + //std::cout<<"add new family <"<\t<"<\n"; newfam(nomfam); it=fam.find(nomfam); } @@ -165,7 +184,7 @@ void charendnull(char *p, QString deb, int lg) (*it).second[nomgro]=0; it=gro.find(nomgro); if (it==gro.end()){ - //cout<<"***new*** "<<"<<*tmp<<">\n"; + //std::cout<<"NewFamily Found<"<<*ires<<"><"<<*tmp<<">\n"; return true; } ii=ii+pas; } - cerr<<"***get_number_of_new_family*** Problem new family not found"< from <"<< + //std::cout<<"find_family_on_groups old <"< from <"<< // fam1<<"><"<\n"; return ires; } } - //cout<<"no family found!!! - groups of "<add(tmp,(*it).first); } - //cout<<"new family <"< intersection of <"<<"<\n"; + //std::cout<<"new family <"< intersection of <"<<"<\n"; return ires; } @@ -241,7 +260,7 @@ bool familles::get_number_of_new_family(int sign, med_int *ires, QString *tmp) nom2=nom2.sprintf("%d",fam2); it2=fam.find(nom2); if ( (it1==fam.end())||(it2==fam.end()) ) { - cerr<<"***fuse_goups*** non existing family "< "; + std::cout<<"<"<<(*it).first.toLatin1().constData()<<"> "; } - cout<memorymax) { - cout<<"***WARNING*** memory max reached "<memorymax) { - cout<<"***WARNING*** memory max reached "<filename<filename<CVWtab_deallocate(); //remove temporary file if (this->filename!="_NO_FILE") { remove(this->filename.toLatin1().constData()); //#include - //cout<filename<<" successfully deleted\n"; + //std::cout<filename<<" successfully deleted\n"; } } @@ -313,7 +332,7 @@ CVWtab::~CVWtab() //************************************ bool CVWtab::CVWtab_deallocate() { - //cout<<" deallocate CVWtab*** "<size<type==1) cout<<"med_int tab1[0]="<tmint[0]<type==2) cout<<"med_float tab1[0]="<tmflo[0]<size<type==1) std::cout<<"med_int tab1[0]="<tmint[0]<type==2) std::cout<<"med_float tab1[0]="<tmflo[0]<size!=tab2->size) return false; if (this->type!=tab2->type) return false; if (this->type==1) { if (!this->tmint) - { cout<<"***is_equal*** pb pointer NULL with tmint size="<size<size<size<=tab1->size) { - cerr<<"BadIndice tab1 in is_equal_vertices "<< - di1<<" not in "<size<size<=tab2->size) { - cerr<<"BadIndice tab2 in is_equal_vertices "<< - di2<<" not in "<size<size<tmflo+di1); @@ -399,11 +418,11 @@ bool CVW_is_equal_vertices(CVWtab *tab1, long i1, } //************************************ -bool CVW_FindString(const string &str,fstream &Ff, long &count) +bool CVW_FindString(const std::string &str,std::fstream &Ff, long &count) //find in file first line with string str in first position of line //converts count value expected after "='" in line found { - string line; + std::string line; QString tmp; do { @@ -422,7 +441,7 @@ bool CVW_FindString(const string &str,fstream &Ff, long &count) } else { - cerr<<"Problem line '"< for speed (and so no test) { QString tmp; - fstream Ff(FileName.toLatin1().constData(),ios_base::in); - string line; + std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in); + std::string line; long i,count,nbneighbour,ineighbour; bool ok; if (!Ff.is_open()) { - cerr<<"Problem File '"<nofile<<"="<4) std::cout<<"Vertices "<nofile,ineighbour); @@ -466,7 +485,7 @@ bool ghs3dprl_mesh_wrap::ReadFileMSGnew(const QString FileName) if (count>0){ med_int *tmint=new med_int[count]; for (int i=0; i>tmint[i]; - if (verbose>4) cout<<"Edges "<4) std::cout<<"Edges "<nofile,ineighbour); @@ -476,7 +495,7 @@ bool ghs3dprl_mesh_wrap::ReadFileMSGnew(const QString FileName) if (count>0){ med_int *tmint=new med_int[count]; for (int i=0; i>tmint[i]; - if (verbose>4) cout<<"Faces "<4) std::cout<<"Faces "<nofile,ineighbour); @@ -486,7 +505,7 @@ bool ghs3dprl_mesh_wrap::ReadFileMSGnew(const QString FileName) if (count>0){ med_int *tmint=new med_int[count]; for (int i=0; i>tmint[i]; - if (verbose>4) cout<<"Elements "<4) std::cout<<"Elements "<nofile,ineighbour); @@ -505,25 +524,25 @@ bool ghs3dprl_mesh_wrap::ReadFileGLO(const QString FileName) //read file .glo with no parser xml because big file (volume) { QString tmp; - fstream Ff(FileName.toLatin1().constData(),ios_base::in); - string line; + std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in); + std::string line; long count; bool ok; if (!Ff.is_open()) { - cerr<<"Problem File '"<4) std::cout<<"Elements "<nofile); @@ -531,12 +550,12 @@ bool ghs3dprl_mesh_wrap::ReadFileGLO(const QString FileName) } if (!CVW_FindString("4) std::cout<<"Elements "<nofile); @@ -544,12 +563,12 @@ bool ghs3dprl_mesh_wrap::ReadFileGLO(const QString FileName) } if (!CVW_FindString("4) std::cout<<"Elements "<nofile); @@ -557,12 +576,12 @@ bool ghs3dprl_mesh_wrap::ReadFileGLO(const QString FileName) } if (!CVW_FindString("4) std::cout<<"Elements "<nofile); @@ -579,19 +598,19 @@ bool ghs3dprl_mesh_wrap::ReadFileFACES(const QString FileName) //read file .faces (wrap) { QString tmp; - fstream Ff(FileName.toLatin1().constData(),ios_base::in); - string line; + std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in); + std::string line; long nbelem,ntype; bool ok; if (!Ff.is_open()) { - cerr<<"Problem File '"<3) cout<<"FacesNumberOfElements="<3) std::cout<<"FacesNumberOfElements="<>ntype; if (ntype!=3) //only triangles { - cerr<<"Problem on ntype != 3"<>tmint[i+j]; - //for (int j=0; j<7; j++) cout<4) cout<<"Elements "<4) std::cout<<"Elements "<nofile); @@ -633,28 +652,28 @@ bool ghs3dprl_mesh_wrap::ReadFileNOBOITE(const QString FileName) //(parameter option of ghs3d but NOT tepal) { QString tmp; - fstream Ff(FileName.toLatin1().constData(),ios_base::in); + std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in); long ne,np,npfixe,subnumber,reste; bool ok; if (!Ff.is_open()){ - cerr<<"Problem File '"<>ne>>np>>npfixe; if (verbose>3){ - cout<<"NoboiteNumberOfElements="<>tmint[i]; - if (verbose>4) cout<<"Elements "<4) std::cout<<"Elements "<nofile); @@ -662,17 +681,36 @@ bool ghs3dprl_mesh_wrap::ReadFileNOBOITE(const QString FileName) med_float *tmflo=new med_float[np*3]; for (int i=0; i>tmflo[i]; - if (verbose>4) cout<<"Vertices "<4) std::cout<<"Vertices "<nofile); ok=this->insert_key(tmp,montab); Ff>>subnumber; - if (verbose>2) cout<<"NumberOfSubdomains="<>tmint[i]; - if (verbose>4) cout<<"Subdomains "<2) std::cout<<"NumberOfSubdomains="<::max(); + //pb from tepalv2 + bool isproblem=true; + for (int i=0; i>onelong; + //pb from tepalv2 + if (onelong<0) { + if (isproblem && verbose>1) std::cout<<"There is one or more negative med_int value in NumberOfSubdomains "<maxint) { + if (isproblem && verbose>1) std::cout<<"There is one or more truncated med_int value in NumberOfSubdomains "<4) std::cout<<"Subdomains "<nofile); @@ -698,7 +736,7 @@ bool ghs3dprl_mesh_wrap::ReadFileNOBOITEB(const QString FileName) { bool ok; QString tmp; - cerr<<"Problem function ReadFileNOBOITEB\n" + std::cerr<<"Problem function ReadFileNOBOITEB\n" <<"(no FORTRAN binary format files in tepal)\n\n"; //file binary FILE *Ff=fopen(FileName.toLatin1().constData(),"rb"); @@ -709,24 +747,24 @@ bool ghs3dprl_mesh_wrap::ReadFileNOBOITEB(const QString FileName) //=> 2*long(68) (68=17*4octets) long r1[17+2]; if (!Ff){ - cerr<<"Problem File '"<3){ - cout<<"NoboitebNumberOfElements="<4) std::cout<<"Elements "<nofile); ok=this->insert_key(tmp,montab); fread(&reste,sizeof(long),1,Ff); - //cout<<"info "<2) cout<<"NumberOfSubdomains="<2) std::cout<<"NumberOfSubdomains="<2) cout<<"NumberOfVertices="<2) std::cout<<"NumberOfVertices="< size="<size< size="<size<verbose>6) cout<<"remove key "<verbose>6) std::cout<<"remove key "< it(this->mestab); while ( it.hasNext() ){ it.next(); if (it.key().contains(rxp)) nbremove++; } - //cout<<"nb_key_mesh_wrap found "<tmint){ if (verbose>3) - cout<<"SwapOnFile_binary "<filename.toLatin1().constData()<< + std::cout<<"SwapOnFile_binary "<filename.toLatin1().constData()<< " NbElements "<tmint,sizeof(med_int),taille,fichier); //fread(&gagnants,sizeof(gagnants),1,fichier); } if (tab->tmflo){ if (verbose>3) - cout<<"SwapOnFile_binary "<filename.toLatin1().constData()<< + std::cout<<"SwapOnFile_binary "<filename.toLatin1().constData()<< " NbElements "<tmflo,sizeof(med_float),taille,fichier); } fclose(fichier); } else{ - if (verbose>3) cout<<"SwapOnFile in binary file done yet "<< - tab->filename.toLatin1().constData()<3) std::cout<<"SwapOnFile in binary file done yet "<< + tab->filename.toLatin1().constData()<CVWtab_deallocate(); //free memory @@ -956,9 +994,9 @@ long ghs3dprl_mesh_wrap::SwapOutOfMemory_key_mesh_wrap(const QRegExp &rxp, nb++; if ((it.value()->size>0)&&(it.value()->size>ifgreaterthan)){ if (verbose>3) - cout<<"SwapOutOfMemory_key_mesh_wrap on demand "<< + std::cout<<"SwapOutOfMemory_key_mesh_wrap on demand "<< it.key().toLatin1().constData()<< - " size "<size<<">"<size<<">"<path,it.value(),this->verbose); } @@ -971,34 +1009,34 @@ bool ghs3dprl_mesh_wrap::list_onekey_mesh_wrap(const QString &key) { CVWtab *montab=this->mestab[key]; if (montab){ - //cout<<"key "< size="<size< size="<size<type==1) for ( long i=0; isize; i++ ) - cout<tmint[i]<<" "; + std::cout<tmint[i]<<" "; if (montab->type==2) for ( long i=0; isize; i++ ) - cout<tmflo[i]<<" "; - cout<tmflo[i]<<" "; + std::cout<nbelem_limit_swap +//insertion conditionn� par limite this->nbelem_limit_swap //si tableaux contenus on dimension superieure //alors swap disque dans getenv(tmp) fichier temporaire binaire { bool ok; if (verbose>4) - cout<<"insert key "<nbelem_limit_swapsize) { - if (verbose>3) cout<<"insert key automatic SwapOnFile "<< - key.toLatin1().constData()<3) std::cout<<"insert key automatic SwapOnFile "<< + key.toLatin1().constData()<path,tab,this->verbose); } this->mestab.insert(key,tab); @@ -1006,48 +1044,48 @@ bool ghs3dprl_mesh_wrap::insert_key(const QString &key,CVWtab *tab) } //************************************ CVWtab* ghs3dprl_mesh_wrap::restore_key(const QString &key) -//retauration conditionnée par limite nbelem +//retauration conditionn� par limite nbelem //si tableaux contenus on dimension superieure a nbelem //alors swap disque dans getenv(tmp) fichier temporaire //alors lecture du fichier (et reallocate memory) { CVWtab *tab=NULL; tab=this->mestab[key]; - /*if (tab) cout<<" -> size in proc "<size< tab NULL\n";*/ + /*if (tab) std::cout<<" -> size in proc "<size< tab NULL\n";*/ if (!tab) //it is NOT a problem { - if (verbose>6) cout<<"restore key not found "<6) std::cout<<"restore key not found "<size > 0){ - if (verbose>5) cout<<"restore key direct from memory "<filename.toLatin1().constData()<< - " type unexpexted "<type<filename.toLatin1().constData()<< + " type unexpexted "<type<filename<filename<filename.toLatin1().constData(),"rb"); long taille; fread(&taille,sizeof(long),1,fichier); if (taille!=-tab->size){ - cerr<<"Problem restore_key from binary file "<filename.toLatin1().constData()<< - " size unexpexted "<size<filename.toLatin1().constData()<< + " size unexpexted "<size<type==1){ if (verbose>5) - cout<<"restore key from binary file "<filename.toLatin1().constData()<< + std::cout<<"restore key from binary file "<filename.toLatin1().constData()<< " number of elements "<tmint=new med_int[taille]; //allocate memory @@ -1055,16 +1093,16 @@ CVWtab* ghs3dprl_mesh_wrap::restore_key(const QString &key) } if (tab->type==2){ if (verbose>5) - cout<<"restore key from binary file "<filename.toLatin1().constData()<< + std::cout<<"restore key from binary file "<filename.toLatin1().constData()<< " number of elements "<tmflo=new med_float[taille]; //allocate memory for (int i=0; itmflo[i]=-1e0; fread(tab->tmflo,sizeof(med_float),taille,fichier); - /*for (int i=0; itmflo[i]<<"/"; - cout<tmflo[i]<<"/"; + std::cout<size=-tab->size; @@ -1088,26 +1126,26 @@ bool ghs3dprl_mesh_wrap::test_msg_wrap() if (ifile==ineig) continue; //impossible key1=key1.sprintf("MS%ld NE%ld ",ifile,ineig)+typ.section(' ',i,i)+" SE"; key2=key2.sprintf("MS%ld NE%ld ",ifile,ineig)+typ.section(' ',i,i)+" RE"; - //cout<<"key "<restore_key(key1); //tab1=this->mestab[key1]; tab2=this->restore_key(key2); //tab2=this->mestab[key2]; - //cout<<"sortie key "<is_equal(tab2)) - { cout<<"key "<restore_key(key2); //tab2=this->mestab[key2]; if (!tab1 && !tab2) continue; //case not neighbours if (!tab1) - { cout<<"key "<type!=tab2->type)||(tab1->size!=tab2->size)) - { cout<<"key "<size!=tab2->size) { - cerr<<"TestEqualityCoordinates key "<2)&&(ok1)) - cout<<"TestEqualityCoordinates "<size<< - " Vertices "<size<< + " Vertices "<size<< - " Vertices "<size<< + " Vertices "<restore_key(QString("SKIN_VERTICES_COORDINATES")); - if (verbose>4)cout<<"NumberVerticesSKIN="<size/3<4)std::cout<<"NumberVerticesSKIN="<size/3<nbfiles; ifile++) { @@ -1264,11 +1302,11 @@ bool ghs3dprl_mesh_wrap::Find_VerticesDomainToVerticesSkin() key2=key2.sprintf("GL%ld VE",ifile); glodom=this->restore_key(key2); if (verbose>4) - cout<<"NumberVerticesDOMAIN_"<size<8){ - cout<<"\nglobal numbering nodes: no iglo\n"; + std::cout<<"\nglobal numbering nodes: no iglo\n"; for (jd=0; jd < glodom->size; jd++) - cout<<"\t"<tmint[jd]<tmint[jd]<size; jd=jd+3) { p2=(coodom->tmflo+jd); @@ -1290,8 +1328,8 @@ bool ghs3dprl_mesh_wrap::Find_VerticesDomainToVerticesSkin() p1=(cooskin->tmflo+js); if (p1[0]==p2[0] && p1[1]==p2[1] && p1[2]==p2[2]) { - cout<<"\t"<tmint[i]-1<< - key2.sprintf("\t%13.5e%13.5e%13.5e",p1[0],p1[1],p1[2]).toLatin1().constData()<tmint[i]-1<< + key2.sprintf("\t%13.5e%13.5e%13.5e",p1[0],p1[1],p1[2]).toLatin1().constData()<insert_key(tmp,montab); if (verbose>4){ - cout<<"NumberOfEqualsVerticesDOMAIN_"<tm_year+1900,time_asc->tm_mon+1,time_asc->tm_mday, time_asc->tm_hour,time_asc->tm_min); +#endif xmlNewProp(node, BAD_CAST "when", BAD_CAST buff); xmlNewProp(node, BAD_CAST "from", BAD_CAST "tepal2med"); @@ -1431,35 +1477,49 @@ bool ghs3dprl_mesh_wrap::Write_MEDfiles_v2(bool deletekeys) { bool ok=true,oktmp; QString tmp,cmd; - char description[MED_TAILLE_DESC]; + char description[MED_COMMENT_SIZE]; + char dtunit[MED_SNAME_SIZE+1]="_NO_UNIT"; + char axisname[MED_SNAME_SIZE*3+1]="x y z "; + char axisunit[MED_SNAME_SIZE*3+1]="_NO_UNIT _NO_UNIT _NO_UNIT "; med_int nb; //remove path //precaution because casename->med_nomfinal no more 32 character //if path, in this->path. //20 preserve for add postfixes "_idom" etc... - if (verbose>0)cout<<"\nWrite_MEDfiles_v2\n"; - if (verbose>6){cout<<"\nInitialFamilies\n"; families.write();} + if (verbose>0)std::cout<<"\nWrite_MEDfiles_v2\n"; + if (verbose>6){std::cout<<"\nInitialFamilies\n"; families.write();} medname=medname.section('/',-1); if (medname.length()>20) { - cerr<<"CaseNameMed truncated (no more 20 characters)"<0) cout<<"CreateMEDFile for all joints <"<\n"; + charendnull(distfilename,tmp,MED_COMMENT_SIZE); + fidjoint=MEDfileOpen(distfilename,MED_ACC_CREAT); + if (fidjoint<0) std::cerr<<"Problem MEDfileOpen "<0) std::cout<<"CreateMEDFile for all joints <"<\n"; //copy file source/GHS3DPRL_skin.med as destination/DOMAIN.skin.med tmp=path+medname+"_skin.med"; - cmd="cp "+pathini+casename+"_skin.med "+tmp; - //cout<<"Copy skin.med Command = "<0)cout<<"CreateMEDFile for initial skin <"<\n"; + cmd=pathini+casename+"_skin.med"; + int ret = access(cmd.toLatin1().constData(),F_OK); //on regarde si le fichier existe + if (ret >= 0) { +#ifdef WIN32 + cmd="copy "; +#else + cmd="cp "; +#endif + cmd = cmd+pathini+casename+"_skin.med "+tmp; + //std::cout<<"Copy skin.med Command = "<0) std::cout<<"CreateMEDFile for initial skin <"<\n"; } + else { + if (verbose>0) std::cout<<"No CreateMEDFile <"< for initial skin because <"<< + cmd.toLatin1().constData()<<"> does not exist\n"; } //define family 0 if not existing, no groups families.add("0",""); @@ -1469,45 +1529,45 @@ bool ghs3dprl_mesh_wrap::Write_MEDfiles_v2(bool deletekeys) oktmp=families.get_number_of_new_family(1,&famallnodes,&tmp); families.add(tmp,"All_Nodes"); } - else if (verbose>3) cout<<"--deletegroups matches \"All_Nodes\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"All_Nodes\"\n"; famalltria3=0; if (QString("All_Faces").contains(deletegroups)==0){ oktmp=families.get_number_of_new_family(-1,&famalltria3,&tmp); families.add(tmp,"All_Faces"); } - else if (verbose>3) cout<<"--deletegroups matches \"All_Faces\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"All_Faces\"\n"; famalltetra4=0; if (QString("All_Tetrahedra").contains(deletegroups)==0){ oktmp=families.get_number_of_new_family(-1,&famalltetra4,&tmp); families.add(tmp,"All_Tetrahedra"); } - else if (verbose>3) cout<<"--deletegroups matches \"All_Tetrahedra\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"All_Tetrahedra\"\n"; famnewnodes=0; if (QString("New_Nodes").contains(deletegroups)==0){ oktmp=families.get_number_of_new_family(1,&famnewnodes,&tmp); families.add(tmp,"New_Nodes"); } - else if (verbose>3) cout<<"--deletegroups matches \"New_Nodes\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"New_Nodes\"\n"; famnewtria3=0; if (QString("New_Faces").contains(deletegroups)==0){ oktmp=families.get_number_of_new_family(-1,&famnewtria3,&tmp); families.add(tmp,"New_Faces"); } - else if (verbose>3) cout<<"--deletegroups matches \"New_Faces\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"New_Faces\"\n"; famnewtetra4=0; if (QString("New_Tetrahedra").contains(deletegroups)==0){ oktmp=families.get_number_of_new_family(-1,&famnewtetra4,&tmp); families.add(tmp,"New_Tetrahedra"); } - else if (verbose>3) cout<<"--deletegroups matches \"New_Tetrahedra\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"New_Tetrahedra\"\n"; - if (verbose>6){cout<<"\nIntermediatesFamilies\n"; families.write();} - if (verbose>6) cout<<"\nNumber0fFiles="<6){std::cout<<"\nIntermediatesFamilies\n"; families.write();} + if (verbose>6) std::cout<<"\nNumber0fFiles="<1) families=intermediatesfamilies; //if (idom>1) continue; tmp=path+medname+tmp.sprintf("_%d.med",idom); - charendnull(distfilename,tmp,MED_TAILLE_DESC); + charendnull(distfilename,tmp,MED_COMMENT_SIZE); - //cout<<"<"<"<"<0){ - if (verbose>2) cout<\n"; + if (verbose>2) std::cout<\n"; } //create mesh tmp=medname+tmp.sprintf("_%d",idom); - charendnull(nomfinal,tmp,MED_TAILLE_NOM); + charendnull(nomfinal,tmp,MED_NAME_SIZE); tmp=tmp.sprintf("domain %d among %d",idom,nbfilestot); - charendnull(description,tmp,MED_TAILLE_DESC); + charendnull(description,tmp,MED_COMMENT_SIZE); - if (verbose>4) cout<<"Description : "<4) std::cout<<"Description : "<6){cout<<"\nFinalsFamilies\n"; families.write();} + if (verbose>6){std::cout<<"\nFinalsFamilies\n"; families.write();} //for nodes families nb=create_families(fid,1); - if (verbose>5)cout<<"NumberOfFamiliesNodes="<5)std::cout<<"NumberOfFamiliesNodes="<8) - cout<<"MEDfamEcr nodes "<5)cout<<"NumberOfFamiliesFacesAndEdgesEtc="<5)std::cout<<"NumberOfFamiliesFacesAndEdgesEtc="<8) - cout<<"MEDfamEcr tria3 "<8) - cout<<"MEDfamEcr tetra4 "<0)cout<<"\nTotalNumberOftetrahedra="<0)std::cout<<"\nTotalNumberOftetrahedra="<remove_key_mesh_wrap(QRegExp(tmp,true,true)); xx=this->remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp)); nbnodes=tab->size/3; - err=MEDcoordEcr(fid,nomfinal,3,tab->tmflo,MED_FULL_INTERLACE, - nbnodes,MED_CART,nomcoo,unicoo); - if (err<0) {cerr<<"Problem MEDcoordEcr"<4)cout<<"NumberOfNodes="<tmflo); + if (err<0) {std::cerr<<"Problem MEDmeshNodeCoordinateWr"<4)std::cout<<"NumberOfNodes="<restore_key(key1); //tab1=this->mestab[key1]; if (!tab1) { tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfilestot,idom)+".glo"; ok=this->ReadFileGLO(tmp); - if (!ok) {cerr<<"Problem file "<restore_key(key1); //tab1=this->mestab[key1]; if (!tab1) return false; } - if (nbnodes!=tab1->size){cerr<<"Problem size GLi VE!=nbnodes!"<size){std::cerr<<"Problem size GLi VE!=nbnodes!"<restore_key(key2); //tab1=this->mestab[key1]; - med_int nbskin=tab2->size; - //for (i=0; itmint[i]<size; + //for (i=0; itmint[i]<tmint[j]<< + //std::cout<<"nodes loc "<tmint[j]<< // tmp.sprintf("\t%23.15e%23.15e%23.15e",tab3->tmflo[i*3], - // tab3->tmflo[i*3+1],tab3->tmflo[i*3+2])<tmflo[i*3+1],tab3->tmflo[i*3+2])<tmint,nbnodes,MED_NOEUD,MED_NONE); - if (err<0){cerr<<"Problem MEDglobalNumEcr nodes"<tmint); + if (err<0){std::cerr<<"Problem MEDmeshGlobalNumberWr nodes"< newfam "< newfam "<300) cout<< - "***set_one_more_family*** warning many initial families could decrease speed "<300) std::cout<< + "***set_one_more_family*** warning many initial families could decrease speed "< newfam "< newfam "<=0) newfami[ii]=newfam; } /*else { - cout<<"!!! oldfam "< newfam "< newfam "<size/7; - if (verbose>4) cout<<"NumberOfTriangles="<4) std::cout<<"NumberOfTriangles="<tmint[i+2]; ii++; i=i+7; } - err=MEDconnEcr(fid,nomfinal,3,arrayi,MED_FULL_INTERLACE,nbtria3,MED_MAILLE,MED_TRIA3,MED_NOD); + err=MEDmeshElementConnectivityWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,0.,MED_CELL,MED_TRIA3,MED_NODAL,MED_FULL_INTERLACE,nbtria3,arrayi); delete[] arrayi; //need immediately more little array - if (err<0){cerr<<"Problem MEDconnEcr for triangles connectivity"< arrayi[i]=!NBFACES!+i+1 arrayi=new med_int[nbtria3]; for (i=0; irestore_key(key1); //tab1=this->mestab[key1]; - if (nbtria3!=tab1->size){cerr<<"Problem size GLi FA!=nbtria3!"<size){std::cerr<<"Problem size GLi FA!=nbtria3!"<restore_key(key2); //tab1=this->mestab[key1]; - med_int nbskin=tab2->size; - + med_int nbskin=0; + if (tab2) nbskin=tab2->size; + //set families of faces existing in GHS3DPRL_skin.med med_int nb=nbtria3; famtria3=new med_int[nb]; @@ -1838,12 +1899,12 @@ bool ghs3dprl_mesh_wrap::idom_faces() } ok=set_one_more_family(famtria3,fammore,nb); delete[] fammore; - + //writing faces(triangles) global numbering - //if (verbose>2) - // cout<<"CreateMEDglobalNumerotation_Faces "<size<tmint,tab1->size,MED_MAILLE,MED_TRIA3); - if (err<0){cerr<<"Problem MEDglobalNumEcr faces"<2) + std::cout<<"CreateMEDglobalNumerotation_Faces "<size<size,tab1->tmint); + if (err<0){std::cerr<<"Problem MEDmeshGlobalNumberWr faces"<remove_key_mesh_wrap(QRegExp("FC*",true,true)); tmp=tmp.sprintf("GL%d FA",idom); @@ -1864,14 +1925,17 @@ bool ghs3dprl_mesh_wrap::idom_joints() CVWtab *tab,*tab1,*tab2; med_int ineig,ii,jj,i,j,k,*arrayi,nb,famjoint,*fammore,*inodes,*arrayfaces; med_float *arraynodes; - char namejnt[MED_TAILLE_NOM+1]; //no more 32 - char namedist[MED_TAILLE_NOM+1]; - char descjnt[MED_TAILLE_DESC+1]; + char namejnt[MED_NAME_SIZE+1]; //no more 32 + char namedist[MED_NAME_SIZE+1]; + char descjnt[MED_COMMENT_SIZE+1]; med_int numfam_ini_wrap=100; joints_node=xmlNewNode(NULL, BAD_CAST "joints"); //masterfile.xml med_int nbjoints=0,nbnodesneig,nbtria3neig; - string sjoints=""; //which domains are neighbourg + std::string sjoints=""; //which domains are neighbourg int xx; + char dtunit[MED_SNAME_SIZE+1]="_NO_UNIT"; + char axisname[MED_SNAME_SIZE*3+1]="x y z "; + char axisunit[MED_SNAME_SIZE*3+1]="_NO_UNIT _NO_UNIT _NO_UNIT "; tmp=tmp.sprintf("MS%d *",idom); //read file .msg if not done @@ -1891,7 +1955,7 @@ bool ghs3dprl_mesh_wrap::idom_joints() tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfilestot,idom)+".msg"; ok=this->ReadFileMSGnew(tmp); if (!ok) { - cerr<<"Problem in file "<no joints - key1=key1.sprintf("MS%d NE%d VE RE",idom,ineig); //SE or RE - tab2=tab1; //tab2=this->restore_key(key1); //no need because equals - if (!tab2) cerr<<"Problem nodes joint with no in file .msg"<size; nbnodesneig=nb; + key1=key1.sprintf("MS%d NE%d VE SE",ineig,idom); //SE or RE identicals + tab2=this->restore_key(key1); + //if not yet loaded (first time) try to load necessary file msg of neighbourg + if (!tab2) { + tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfilestot,ineig)+".msg"; + this->nofile=ineig; //neighbourg file + ok=this->ReadFileMSGnew(tmp); + this->nofile=idom; //restaure initial domain + if (!ok) { + std::cerr<<"Problem in file "<restore_key(key1); + } + if (!tab2) std::cerr<<"Problem existing nodes joint in domain "<size; nbnodesneig=tab2->size; + if (nb!=nbnodesneig) { + std::cerr<<"Problem in file "<"<4) - cout<<"NumberOfNodesOfJoint_"<restore_key(key); //tab1=this->mestab[key1]; @@ -1950,63 +2035,77 @@ bool ghs3dprl_mesh_wrap::idom_joints() arrayi[ii]=tab1->tmint[i]; ii++; arrayi[ii]=tab2->tmint[i]; ii++; } - ok=set_one_more_family(famnodes,fammore,nbnodes); + if (namejoint.contains(deletegroups)==0){ + ok=set_one_more_family(famnodes,fammore,nbnodes); + } delete[] fammore; - err=MEDjointEcr(fid,nomfinal,namejnt,arrayi,nb, - MED_NOEUD,MED_NONE,MED_NOEUD,MED_NONE); - if (err<0) cerr<<"Problem MEDjointEcr nodes"<restore_key(key1); //tab1=this->mestab[key1]; if (!tab1){ if (verbose>4) - cout<<"NumberOfTrianglesOfJoint_"<no joints } else //have to set xml may be no faces but nodes in a joint! { - key1=key1.sprintf("MS%d NE%d FA RE",idom,ineig); //SE or RE? - tab2=tab1; //tab2=this->restore_key(key1); //no need because equals - if (!tab2) cerr<<"Problem triangles joint send with no receive"<restore_key(key1); + if (!tab2) std::cerr<<"Problem existing triangles of joint in domain "<size; nbtria3neig=tab2->size; + if (nb!=nbtria3neig) { + std::cerr<<"Problem in file "<"<restore_key(key); //tab1=this->mestab[key1]; med_int nb=tab1->size; nbtria3neig=nb; if (verbose>4) - cout<<"NumberOfTrianglesOfJoint_"<0) { - //for (i=0; iremove_key_mesh_wrap(QRegExp(tmp,true,true)); xx=this->remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp)); - tmp=tmp.sprintf("MS%d NE*",idom); + //tmp=tmp.sprintf("MS%d NE*",idom); //qt3 xx=this->remove_key_mesh_wrap(QRegExp(tmp,true,true)); - xx=this->remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp)); + //xx=this->remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp)); tmp=tmp.sprintf("FC%d",idom); //qt3 xx=this->remove_key_mesh_wrap(QRegExp(tmp,true,true)); xx=this->remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp)); @@ -2093,17 +2191,17 @@ bool ghs3dprl_mesh_wrap::idom_tetras() tab1=this->restore_key(key1); //tab1=this->mestab[key1]; nbtetra4=tab1->size/4; nbtetrastotal=nbtetrastotal + nbtetra4; - if (verbose>5)cout<<"NumberOftetrahedra="<tmint,MED_FULL_INTERLACE,nbtetra4,MED_MAILLE,MED_TETRA4,MED_NOD); - if (err<0){cerr<<"Problem MEDconnEcr for tetra connectivity"<5)std::cout<<"NumberOftetrahedra="<tmint); + if (err<0){std::cerr<<"Problem MEDmeshElementConnectivityWr for tetra connectivity"<size!=nbtetra4){ - cerr<<"Problem incorrect size of tetrahedra global numbering"<2) - cout<<"CreateMEDglobalNumerotation_tetrahedra "<size<tmint,tab1->size,MED_MAILLE,MED_TETRA4); - if (err<0){cerr<<"Problem MEDglobalNumEcr tetrahedra"<size<size,tab1->tmint); + if (err<0){std::cerr<<"Problem MEDmeshGlobalNumberWr tetrahedra"<remove_key_mesh_wrap(QRegExp(tmp,true,true)); @@ -2138,8 +2236,8 @@ med_int ghs3dprl_mesh_wrap::create_families(med_idt fid, int sign) //if sign >= 0 family zero and family nodes { med_int pas,ires; - char nomfam[MED_TAILLE_NOM+1]; //it.current()->name; - char attdes[MED_TAILLE_DESC+1]="_NO_DESCRIPTION"; + char nomfam[MED_NAME_SIZE+1]; //it.current()->name; + char attdes[MED_COMMENT_SIZE+1]="_NO_DESCRIPTION"; char *gro; med_int i,attide=1,attval=1,natt=1,num,ngro; @@ -2152,28 +2250,26 @@ med_int ghs3dprl_mesh_wrap::create_families(med_idt fid, int sign) num=(*it1).first.toLong(); if ((pas==-1) && (num>=0)) continue; //not good families if ((pas== 1) && (num< 0)) continue; //not good families - charendnull(nomfam,(*it1).first,MED_TAILLE_NOM); + charendnull(nomfam,(*it1).first,MED_NAME_SIZE); ires++; //med_int natt=0; ngro=(*it1).second.size(); if (verbose>5) - cout<<"CreateFamilyInMEDFile <"<\tNbGroups="<\tNbGroups="<5)cout<<" <"<<&gro[i*MED_TAILLE_LNOM]<<"> "; + charendnull(&gro[i*MED_LNAME_SIZE],(*it2).first,MED_LNAME_SIZE); + if (verbose>5)std::cout<<" <"<<&gro[i*MED_LNAME_SIZE]<<"> "; i++; } - if (verbose>5)cout<5)std::cout< +#include #include +#include #include -//Med File V 2.2 attributes -#undef MED_H -#undef MED_PROTO_H -namespace med_2_2 { - extern "C" { -#include -#include - } -} - #include #include #include #include -using namespace std; -using namespace med_2_2; +//Med File V 2.2 attributes +//#undef MED_H +//#undef MED_PROTO_H + + extern "C" { +#include +//#include + } class CVWtab //contains size=size of vector and the vector (med_int or med_float) @@ -67,8 +63,8 @@ public: bool is_equal(CVWtab *tab2); }; -typedef map fend; -typedef map fagr; +typedef std::map fend; +typedef std::map fagr; class familles{ private: void newfam(QString nom); @@ -101,8 +97,8 @@ public: med_int idom; //master.xml - string filemaster,domainname; - char distfilename[MED_TAILLE_DESC]; + std::string filemaster,domainname; + char distfilename[MED_COMMENT_SIZE]; xmlDocPtr master_doc; xmlNodePtr root_node,node,node2, joints_node,info_node,files_node,mesh_node; @@ -111,16 +107,16 @@ public: familles families; //from skin.med - char nommaa[MED_TAILLE_NOM+1]; - char maillage_description[MED_TAILLE_DESC+1]; - char nomcoo[3*MED_TAILLE_PNOM+1]; - char unicoo[3*MED_TAILLE_PNOM+1]; + char nommaa[MED_NAME_SIZE+1]; + char maillage_description[MED_COMMENT_SIZE+1]; + char nomcoo[3*MED_SNAME_SIZE+1]; + char unicoo[3*MED_SNAME_SIZE+1]; med_int *famnodesskin; //from skin.med... med_int *famseg2skin; //...valid on global index/numerotation med_int *famtria3skin; //to final files .med with tetrahedra - char nomfinal[MED_TAILLE_NOM+1]; + char nomfinal[MED_NAME_SIZE+1]; med_int *famnodes,nbnodes,famnewnodes,famallnodes; //to final files .med with tetrahedra med_int *famseg2,nbseg2,famnewseg2,famallseg2; med_int *famtria3,nbtria3,famnewtria3,famalltria3; diff --git a/src/tepal2med/ghs3dprl_msg_parser.cxx b/src/tepal2med/ghs3dprl_msg_parser.cxx index 08badd1..4995891 100755 --- a/src/tepal2med/ghs3dprl_msg_parser.cxx +++ b/src/tepal2med/ghs3dprl_msg_parser.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,20 +16,17 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : ghs3dprl_mesh_parser.cxx // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) -// // --- - +// #include #include "ghs3dprl_msg_parser.h" #include "ghs3dprl_mesh_wrap.h" -using namespace med_2_2; - //************************************ bool ghs3dprl_msg_parser::startDocument() { @@ -57,9 +54,9 @@ bool ghs3dprl_msg_parser::startDocument() //************************************ bool ghs3dprl_msg_parser::startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &attrs) + const QString &localName, + const QString &qName, + const QXmlAttributes &attrs) { bool ok; if (verbose) std::cout<nofile,neighbourindice)+ - shorttypel+shortsendreceive; + mailw->nofile,neighbourindice)+ + shorttypel+shortsendreceive; tmp=tmp.simplified(); ok=mailw->insert_key(tmp,montab); return true; diff --git a/src/tepal2med/ghs3dprl_msg_parser.h b/src/tepal2med/ghs3dprl_msg_parser.h index dafc39c..76067cd 100755 --- a/src/tepal2med/ghs3dprl_msg_parser.h +++ b/src/tepal2med/ghs3dprl_msg_parser.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : ghs3dprl_mesh_parser.h // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA) -// // --- - +// #ifndef GHS3DPRL_MSG_PARSER_H #define GHS3DPRL_MSG_PARSER_H diff --git a/src/tepal2med/tepal2med.cxx b/src/tepal2med/tepal2med.cxx index d6c27b0..bbbdf4f 100755 --- a/src/tepal2med/tepal2med.cxx +++ b/src/tepal2med/tepal2med.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D +// Copyright (C) 2007-2012 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 @@ -16,13 +16,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // --- -// // File : tepal2med.cxx // Author : Christian VAN WAMBEKE (CEA) -// // --- - +// /* ** prog principal de ghs3dprl */ @@ -30,11 +29,17 @@ #include /* printf clrscr fopen fread fwrite fclose */ #include #include +#include #include #include #include +#include +#ifndef WIN32 +#include +#endif #include + #include #include #include @@ -42,20 +47,22 @@ #include "ghs3dprl_msg_parser.h" #include "dlg_ghs3dmain.h" +#ifdef WIN32 +#include +#include +#define F_OK 0 +#endif + //#include "MEDMEM_Exception.hxx" //#include "MEDMEM_define.hxx" extern "C" { #include //#include -#include +//#include //#include -#include } -using namespace std; -using namespace med_2_2; - //************************************ med_idt ouvre_fichier_MED(char *fichier,int verbose) { @@ -68,27 +75,28 @@ med_idt ouvre_fichier_MED(char *fichier,int verbose) if (ret < 0) return fid; /* on regarde s'il s'agit d'un fichier au format HDF5 */ - ret = MEDformatConforme(fichier); + med_bool hdfok,medok; + ret = MEDfileCompatibility(fichier,&hdfok,&medok); if (ret < 0){ - cerr<<"File "<0)fprintf(stdout,"\nReading %s with MED V%d.%d.%d", fichier,majeur,mineur,release); /* Ouverture du fichier MED en lecture seule */ - fid = MEDouvrir(fichier,MED_LECTURE); + fid = MEDfileOpen(fichier,MED_ACC_RDONLY); if (ret < 0) return fid; - MEDversionLire(fid, &majeur, &mineur, &release); + MEDfileNumVersionRd(fid, &majeur, &mineur, &release); if (majeur < 2 || majeur == 2 && mineur < 2) { fprintf(stderr,"File %s from MED V%d.%d.%d not assumed\n", fichier,majeur,mineur,release); - //" version est antérieure à la version 2.2"; - ret = MEDfermer(fid); + //" version est ant�ieure �la version 2.2"; + ret = MEDfileClose(fid); fid=0; } else { if (verbose>0)fprintf(stdout,", file from MED V%d.%d.%d\n",majeur,mineur,release); } @@ -101,75 +109,78 @@ bool ReadFileMED(QString nomfilemed,ghs3dprl_mesh_wrap *mymailw) { med_err ret; med_idt fid=0; - med_int i,j,mdim,nmaa,edim,majeur_lu,mineur_lu,release_lu,nprofils; - med_maillage type_maillage; + med_int i,j,sdim,mdim,nmaa,edim,majeur_lu,mineur_lu,release_lu,nprofils,nstep; + med_mesh_type type_maillage; + char dtunit[MED_SNAME_SIZE+1]; + char axisname[MED_SNAME_SIZE+1]; + char axisunit[MED_SNAME_SIZE*3+1]; + med_sorting_type sortingtype; + med_axis_type axistype; int numero=1; - med_connectivite typ_con=MED_NOD; QString key,tmp; - + med_bool chan; + med_bool tran; + //version qt3 - char chaine[nomfilemed.length()+1]; + char* chaine = (char*)malloc((nomfilemed.length()+1)*sizeof(char)); strncpy(chaine,nomfilemed.toLatin1().constData(),nomfilemed.length()+1); - //cout<<"*** ReadFileMED *** "<verbose); + free(chaine); if (fid == 0) { - cerr<<"Problem opening file "< 1) cout<<"More than one mesh in "<nommaa,&mdim,&type_maillage, - mymailw->maillage_description); + if (nmaa > 1) std::cout<<"More than one mesh in "<nommaa,&sdim,&mdim,&type_maillage,mymailw->maillage_description, + dtunit,&sortingtype,&nstep,&axistype,axisname,axisunit); if (ret < 0){ - cerr<<"Problem MEDmaaInfo in "<nommaa); - if (!((edim == 3)||(edim == -1))){ - cerr<<"Problem dimension Espace should be 3 or -1: "<nommaa,MED_COOR,MED_NOEUD, - (med_geometrie_element)0,(med_connectivite)0); + //cf med-3.0.0_install/share/doc/html/maillage_utilisateur.html + med_int nnoe=MEDmeshnEntity(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT, + MED_NODE,MED_NO_GEOTYPE,MED_COORDINATE,MED_NO_CMODE,&chan,&tran); + //(med_geometrie_element)0,(med_connectivite)0); if (nnoe<1){ - cerr<<"Problem number of Vertices < 1\n"; - ret = MEDfermer(fid); + std::cerr<<"Problem number of Vertices < 1\n"; + ret = MEDfileClose(fid); return false; } //nombre d'objets MED : mailles, faces, aretes , ... - med_int nmailles[MED_NBR_GEOMETRIE_MAILLE],nbtria3; - med_int nfaces[MED_NBR_GEOMETRIE_FACE]; - med_int naretes[MED_NBR_GEOMETRIE_ARETE],nbseg2; + med_int nmailles[MED_N_CELL_GEO],nbtria3; + med_int nfaces[MED_N_FACE_GEO]; + med_int naretes[MED_N_EDGE_FIXED_GEO],nbseg2; + //med_int nmailles[MED_NBR_GEOMETRIE_MAILLE],nbtria3; + //med_int nfaces[MED_NBR_GEOMETRIE_FACE]; + //med_int naretes[MED_NBR_GEOMETRIE_ARETE],nbseg2; //polygones et polyedres familles equivalences joints med_int nmpolygones,npolyedres,nfpolygones,nfam,nequ,njnt; @@ -177,244 +188,221 @@ bool ReadFileMED(QString nomfilemed,ghs3dprl_mesh_wrap *mymailw) /*for (i=0;inommaa,MED_CONN,MED_MAILLE,typmai[i],typ_con); //lecture_nombre_mailles_standards(fid,nommaa,typmai[i],typ_con,i); - if (mymailw->verbose>6) cout<<"NumberOf"<verbose>6) std::cout<<"NumberOf"<nommaa,MED_CONN,MED_MAILLE,MED_TRIA3,typ_con); - nbseg2=MEDnEntMaa(fid,mymailw->nommaa,MED_CONN,MED_MAILLE,MED_SEG2,typ_con); - - //Combien de mailles polygones quelconques ? - //nmpolygones = lecture_nombre_mailles_polygones(fid,nommaa,typ_con); - //Combien de mailles polyedres quelconques ? - //npolyedres = lecture_nombre_mailles_polyedres(fid,nommaa,typ_con); + + nbtria3=MEDmeshnEntity(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT, + MED_CELL,MED_TRIA3,MED_CONNECTIVITY,MED_NODAL,&chan,&tran); + nbseg2=MEDmeshnEntity(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT, + MED_CELL,MED_SEG2,MED_CONNECTIVITY,MED_NODAL,&chan,&tran); //combien de familles ? - nfam=MEDnFam(fid,mymailw->nommaa); + nfam=MEDnFamily(fid,mymailw->nommaa); if (mymailw->verbose>2) { - cout<<"\nNumberOfFamilies="< famdelete = std::vector(nfam); { - med_int natt,ngro; - char *attdes,*gro; - med_int *attval,*attide; - char nomfam[MED_TAILLE_NOM+1]; + med_int ngro; + char *gro; + char nomfam[MED_NAME_SIZE+1]; med_int numfam; - char str1[MED_TAILLE_DESC+1]; - char str2[MED_TAILLE_LNOM+1]; + char str1[MED_COMMENT_SIZE+1]; + char str2[MED_LNAME_SIZE+1]; med_err ret = 0; for (i=0;inommaa,i+1); + ngro = MEDnFamilyGroup(fid,mymailw->nommaa,i+1); if (ngro < 0){ - cerr<<"Problem reading number of groups of family\n"; - continue; - } - - //nombre d'attributs - natt = MEDnAttribut(fid,mymailw->nommaa,i+1); - if (natt < 0){ - cerr<<"Problem reading number of attributes of family\n"; + std::cerr<<"Problem reading number of groups of family\n"; continue; } - //nom,numero,attributs,groupes + //atributs obsolete MED3 //allocation memoire par exces - attide = (med_int*) malloc(sizeof(med_int)*(natt+1)); - attval = (med_int*) malloc(sizeof(med_int)*(natt+1)); - attdes = (char *) malloc(MED_TAILLE_DESC*(natt+1)); - gro = (char*) malloc(MED_TAILLE_LNOM*(ngro+1)); + gro = (char*) malloc(MED_LNAME_SIZE*(ngro+1)); - ret = MEDfamInfo(fid,mymailw->nommaa,i+1,nomfam,&numfam,attide,attval, - attdes,&natt,gro,&ngro); + ret = MEDfamilyInfo(fid,mymailw->nommaa,i+1,nomfam,&numfam,gro); if (ret < 0){ - cerr<<"Problem reading informations of family\n"; + std::cerr<<"Problem reading informations of family\n"; continue; } if (mymailw->verbose>8) { - cout<<"Family "<deletegroups)>0) { - //cout<<"idelete++ "<0) { //only delete family whith all delete groups - //cout<<"famdelete++ "<deletegroups)==0){ if (sgro.contains(qgroup)>0) { sgro="Skin_"+sgro; //pas sur que ce soit pertinent } - if (mymailw->verbose>8) cout<<"families.add("<verbose>8) std::cout<<"families.add("<families.add(sfam,sgro); } else { //sgro="Skin_"+sgro; //pas sur que ce soit pertinent - //cout<<"--deletegroups matches \""<verbose>3) cout<<"--deletegroups matches \""<< + //std::cout<<"--deletegroups matches \""<verbose>3) std::cout<<"--deletegroups matches \""<< sgro.toLatin1().constData()<< - "\" in family "<deletegroups)==0){ //sgro="Skin_"+sgro; //pas sur que ce soit pertinent - cout<<"families.add("<families.add(sfam,sgro); } else { - cout<<"--deletegroups matches \""<verbose>3){ - cout<<"\nFamiliesAndGroupsOf "<families.write(); } - - med_repere rep; - med_mode_switch mode_coo=MED_FULL_INTERLACE; - /* Allocations memoires */ - /* table des coordonnees profil : (dimension * nombre de noeuds ) */ - med_float *coo=new med_float[nnoe*mdim]; + /* table des coordonnees profil : (space dimension * nombre de noeuds ) */ + med_float *coo=new med_float[nnoe*sdim]; /* table des numeros de familles des noeuds profil : (nombre de noeuds) */ med_int *famnodesskin=new med_int[nnoe]; med_int *pfltab=new med_int[1]; //inutilise car on lit tout //lecture des noeuds : coordonnees - ret=MEDcoordLire(fid,mymailw->nommaa,mdim,coo, - mode_coo,MED_ALL, - pfltab,0,&rep,mymailw->nomcoo,mymailw->unicoo); + ret=MEDmeshNodeCoordinateRd(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT,MED_FULL_INTERLACE,coo); + //mdim,coo,mode_coo,MED_ALL,pfltab,0,&rep,mymailw->nomcoo,mymailw->unicoo); if (ret < 0){ - cerr<<"Problem reading nodes\n"; - ret = MEDfermer(fid); + std::cerr<<"Problem reading nodes\n"; + ret = MEDfileClose(fid); //return false; } - ret=MEDfamLire(fid,mymailw->nommaa,famnodesskin,nnoe,MED_NOEUD,(med_geometrie_element) 0); + ret=MEDmeshEntityFamilyNumberRd(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT,MED_NODE,MED_NONE,famnodesskin); + //famnodesskin,nnoe,MED_NOEUD,(med_geometrie_element) 0); if (ret < 0){ - cerr<<"Problem reading families of nodes\n"; - ret = MEDfermer(fid); + std::cerr<<"Problem reading families of nodes\n"; + ret = MEDfileClose(fid); return false; } if (mymailw->verbose>9) { - cout<<"\nVertices: no x y z family\n"; + std::cout<<"\nVertices: no x y z family\n"; for (i=0;inommaa,mdim,conn2,mode_coo, - pfltab,0,MED_MAILLE,MED_SEG2,MED_NOD); + ret=MEDmeshElementConnectivityRd(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT, + MED_CELL,MED_SEG2,MED_NODAL,MED_FULL_INTERLACE,conn2); + //mdim,conn2,mode_coo,pfltab,0,MED_MAILLE,MED_SEG2,MED_NOD); if (ret < 0){ - cerr<<"Problem reading MED_SEG2\n"; - ret = MEDfermer(fid); + std::cerr<<"Problem reading MED_SEG2\n"; + ret = MEDfileClose(fid); //return false; } med_int *famseg2skin=new med_int[nbseg2]; - ret=MEDfamLire(fid,mymailw->nommaa,famseg2skin,nbseg2,MED_MAILLE,MED_SEG2); + ret=MEDmeshEntityFamilyNumberRd(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT,MED_CELL,MED_SEG2,famseg2skin); + //MEDfamLire(fid,mymailw->nommaa,famseg2skin,nbseg2,MED_MAILLE,MED_SEG2); if (ret < 0){ - cerr<<"Problem reading families of MED_SEG2\n"; - ret = MEDfermer(fid); + std::cerr<<"Problem reading families of MED_SEG2\n"; + ret = MEDfileClose(fid); return false; } if (mymailw->verbose>9) { - cout<<"\nConnectivity MED_SEG2: no node1 node2 family\n"; + std::cout<<"\nConnectivity MED_SEG2: no node1 node2 family\n"; for (i=0;inommaa,mdim,conn3,mode_coo, - pfltab,0,MED_MAILLE,MED_TRIA3,MED_NOD); + ret=MEDmeshElementConnectivityRd(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT, + MED_CELL,MED_TRIA3,MED_NODAL,MED_FULL_INTERLACE,pfltab); + //MEDconnLire(fid,mymailw->nommaa,mdim,conn3,mode_coo,pfltab,0,MED_MAILLE,MED_TRIA3,MED_NOD); if (ret < 0){ - cerr<<"Problem reading MED_TRIA3\n"; - ret = MEDfermer(fid); + std::cerr<<"Problem reading MED_TRIA3\n"; + ret = MEDfileClose(fid); //return false; } med_int *famtria3skin=new med_int[nbtria3]; - ret=MEDfamLire(fid,mymailw->nommaa,famtria3skin,nbtria3,MED_MAILLE,MED_TRIA3); + ret=MEDmeshEntityFamilyNumberRd(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,famtria3skin); + //MEDfamLire(fid,mymailw->nommaa,famtria3skin,nbtria3,MED_MAILLE,MED_TRIA3); if (ret < 0){ - cerr<<"Problem reading families of MED_TRIA3\n"; - ret = MEDfermer(fid); + std::cerr<<"Problem reading families of MED_TRIA3\n"; + ret = MEDfileClose(fid); return false; } if (mymailw->verbose>9) { - cout<<"\nConnectivity MED_TRIA3: no node1 node2 node3 family\n"; + std::cout<<"\nConnectivity MED_TRIA3: no node1 node2 node3 family\n"; for (i=0;iverbose>3){ delete[] nufano;*/ if (ifamdelete>0) { - //cout<<"!!!!!!!!nodes "<verbose>3){ //if (mymailw->verbose>6) ok=mymailw->list_keys_mesh_wrap(); - ret = MEDfermer(fid); + ret = MEDfileClose(fid); if (ret < 0){ - cerr<<"Problem closing "<2048){ //delirium in 2008 - cerr<<"--number: a positive integer <= 2048 is expected\n\n"; + std::cerr<<"--number: a positive integer <= 2048 is expected\n\n"; return 1; } if (!cmedname) cmedname=ccasename; @@ -627,11 +612,11 @@ int main(int argc, char *argv[]) tmp=climitswap; limit_swap=tmp.toLong(&ok,10); if (!ok){ - cerr<<"--limitswap: an integer is expected. try 1000\n\n"; + std::cerr<<"--limitswap: an integer is expected. try 1000\n\n"; return 1; } if (limit_swap<1 || limit_swap>32000){ - cerr<<"--limitswap: [1->32000] expected. try 1000\n\n"; + std::cerr<<"--limitswap: [1->32000] expected. try 1000\n\n"; return 1; } } @@ -644,11 +629,11 @@ int main(int argc, char *argv[]) tmp=cverbose; verbose=tmp.toLong(&ok,10); if (!ok){ - cerr<<"--verbose: an integer is expected\n\n"; + std::cerr<<"--verbose: an integer is expected\n\n"; return 1; } if (verbose<0){ - cerr<<"--verbose: a positive integer is expected\n\n"; + std::cerr<<"--verbose: a positive integer is expected\n\n"; return 1; } } @@ -676,12 +661,6 @@ int main(int argc, char *argv[]) tmp=cbackground; if (tmp=="yes") background="yes"; } - - meshholes="no"; //default - if (cmeshholes){ - tmp=cmeshholes; - if (tmp=="yes") meshholes="yes"; - } // We must always have an application @@ -692,7 +671,7 @@ int main(int argc, char *argv[]) m->show(); a.exec(); if ( m->result() == QDialog::Accepted ) { - cout<<"parameters "<KeepFiles()<<" "<NbPart()<KeepFiles()<<" "<NbPart()<NbPart(); } else { @@ -708,7 +687,7 @@ int main(int argc, char *argv[]) path="./"; casenamemed=casenamemed.section('/',-1); if (casenamemed.length()>20){ - cerr<<"--medname truncated (no more 20 characters)"<20){ - cerr<<"--casename truncated (no more 20 characters)"<0) - cout<<"tepal2med "< 0) { @@ -764,16 +738,17 @@ int main(int argc, char *argv[]) setsid(); system("sleep 10"); //for debug } +#else + printf("background mode is not supported on win32 platform !\n"); +#endif //"tepal -f exemple1 -n 4" if (launchtepal=="yes"){ //tepal64.exe -f /home/wambeke/tmp/GHS3DPRL -n 5 --tetmesh_args "-c 0" //cmd="tepal --tetmesh_args \"-c 0\" -f "+pathini+casename+" -n "+cmd.sprintf("%d",nbfiles)+" > "+path+"tepal.log"; - cmd="tepal -f "+pathini+casename+" -n "+cmd.sprintf("%d",nbfiles); - if (meshholes=="yes") cmd=cmd+" --tetmesh_args \"-c 0\""; - cmd=cmd+" > "+path+"tepal.log"; - cout<<"\nlaunchtepal command: background="< "+path+"tepal.log"; + std::cout<<"\nlaunchtepal command: background="<families.no=1; - //cout<<"coucou1 "<families.no<families.no<families.add(casename,casenamemed); format=format.sprintf("%d",nbfiles); int nbf=format.length(); @@ -810,11 +785,16 @@ int main(int argc, char *argv[]) char ctmp[fileskinmed.length()+1] ; strcpy(ctmp,fileskinmed); int res=dumpMED(&ctmp[0],1); }*/ - ok=ReadFileMED(fileskinmed,mymailw); + int ret = access(fileskinmed.toLatin1().constData(),F_OK); //on regarde si le fichier existe + if (ret >= 0) { + ok=ReadFileMED(fileskinmed,mymailw); } + else { + if (verbose>0)std::cout<<"Initial skin file <"< does not exist\n"; } + //if test read all files before (only small files) if (test=="yes"){ - if (verbose>0) cout<<"\nReading output files of tepal as input files of tepal2med...\n"; + if (verbose>0) std::cout<<"\nReading output files of tepal as input files of tepal2med...\n"; //read files .msg //supposed big files big arrays so don't read with parser @@ -822,13 +802,13 @@ int main(int argc, char *argv[]) for (int i=1; i<=nbfiles; i++){ mymailw->nofile=i; tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfiles,i)+".msg"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<ReadFileMSGnew(tmp); } if (verbose>0) - cout<<"NumberOfFilesMSGacquired="<nbfiles<<"\n\n"; + std::cout<<"NumberOfFilesMSGacquired="<nbfiles<<"\n\n"; if (mymailw->nbfiles != nbfiles){ - cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; + std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; return 1; } @@ -841,26 +821,26 @@ int main(int argc, char *argv[]) mymailw->nofile=i; //tmp=casename+tmp.sprintf(".%d.%d.msg",nbfiles,i); tmp=pathini+casename+tmp.sprintf(format,nbfiles,i)+".msg"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<0) - cout<<"NumberOfFilesMSGAcquired="<nbfiles<<"\n"; + std::cout<<"NumberOfFilesMSGAcquired="<nbfiles<<"\n"; if (mymailw->nbfiles != nbfiles){ - cerr<<"Problem NumberOfFiles != NumberOfFilesAcquired\n"; + std::cerr<<"Problem NumberOfFiles != NumberOfFilesAcquired\n"; return 1; } if (test=="yes"){ ok=mymailw->test_msg_wrap(); if (ok){ - if (verbose>0) cout<<"\nResult_test_msg_wrap=ok\n\n"; + if (verbose>0) std::cout<<"\nResult_test_msg_wrap=ok\n\n"; } else{ - cerr<<"\nResult_test_msg_wrap=NO_OK!\n\n"; + std::cerr<<"\nResult_test_msg_wrap=NO_OK!\n\n"; return 1; } } @@ -877,7 +857,7 @@ int main(int argc, char *argv[]) //because equals nb=0; nb=mymailw->remove_key_mesh_wrap(QRegExp("RE",Qt::CaseSensitive,QRegExp::RegExp)); - if (verbose>3) cout<<"NumberOfKeysRemoved="<3) std::cout<<"NumberOfKeysRemoved="<3) ok=mymailw->list_keys_mesh_wrap(); //test read files .noboiteb @@ -890,23 +870,23 @@ int main(int argc, char *argv[]) for (int i=1; i<=nbfiles; i++){ mymailw->nofile=i; tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfiles,i)+".noboite"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<ReadFileNOBOITE(tmp); } if (verbose>0) - cout<<"NumberOfFilesNOBOITEAcquired="<nbfiles<<"\n"; + std::cout<<"NumberOfFilesNOBOITEAcquired="<nbfiles<<"\n"; if (mymailw->nbfiles != nbfiles){ - cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n"; + std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n"; return 1; } //if (test=="yes"){ ok=mymailw->test_vertices_wrap(); if (ok){ - if (verbose>0) cout<<"\nResult_test_vertices_wrap=ok\n\n"; + if (verbose>0) std::cout<<"\nResult_test_vertices_wrap=ok\n\n"; } else{ - cerr<<"\nResult_test_vertices_wrap=NO_OK!\n\n"; + std::cerr<<"\nResult_test_vertices_wrap=NO_OK!\n\n"; return 1; } //} @@ -916,13 +896,13 @@ int main(int argc, char *argv[]) for (int i=1; i<=nbfiles; i++){ mymailw->nofile=i; tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfiles,i)+".faces"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<ReadFileFACES(tmp); } if (verbose>0) - cout<<"NumberOfFilesFACESAcquired="<nbfiles<<"\n\n"; + std::cout<<"NumberOfFilesFACESAcquired="<nbfiles<<"\n\n"; if (mymailw->nbfiles != nbfiles){ - cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; + std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; return 1; } @@ -932,14 +912,14 @@ int main(int argc, char *argv[]) for (int i=1; i<=nbfiles; i++){ mymailw->nofile=i; tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfiles,i)+".points"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<ReadFilePOINTS(tmp); } if (verbose>0) - cout<<"NumberOfFilesPOINTSAcquired="<nbfiles<<"\n\n"; + std::cout<<"NumberOfFilesPOINTSAcquired="<nbfiles<<"\n\n"; if (mymailw->nbfiles != nbfiles) { - cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; + std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; return 1; } */ @@ -950,14 +930,14 @@ int main(int argc, char *argv[]) for (int i=1; i<=nbfiles; i++){ mymailw->nofile=i; tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfiles,i)+".glo"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<ReadFileGLO(tmp); //mymailw->SwapOutOfMemory_key_mesh_wrap(QRegExp("GL",true,false)); } if (verbose>0) - cout<<"NumberOfFilesGLOAcquired="<nbfiles<<"\n\n"; + std::cout<<"NumberOfFilesGLOAcquired="<nbfiles<<"\n\n"; if (mymailw->nbfiles != nbfiles){ - cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; + std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; return 1; } @@ -977,7 +957,7 @@ int main(int argc, char *argv[]) //test remove points (type 3) //nb=mymailw->remove_key_mesh_wrap(QRegExp("PO",true,false)); - //cout<<"***remove_key_mesh_wrap*** remove nb="<0)cout<3)std::cout<<"***remove_all_key_mesh_wrap*** "<0)std::cout< Tepal V2 +example of use (when Tepal V2): + facespoints2mesh.py GHS3DPRL + tepal2med --casename=GHS3DPRL --number=12 --medname=DOMAIN --launchtepal=no + mesh2facespoints.py DOMAIN +""" + +import os +import sys + +file_fp='GHS3DPRL' +if len(sys.argv)==2: + file_fp=sys.argv[1] + +f1=file_fp+'.points' +f2=file_fp+'.faces' +f3=file_fp+'.mesh' + +fs=open(f1, 'r') +ft=open(f3, 'w') +ft.write('MeshVersionFormatted 1\n') +ft.write('\nDimension\n3\n') +tmp=fs.readline() +nb=int(tmp) +ft.write('\nVertices\n') +ft.write(tmp) +for i in xrange(0,nb): + lig=fs.readline() + ft.write(lig) +fs.close() + +fs=open(f2, 'r') +lig=fs.readline() +nb=int(lig.split()[0]) +ft.write('\nTriangles\n'+lig.split()[0]+'\n') +for i in xrange(0,nb): + lig=fs.readline() + lig=lig.split() + ft.write(lig[1]+' '+lig[2]+' '+lig[3]+' '+lig[4]+'\n') +ft.write('\nEnd\n') +ft.close() +print 'facespoints2mesh creation of file '+f3 diff --git a/src/tools/mesh2facespoints.py b/src/tools/mesh2facespoints.py new file mode 100755 index 0000000..f03b9b0 --- /dev/null +++ b/src/tools/mesh2facespoints.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2012 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 +# + +""" +these file is using in GHS3DPRL Plugin +to convert output files .mesh of Tepal V2 +to output files files .faces and .points of Tepal V1 +assume compatibility GHS3DPRL Plugin Tepal V1 => Tepal V2 +example of use (when Tepal V2): + facespoints2mesh.py GHS3DPRL + tepal2med --casename=GHS3DPRL --number=12 --medname=DOMAIN --launchtepal=no + mesh2facespoints.py DOMAIN +""" + +import os +import sys +import glob +import fileinput +import string + +file_m='GHS3DPRL' +if len(sys.argv)==2: + file_m=sys.argv[1] + +def find_cr_or_not(fs,tag): + """find number after tag with cr or sp""" + for line in fs: + if tag+'\n' in line: + #print tag+'' + res=fs.readline() + break + if tag+' ' in line: + #print 'vertices' + res=line.split()[1] + break + res=res.strip("\t\n ") + print tag+' '+res + return res + +def m2fp(f1): + """convert .mesh file to .points and .faces and .noboite""" + print '\nconversion '+f1+' to .points and .faces and .noboite' + #fs=open(f1, 'r') + #fs=fileinput.FileInput(f1,mode='r') #mode not in v2.4.4 + fs=fileinput.FileInput(f1) + (shortname, extension)=os.path.splitext(f1) + f2=shortname+'.points' + print 'creating',f2 + fp=open(f2, 'w') + nb=find_cr_or_not(fs,'Vertices') + np=nb #for .noboite + fp.write(nb+'\n') + for i in xrange(0,int(nb)): + fp.write(fs.readline()) + fp.close() + + f2=shortname+'.faces' + print 'creating',f2 + ff=open(f2, 'w') + nb=find_cr_or_not(fs,'Triangles') + ff.write(nb+' 0\n') + for i in xrange(0,int(nb)): + ff.write('3 '+fs.readline().strip('\t\n ')+' 0 0 0\n') + ff.close() + + ne=find_cr_or_not(fs,'Tetrahedra') + f3=shortname+'.noboite' + fb=open(f3, 'w') + npfixe="0" + fb.write(ne+' '+np+' '+npfixe+' 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n') + for i in xrange(0,int(ne)): + lig=fs.readline().strip('\t\n ') + lig=lig.split() + fb.write(lig[0]+" "+lig[1]+" "+lig[2]+" "+lig[3]+" ") + fb.write('\n') + fs.close() + fs=fileinput.FileInput(shortname+'.points') + nb=fs.readline() #eqal to np + for i in xrange(0,int(nb)): + lig=fs.readline().strip('\t\n ') + lig=lig.split() + fb.write(lig[0]+" "+lig[1]+" "+lig[2]+" ") + fb.write('\n0\n') #subnumber + fs.close() + fb.close() + +def rename_tepal_v1(f1,imax): + """rename files as version v1 of tepal expect""" + (shortname, extension)=os.path.splitext(f1) + fs=os.path.splitext(shortname) + i=int(fs[1].strip('.')) + ff=fs[0]+'.'+str(imax)+'.'+string.zfill(str(i),len(str(imax))) + #noboite en ".32.02.noboite!" + mvcp='mv ' #ou 'cp ' + f2=shortname+'.points' ; f3=ff+os.path.splitext(f2)[1] + print f2,'->',f3 ; os.system(mvcp+f2+' '+f3) + f2=shortname+'.faces' ; f3=ff+os.path.splitext(f2)[1] + print f2,'->',f3 ; os.system(mvcp+f2+' '+f3) + f2=shortname+'.noboite' ; f3=ff+os.path.splitext(f2)[1] + print f2,'->',f3 ; os.system(mvcp+f2+' '+f3) + f2=shortname+'.glo' ; f3=ff+os.path.splitext(f2)[1] + print f2,'->',f3 ; os.system(mvcp+f2+' '+f3) + f2=shortname+'.msg' ; f3=ff+os.path.splitext(f2)[1] + print f2,'->',f3 ; os.system(mvcp+f2+' '+f3) + +def my_test(a): return int(os.path.basename(a).split('.')[1]) + +f0=file_m+'.?????.mesh' +#print f0 +fics=glob.glob(f0) +fics.sort(lambda a, b: cmp(my_test(b), my_test(a))) #tri ordre decroissant +print 'conversion of files:\n',fics + +imax=len(fics) +for f in fics: + m2fp(f) + rename_tepal_v1(f,imax)