-# 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
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ---
#
# File : AUTHORS
-# 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
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ---
#
# File : ChangeLog
-// 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
//
// 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__
#define GHS3DPRLPLUGIN_VERSION_STR "@VERSION@"
#define GHS3DPRLPLUGIN_VERSION @XVERSION@
+#define GHS3DPRLPLUGIN_DEVELOPMENT @VERSION_DEV@
#endif // __GHS3DPRLPLUGIN_VERSION_H__
-# 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
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ---
#
# File : INSTALL
-# 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
#
# 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
-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
-# 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
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ---
#
# File : NEWS
-# 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
#
# 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
-# 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
#
# 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
-# 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
#
# 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 = \
-# 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
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ---
#
# File : check_GHS3DPRL.m4
-# 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
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ---
#
# File : check_GHS3DPRLPLUGIN.m4
-# 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
#
# 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
-# 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
#
# 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
-THIS IS SALOME - GHS3DPRLPLUGIN VERSION: @VERSION@
+[SALOME GHS3DPRLPLUGIN] : @VERSION@
+[DEVELOPMENT] : @VERSION_DEV@
+[DESCRIPTION] : DISTENE TetGen-GHS3d parallel meshing plug-in for SALOME Mesh module
--- /dev/null
+#!/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
--- /dev/null
+@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\r
#!/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
#
# 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
# 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
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 \
# version. The files are created in the directory specified with the
# AC_CONFIG_AUX_DIR(<mydir>) 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
# AC_CONFIG_AUX_DIR(<mydir>) 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"
#!/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
#
# 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 )
#!/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
#
# 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
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 !
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
dnl ---------------------------------------------
dnl
-CHECK_MPICH
+dnl CHECK_MPICH
+
+echo
+echo ---------------------------------------------
+echo testing MPI
+echo ---------------------------------------------
+echo
+
+CHECK_MPI
echo
echo ---------------------------------------------
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
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 ---------------------------------------------
#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
# 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 <filename>.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 \
])
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# 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
+
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+/*!
+
+\page ghs3dprl_hypo_page GHS3DPRL Parameters hypothesis
+
+\n GHS3DPRL Parameters hypothesis works only with <b>Tetrahedron (Tepal with TetMesh-GHS3D)</b> 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
+
+<ul>
+<li>
+<b>Name</b> - allows to define the name of the hypothesis (GHS3DPRL Parameters by default).
+</li>
+<li>
+<b>MED_Name</b> - 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.
+</li>
+<li>
+<b>Nb_Part</b> - 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.<br>
+</li>
+<li>
+<b>Keep_Files</b> - 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).
+</li>
+<li>
+<b>Tepal_in_Background</b> - 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.
+</li>
+<li>
+<b>To_Mesh_Holes</b> - if this box is checked, the parameter component
+of tetmesh-ghs3d will mesh holes.
+</li>
+
+<h1>Modifying GHS3DPRL Advanced Parameters</h1><br>
+GHS3DPRL Plugin launches a standalone binary executable tepal2med.<br>
+tepal2med launches tepal, waits for the end of computation, and
+converts the resulting output tepal files into MED files.<br>
+Some advanced optional parameters are accessible as arguments.<br>
+
+If keep_files option is checked, it is possible to re-launch tepal2med
+or tepal in the Terminal as a command with custom parameters.<br>
+
+<li>
+<b>Advanced tepal2med Parameters</b> - type "tepal2med --help" in the Terminal. <p>
+
+\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
+</li>
+<li>
+<b>Advanced Tepal_V1.4 Parameters</b> <p>
+
+\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
+</li>
+<li>
+<b>Advanced ghs3d Parameters (through Tepal_V1.4's --tetmesh_args)</b> - type "ghs3d -h" in a Terminal. <p>
+
+\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
+</li>
+<h1>Saving user's preferred GHS3DPRL Advanced Parameters</h1><br>
+GHS3DPRL Plugin launches standalone binary executable tepal2med.<br>
+You may rename file tepal2med as tepal2med.exe for example, and replace
+tepal2med by a shell script at your convenience to overriding parameters.
+<br>... or else $PATH modification... .<br>Idem for file tepal.<br><br>
+<li>
+<b>Advanced tepal2med Parameters</b> - overriding parameter deletegroups<p>
+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
+</li>
+<li>
+<b>Advanced Tepal_V1.4 Parameters</b> - overriding parameter component of ghs3d (to mesh holes). <p>
+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
+</li>
+<li>
+<b>Advanced tepal Parameters</b> - overriding launching tepal on other host. <p>
+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
+</li>
+
+<h1>Tepal_V2.0 and MPI use.</h1><br>
+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.
+
+<li>
+<b>example tepal_v2_mpirun.</b><p>
+
+\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
+</li>
+
+<h1>TUI use.</h1><br>
+
+<li>
+<b>example ex30_tepal.py.</b><p>
+
+\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
+</li>
+</ul>
+
+
+*/
--- /dev/null
+/*!
+
+\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.
+
+*/
--- /dev/null
+/*!
+
+\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:
+
+<ul>
+<li>Meshing 3D geometric entities.</li>
+ - Volumes are split into tetrahedral (pyramidal) elements.
+<li>Generating 3D meshes from 2D meshes, working without geometrical objects.</li>
+</ul>
+
+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"
+
+
+*/
--- /dev/null
+/* 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;
+}
+
--- /dev/null
+ <li class="footer"></li>
+ </ul>
+ </div>
+ <div class="footer1">
+ <div style="text-align: center;">
+ Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+ Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
+ </div>
+ </div>
+</body>
+</html>
+
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<title>$title</title>
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+$treeview
+$search
+$mathjax
+<script type="text/javascript">
+$(document).ready(initResizable);
+</script>
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body onload='searchBox.OnSelectItem(0);'>
+<div id="top"><!-- do not remove this div! -->
+<div id="titlearea"><div align="right"><div class="version">Version: @VERSION@</div></div></div>
+
+</div>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<title>$title</title>
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+$treeview
+$search
+$mathjax
+<script type="text/javascript">
+$(document).ready(initResizable);
+</script>
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body onload='searchBox.OnSelectItem(0);'>
+<div id="top"><!-- do not remove this div! -->
+<div id="titlearea"><div align="right"><div class="version">Version: @VERSION@</div></div></div>
+<div align="bottom-left"><a href=../index.html>Home</a></div>
+
+</div>
--- /dev/null
+# 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
-// 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
//
// 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_
-# 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
#
# 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)
$(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
-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 \
$(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
@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 ;
<?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
+<!--
+ 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
+
+-->
<!-- GUI customization for GHS3DPRL Plugin -->
<algorithm type="GHS3DPRL_3D"
label-id="GHS3DPRL"
icon-id="mesh_algo_GHS3DPRL.png"
- hypos="GHS3DPRL_Parameters"
+ opt-hypos="GHS3DPRL_Parameters"
input="TRIA,QUAD"
- dim="3"/>
+ dim="3">
+ <python-wrap>
+ <algo>GHS3DPRL_3D=Tetrahedron(algo=smesh.GHS3DPRL)</algo>
+ <hypo>GHS3DPRL_Parameters=Parameters()</hypo>
+ </python-wrap>
+ </algorithm>
+
</algorithms>
</meshers-group>
-# 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
#
# 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 = \
+<!--
+ 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
+
+-->
<document>
<section name="resources">
<parameter name="GHS3DPRLPlugin" value="${GHS3DPRLPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dprlplugin"/>
<!-- Default SMESH module plugins -->
<parameter name="plugins" value="NETGENPlugin,GHS3DPlugin,GHS3DPRLPlugin"/>
</section>
+ <section name="smesh_help" >
+ <parameter name="Plug-ins/GHS3DPRL plugin User's Guide" value="${GHS3DPRLPLUGIN_ROOT_DIR}/share/doc/salome/gui/GHS3DPRLPLUGIN/index.html"/>
+ </section>
</document>
--- /dev/null
+# 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)
--- /dev/null
+// 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
-// 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
//
// 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"
#include <SMESH_ControlsDef.hxx>
#include <list>
+#include <Standard_ProgramError.hxx>
#include <TCollection_AsciiString.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopoDS.hxx>
+#include <BRepGProp.hxx>
+#include <GProp_GProps.hxx>
/*
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)
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
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
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<const char*> tabField = vector<const char*>(nField);
+ vector<int> tabRef = vector<int>(nField);
tabField[0] = "MeshVersionFormatted"; tabRef[0] = 0;
tabField[1] = "Dimension"; tabRef[1] = 0;
if ( strcmp(theField, "Vertices") == 0 ) {
int aGHS3DPRLID;
- double coord[nbRef];
+ vector<double> coord = vector<double>(nbRef);
SMDS_MeshNode * aGHS3DPRLNode;
for ( int iElem = 0; iElem < nbElem; iElem++ ) {
}
}
else {
- const SMDS_MeshNode * node[nbRef];
+ vector<const SMDS_MeshNode*> node = vector<const SMDS_MeshNode*>(nbRef);
SMDS_MeshElement* aGHS3DPRLElement;
map <int,const SMDS_MeshNode*>::iterator itOnGHS3DPRLNode;
cout<<"GHS3DPRL command : "<<run_GHS3DPRL.ToCString()<<endl;
cout<<"Write files .faces .point ...";
GHS3DPRL_Out = path + casenamemed;
- OSD_File( GHS3DPRL_Outxml ).Remove(); //only the master xml file
+ removeFile( GHS3DPRL_Outxml ); //only the master xml file
Ok=writeGHS3DPRLFiles(GHS3DPRL_In, meshDS, aSmdsToGHS3DPRLIdMap, aGHS3DPRLIdToNodeMap);
if (Ok) {cout<<" ...done\n";}
else {
{
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<int> 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<int> 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<int> aVec(SMDSEntity_Last);
+ for(int i=0; i<SMDSEntity_Last; i++) aVec[i]=0;
+ if( IsQuadratic ) {
+ aVec[SMDSEntity_Node] = nb1d_in/6 + 1 + nb1d_in;
+ aVec[SMDSEntity_Quad_Tetra] = nbVols - nbqua*2;
+ aVec[SMDSEntity_Quad_Pyramid] = nbqua;
+ }
+ else {
+ aVec[SMDSEntity_Node] = nb1d_in/6 + 1;
+ aVec[SMDSEntity_Tetra] = nbVols - nbqua*2;
+ aVec[SMDSEntity_Pyramid] = nbqua;
+ }
+ SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);
+ aResMap.insert(std::make_pair(sm,aVec));
+
+ return true;
+}
-// 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// ---
-//
// File : GHS3DPRLPlugin_GHS3DPRL.hxx
// Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
-//
// ---
-
+//
#ifndef _GHS3DPRLPlugin_GHS3DPRL_HXX_
#define _GHS3DPRLPlugin_GHS3DPRL_HXX_
+#include "GHS3DPRLPlugin_Defs.hxx"
+
#include "SMESH_3D_Algo.hxx"
#include "SMESH_Mesh.hxx"
#include "Utils_SALOME_Exception.hxx"
class SMESH_Mesh;
class GHS3DPRLPlugin_Hypothesis;
-class GHS3DPRLPlugin_GHS3DPRL: public SMESH_3D_Algo
+class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_GHS3DPRL: public SMESH_3D_Algo
{
public:
GHS3DPRLPlugin_GHS3DPRL(int hypId, int studyId, SMESH_Gen* gen);
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
+ virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
+ MapShapeNbElems& aResMap);
+
ostream & SaveTo(ostream & save);
istream & LoadFrom(istream & load);
friend ostream & operator << (ostream & save, GHS3DPRLPlugin_GHS3DPRL & hyp);
-// 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// ---
-//
// File : GHS3DPRLPlugin_GHS3DPRL_i.cxx
// Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
-//
// ---
-
+//
#include "GHS3DPRLPlugin_GHS3DPRL_i.hxx"
#include "SMESH_Gen.hxx"
#include "GHS3DPRLPlugin_GHS3DPRL.hxx"
-// 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// ---
-//
// File : GHS3DPRLPlugin_GHS3DPRL_i.hxx
// Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
-//
// ---
-
+//
#ifndef _GHS3DPRLPlugin_GHS3DPRL_I_HXX_
#define _GHS3DPRLPlugin_GHS3DPRL_I_HXX_
+#include "GHS3DPRLPlugin_Defs.hxx"
+
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(GHS3DPRLPlugin_Algorithm)
#include CORBA_SERVER_HEADER(SALOME_Exception)
// ======================================================
// 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
{
-// 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 <GHS3DPRLPlugin_Hypothesis.hxx>
+//
+#include "GHS3DPRLPlugin_Hypothesis.hxx"
#include <utilities.h>
//=============================================================================
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)
-// 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:
-// 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
//
// 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"
-// 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
//
// 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 <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(GHS3DPRLPlugin_Algorithm)
// GHS3DPRLPlugin parameters hypothesis
-class GHS3DPRLPlugin_Hypothesis_i:
+class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_Hypothesis_i:
public virtual POA_GHS3DPRLPlugin::GHS3DPRLPlugin_Hypothesis,
public virtual SMESH_Hypothesis_i
{
-// 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
//
// 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"
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);
-# 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
#
# 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
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 \
$(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
-# 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
#
# 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
-// 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
//
// 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"
//=============================================================================
//=============================================================================
extern "C"
{
- SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType )
+ GHS3DPRLPLUGINGUI_EXPORT SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType )
{
SMESHGUI_GenericHypothesisCreator* aCreator = NULL;
if( aHypType=="GHS3DPRL_Parameters" )
-// 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
//
// 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 <SMESHGUI_Utils.h>
: SMESHGUI_GenericHypothesisCreator( theHypType ),
myIs3D( true )
{
+ printf("Hypo creator !!!!!!!!!!!!!!!!!!!!!!!!!! RNV");
}
GHS3DPRLPluginGUI_HypothesisCreator::~GHS3DPRLPluginGUI_HypothesisCreator()
-// 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
//
// 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 <SMESHGUI_Hypotheses.h>
class QtxIntSpinBox;
/*!
* \brief Class for creation of GHS3DPRL hypotheses
*/
-class GHS3DPRLPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
+class GHS3DPRLPLUGINGUI_EXPORT GHS3DPRLPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
{
Q_OBJECT
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="1.1" >
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="1.1" >
- <context>
- <name>@default</name>
- <message>
- <source>GHS3DPRL_3D_HYPOTHESIS</source>
- <translation>GHS3DPRL 3D</translation>
- </message>
- <message>
- <source>GHS3DPRL_3D_TITLE</source>
- <translation>Hypothesis Construction</translation>
- </message>
- <message>
- <source>GHS3DPRL_KeepFiles</source>
- <translation>Keep_Files</translation>
- </message>
- <message>
- <source>GHS3DPRL_Background</source>
- <translation>Tepal_in_Background</translation>
- </message>
- <message>
- <source>GHS3DPRL_ToMeshHoles</source>
- <translation>To_Mesh_Holes</translation>
- </message>
- <message>
- <source>GHS3DPRL_MEDName</source>
- <translation>MED_Name</translation>
- </message>
- <message>
- <source>GHS3DPRL_NbPart</source>
- <translation>Nb_Part</translation>
- </message>
- <message>
- <source>GHS3DPRL_WhatsThis_KeepFiles</source>
- <translation>Keep intemediates tepal Files (.faces,.points,.msg,.noboite...)</translation>
- </message>
- <message>
- <source>GHS3DPRL_WhatsThis_Background</source>
- <translation>lanch tepal in background (for a big mesh, a long time...)</translation>
- </message>
- <message>
- <source>GHS3DPRL_WhatsThis_ToMeshHoles</source>
- <translation>tepal meshes holes</translation>
- </message>
- <message>
- <source>GHS3DPRL_WhatsThis_MEDName</source>
- <translation>Generic path/name of finals outputs files (.med)</translation>
- </message>
- <message>
- <source>GHS3DPRL_WhatsThis_Name</source>
- <translation>Name of applied hypothese</translation>
- </message>
- <message>
- <source>GHS3DPRL_WhatsThis_NbPart</source>
- <translation>Number of partitions of initial wrap</translation>
- </message>
- </context>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>GHS3DPRL_3D_HYPOTHESIS</source>
+ <translation>GHS3DPRL 3D</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_3D_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_KeepFiles</source>
+ <translation>Keep files</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_Background</source>
+ <translation>Tepal in background</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_ToMeshHoles</source>
+ <translation>To mesh holes</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_MEDName</source>
+ <translation>MED Name</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_NbPart</source>
+ <translation>Nb partitions</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_KeepFiles</source>
+ <translation>Keep intemediates Tepal Files (.faces,.points,.msg,.noboite...)</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_Background</source>
+ <translation>Lanch Tepal in background (for a big mesh, a long time...)</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_ToMeshHoles</source>
+ <translation>Tepal meshes holes</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_MEDName</source>
+ <translation>Generic path/name of finals outputs files (.med)</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_Name</source>
+ <translation>Name of applied hypothese</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_NbPart</source>
+ <translation>Number of partitions of initial wrap</translation>
+ </message>
+</context>
</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>@default</name>
+ <message>
+ <source>GHS3DPRL_3D_HYPOTHESIS</source>
+ <translation>GHS3DPRL 3D</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_3D_TITLE</source>
+ <translation>Construction d'une hypothèse</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_KeepFiles</source>
+ <translation>Sauvegarder les fichiers</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_Background</source>
+ <translation>Tepal en arrière plan</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_ToMeshHoles</source>
+ <translation>Mailler les trous</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_MEDName</source>
+ <translation>Nom MED</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_NbPart</source>
+ <translation>Nombre de partitions</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_KeepFiles</source>
+ <translation>Préserver les fichiers Tepal intermédiaires (.faces,.points,.msg,.noboite...)</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_Background</source>
+ <translation>Lancer Tepal en arrière-plan (prend du temps pour un maillage de grand volume...)</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_ToMeshHoles</source>
+ <translation>Tepal maille les trous</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_MEDName</source>
+ <translation>Chemin/nom générique des fichiers de sortie finaux (.med)</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_Name</source>
+ <translation>Nom de l'hypothèse appliquée</translation>
+ </message>
+ <message>
+ <source>GHS3DPRL_WhatsThis_NbPart</source>
+ <translation>Nombre de partitions de l'enveloppe initiale</translation>
+ </message>
+</context>
+</TS>
-# 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
#
# 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
$(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
-# 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
#
# 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
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)
-// 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
//
// 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()
-// 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
//
// 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
-// 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
//
// 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 <string>
#include <iostream>
#include <sstream>
#include <fstream>
+#ifndef WIN32
+#include <unistd.h>
+#endif
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
+#ifdef WIN32
+#include <io.h>
+#include <windows.h>
+#include <time.h>
+#define F_OK 0
+#undef max
+#undef min
+#endif
#include <QFile>
#include <QRegExp>
+#include <limits>
-using namespace std;
-using namespace med_2_2;
+extern "C" {
+#include <med.h>
+//#include <med_config.h>
+//#include <med_utils.h>
+//#include <med_misc.h>
+}
//utils procedures
//************************************
-string i2a(const int &v)
+std::string i2a(const int &v)
{
- ostringstream ss;
+ std::ostringstream ss;
ss<<v;
return ss.str();
}
//class familles
//************************************
void familles::newfam(QString nom){
- //cout<<"newfam "<<nom<<endl;
+ //std::cout<<"newfam "<<nom<<std::endl;
if (fam.find(nom)!=fam.end()){
- cout<<"***newfam*** "<<nom.toLatin1().constData()<<" deja present\n";
+ std::cout<<"***newfam*** "<<nom.toLatin1().constData()<<" deja present\n";
return;
}
fend gb;
//************************************
void familles::newgro(QString nom){
- //cout<<"newgro "<<nom<<endl;
+ //std::cout<<"newgro "<<nom<<std::endl;
if (gro.find(nom)!=gro.end()){
- cout<<"***newgro*** "<<nom.toLatin1().constData()<<" deja present\n";
+ std::cout<<"***newgro*** "<<nom.toLatin1().constData()<<" deja present\n";
return;
}
fend gb;
fend gb;
fagr::iterator it1;
fend::iterator it2;
- //cout<<"\n***familles.write()***\n";
+ int nbf=0,nbg=0;
for (it1=fam.begin(); it1!=fam.end(); ++it1){
- cout<<"Family=<"<<(*it1).first.toLatin1().constData()<<">\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<<endl;
+ std::cout<<std::endl;
}
+ if (nbf==0) std::cout<<"no families"<<std::endl;
for (it1=gro.begin(); it1!=gro.end(); ++it1){
- cout<<"Group=<"<<(*it1).first.toLatin1().constData()<<">\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<<endl;
+ std::cout<<std::endl;
}
+ if (nbg==0) std::cout<<"no groups"<<std::endl;
}
//************************************
fagr::iterator it1;
fend::iterator it2;
int nb=0,nbf;
- string ss;
+ std::string ss;
xmlNodePtr res,node;
res=xmlNewNode(NULL, BAD_CAST "groups");
for (it1=gro.begin(); it1!=gro.end(); ++it1){
}
xmlNewProp(node, BAD_CAST "families_number", BAD_CAST i2a(nbf).c_str());
xmlNewProp(node, BAD_CAST "families", BAD_CAST ss.substr(1).c_str());
- //cout<<endl;
+ //std::cout<<std::endl;
}
xmlNewProp(res, BAD_CAST "number", BAD_CAST i2a(nb).c_str());
return res;
//************************************
void familles::add(QString nomfam, QString nomgro)
{
- //cout<<"add family <"<<nomfam<<">\t<"<<nomgro<<">\n";
+ //std::cout<<"add family <"<<nomfam<<">\t<"<<nomgro<<">\n";
fagr::iterator it;
it=fam.find(nomfam);
if (it==fam.end()){
- //cout<<"add new family <"<<nomfam<<">\t<"<<nomgro<<">\n";
+ //std::cout<<"add new family <"<<nomfam<<">\t<"<<nomgro<<">\n";
newfam(nomfam);
it=fam.find(nomfam);
}
(*it).second[nomgro]=0;
it=gro.find(nomgro);
if (it==gro.end()){
- //cout<<"***new*** "<<nomgro<<" non present\n";
+ //std::cout<<"***new*** "<<nomgro<<" non present\n";
newgro(nomgro);
it=gro.find(nomgro);
}
it=fam.find(nomfam);
if (it==fam.end()) {
*tmp=nomfam; *ires=ii;
- //cout<<"NewFamily Found<"<<*ires<<"><"<<*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"<<endl;
+ std::cerr<<"***get_number_of_new_family*** Problem new family not found"<<std::endl;
return false;
}
for (it1=fam.begin(); it1!=fam.end(); ++it1){
if (gb==(*it1).second){
ires=(*it1).first.toLong();
- //cout<<"find_family_on_groups old <"<<ires<<"> from <"<<
+ //std::cout<<"find_family_on_groups old <"<<ires<<"> from <"<<
// fam1<<"><"<<fam2<<">\n";
return ires;
}
}
- //cout<<"no family found!!! - groups of "<<fam1<<" and "<<fam2<<endl;
+ //std::cout<<"no family found!!! - groups of "<<fam1<<" and "<<fam2<<std::endl;
QString tmp;
//fam1 positive for nodes negative faces & mailles
bool oktmp=get_number_of_new_family(fam1,&ires,&tmp);
for (it=gb.begin(); it!=gb.end(); ++it){
this->add(tmp,(*it).first);
}
- //cout<<"new family <"<<ires<<"> intersection of <"<<fam1<<"><"<<fam2<<">\n";
+ //std::cout<<"new family <"<<ires<<"> intersection of <"<<fam1<<"><"<<fam2<<">\n";
return ires;
}
nom2=nom2.sprintf("%d",fam2);
it2=fam.find(nom2);
if ( (it1==fam.end())||(it2==fam.end()) ) {
- cerr<<"***fuse_goups*** non existing family "<<fam1<<" or "<<fam2<<endl;
+ std::cerr<<"***fuse_goups*** non existing family "<<fam1<<" or "<<fam2<<std::endl;
fend gb;
return gb; //empty
}
gb.insert((*it2).second.begin(),(*it2).second.end()); //other groups
return gb;
//for debug
- cout<<"fuse_goups "<<fam1<<" "<<fam2<<" ";
+ std::cout<<"fuse_goups "<<fam1<<" "<<fam2<<" ";
fend::iterator it;
for (it=gb.begin(); it!=gb.end(); ++it){
- cout<<"<"<<(*it).first.toLatin1().constData()<<"> ";
+ std::cout<<"<"<<(*it).first.toLatin1().constData()<<"> ";
}
- cout<<endl;
+ std::cout<<std::endl;
return gb;
}
CVWtab::CVWtab(long nb, med_int *pmint)
//constructor with pmint allocated yet with new
{
- //cout"***constructor med_int CVWtab***\n";
+ //std::cout"***constructor med_int CVWtab***\n";
size=nb;
type=1; //only tmint valide
tmint=pmint;
tmflo=NULL;
memoryuse=memoryuse+sizeof(med_int)*nb;
- //cout<<"memoryuse int "<<sizeof(med_int)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<endl;
+ //std::cout<<"memoryuse int "<<sizeof(med_int)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<std::endl;
if (memoryuse>memorymax) {
- cout<<"***WARNING*** memory max reached "<<memorymax<<endl;
- //cout<<"memoryuse int "<<sizeof(med_int)<<" "<<nb<<" "<<memoryuse<<endl;
+ std::cout<<"***WARNING*** memory max reached "<<memorymax<<std::endl;
+ //std::cout<<"memoryuse int "<<sizeof(med_int)<<" "<<nb<<" "<<memoryuse<<std::endl;
}
}
CVWtab::CVWtab(long nb, med_float *pmflo)
//constructor with pmflo allocated yet with new
{
- //cout<<"***constructor med_float CVWtab***\n";
+ //std::cout<<"***constructor med_float CVWtab***\n";
size=nb;
type=2; //only tmflo valide
tmint=NULL;
tmflo=pmflo;
memoryuse=memoryuse+sizeof(med_float)*nb;
- //cout<<"memoryuse float "<<sizeof(med_float)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<endl;
+ //std::cout<<"memoryuse float "<<sizeof(med_float)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<std::endl;
if (memoryuse>memorymax) {
- cout<<"***WARNING*** memory max reached "<<memorymax<<endl;
- //cout<<"memoryuse float "<<sizeof(med_float)<<" "<<nb<<" "<<memoryuse<<endl;
+ std::cout<<"***WARNING*** memory max reached "<<memorymax<<std::endl;
+ //std::cout<<"memoryuse float "<<sizeof(med_float)<<" "<<nb<<" "<<memoryuse<<std::endl;
}
}
CVWtab::~CVWtab()
{
bool ok;
- //cout<<" destructor CVWtab *** "<<this->filename<<endl;
+ //std::cout<<" destructor CVWtab *** "<<this->filename<<std::endl;
ok=this->CVWtab_deallocate();
//remove temporary file
if (this->filename!="_NO_FILE")
{
remove(this->filename.toLatin1().constData()); //#include <stdio.h>
- //cout<<this->filename<<" successfully deleted\n";
+ //std::cout<<this->filename<<" successfully deleted\n";
}
}
//************************************
bool CVWtab::CVWtab_deallocate()
{
- //cout<<" deallocate CVWtab*** "<<size<<endl;
+ //std::cout<<" deallocate CVWtab*** "<<size<<std::endl;
if (size <= 0) return false;
if (tmint)
{
memoryuse=memoryuse-sizeof(med_float)*size;
size=-size; //precaution
}
- if (memoryuse<0) cout<<"***WARNING*** memoryuse <0 "<<memoryuse<<endl;
- if (memoryuse==0) cout<<"***CVWtab_deallocate*** memoryuse=0 "<<endl;
+ if (memoryuse<0) std::cout<<"***WARNING*** memoryuse <0 "<<memoryuse<<std::endl;
+ if (memoryuse==0) std::cout<<"***CVWtab_deallocate*** memoryuse=0 "<<std::endl;
return true;
}
//************************************
bool CVWtab::is_equal(CVWtab *tab2)
{
- //cout<<"is_equal tab1 tab2 type="<<this->type<<" size="<<this->size<<" "<<tab2->size<<endl;
- //if (this->type==1) cout<<"med_int tab1[0]="<<this->tmint[0]<<endl;
- //if (this->type==2) cout<<"med_float tab1[0]="<<this->tmflo[0]<<endl;
+ //std::cout<<"is_equal tab1 tab2 type="<<this->type<<" size="<<this->size<<" "<<tab2->size<<std::endl;
+ //if (this->type==1) std::cout<<"med_int tab1[0]="<<this->tmint[0]<<std::endl;
+ //if (this->type==2) std::cout<<"med_float tab1[0]="<<this->tmflo[0]<<std::endl;
if (this->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="<<this->size<<endl;
+ { std::cout<<"***is_equal*** pb pointer NULL with tmint size="<<this->size<<std::endl;
return false;
}
for (long i=0; i < this->size; i++)
if (this->type==2)
{
if (!this->tmflo)
- { cout<<"***is_equal*** pb pointer NULL with tmflo size="<<this->size<<endl;
+ { std::cout<<"***is_equal*** pb pointer NULL with tmflo size="<<this->size<<std::endl;
return false;
}
for (long i=0; i < this->size; i++)
//verbose 1 for print vertices not equals
//verbose 2 for print also vertices equals (debug)
{
- //cout<<"is_equal_vertice size="<<tab1->size<<" "<<tab2->size<<endl;
+ //std::cout<<"is_equal_vertice size="<<tab1->size<<" "<<tab2->size<<std::endl;
bool ok=false;
med_float *p1,*p2;
//vertices indices from 1 not 0!
long di1=(i1-1)*3, di2=(i2-1)*3;
if (di1<0 || di1>=tab1->size)
{
- cerr<<"BadIndice tab1 in is_equal_vertices "<<
- di1<<" not in "<<tab1->size<<endl;
+ std::cerr<<"BadIndice tab1 in is_equal_vertices "<<
+ di1<<" not in "<<tab1->size<<std::endl;
return false;
}
if (di2<0 || di2>=tab2->size)
{
- cerr<<"BadIndice tab2 in is_equal_vertices "<<
- di2<<" not in "<<tab2->size<<endl;
+ std::cerr<<"BadIndice tab2 in is_equal_vertices "<<
+ di2<<" not in "<<tab2->size<<std::endl;
return false;
}
p1=(tab1->tmflo+di1);
}
//************************************
-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
{
}
else
{
- cerr<<"Problem line '"<<str<<"' not found in file\n"<<endl;
+ std::cerr<<"Problem line '"<<str<<"' not found in file\n"<<std::endl;
return false;
}
} while (1);
//no read of <receive> 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 '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
- //Lit les données :
+ //Lit les donn�s :
if (!CVW_FindString("<neighbours count=",Ff,nbneighbour)) return false;
- if (verbose>2) cout<<"NeighboursCount="<<nbneighbour<<endl;
+ if (verbose>2) std::cout<<"NeighboursCountDomain_"<<this->nofile<<"="<<nbneighbour<<std::endl;
for (i=1; i<=nbneighbour; i++)
{
if (!CVW_FindString("<neighbour indice=",Ff,ineighbour)) return false;
if (count>0){
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Vertices "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Vertices "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld VE SE",this->nofile,ineighbour);
if (count>0){
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Edges "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Edges "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld ED SE",this->nofile,ineighbour);
if (count>0){
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Faces "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Faces "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld FA SE",this->nofile,ineighbour);
if (count>0){
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld EL SE",this->nofile,ineighbour);
//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 '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
- //Lit les données :
+ //Lit les donn�s :
if (!CVW_FindString("<vertices count=",Ff,count)) return false;
- if (verbose>3) cout<<"GloVerticesCount="<<count<<endl;
+ if (verbose>3) std::cout<<"GloVerticesCount="<<count<<std::endl;
if (count>0)
{
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("GL%ld VE",this->nofile);
}
if (!CVW_FindString("<edges count=",Ff,count)) return false;
- if (verbose>3) cout<<"GloEdgesCount="<<count<<endl;
+ if (verbose>3) std::cout<<"GloEdgesCount="<<count<<std::endl;
if (count>0)
{
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("GL%ld ED",this->nofile);
}
if (!CVW_FindString("<faces count=",Ff,count)) return false;
- if (verbose>3) cout<<"GloFacesCount="<<count<<endl;
+ if (verbose>3) std::cout<<"GloFacesCount="<<count<<std::endl;
if (count>0)
{
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("GL%ld FA",this->nofile);
}
if (!CVW_FindString("<elements count=",Ff,count)) return false;
- if (verbose>3) cout<<"GloElementsCount="<<count<<endl;
+ if (verbose>3) std::cout<<"GloElementsCount="<<count<<std::endl;
if (count>0)
{
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("GL%ld EL",this->nofile);
//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 '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
- //Lit les données :
- //Replace le pointeur de fichier au début :f.seekg(0);
+ //Lit les donn�s :
+ //Replace le pointeur de fichier au d�ut :f.seekg(0);
if (getline(Ff,line))
{
tmp=line.c_str();
}
else
{
- cerr<<"Problem on first line of file"<<endl;
+ std::cerr<<"Problem on first line of file"<<std::endl;
return false;
}
- if (verbose>3) cout<<"FacesNumberOfElements="<<nbelem<<endl;
+ if (verbose>3) std::cout<<"FacesNumberOfElements="<<nbelem<<std::endl;
med_int *tmint=new med_int[nbelem*7];
for (int i=0; i<nbelem*7; i=i+7)
{
Ff>>ntype;
if (ntype!=3) //only triangles
{
- cerr<<"Problem on ntype != 3"<<endl;
+ std::cerr<<"Problem on ntype != 3"<<std::endl;
return false;
}
for (int j=0; j<7; j++) Ff>>tmint[i+j];
- //for (int j=0; j<7; j++) cout<<tmint[i+j]<<' '; cout<<endl;
+ //for (int j=0; j<7; j++) std::cout<<tmint[i+j]<<' '; std::cout<<std::endl;
}
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[nbelem*7-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[nbelem*7-1]<<std::endl;
CVWtab *montab=new CVWtab(nbelem*7,tmint);
tmp=tmp.sprintf("FC%ld",this->nofile);
//(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 '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
- //lit les données :
+ //lit les donn�s :
Ff>>ne>>np>>npfixe;
if (verbose>3){
- cout<<"NoboiteNumberOfElements="<<ne<<endl;
- cout<<"NoboiteNumberOfVertices="<<np<<endl;
- cout<<"NoboiteNumberOfSpecifiedPoints="<<npfixe<<endl;
+ std::cout<<"NoboiteNumberOfElements="<<ne<<std::endl;
+ std::cout<<"NoboiteNumberOfVertices="<<np<<std::endl;
+ std::cout<<"NoboiteNumberOfSpecifiedPoints="<<npfixe<<std::endl;
}
for (int i=1; i<=17-3; i++) Ff>>reste;
//printf("reste %ld\n",reste);
med_int *tmint=new med_int[ne*4];
for (int i=0; i<ne*4; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<std::endl;
CVWtab *montab=new CVWtab(ne*4,tmint);
tmp=tmp.sprintf("NB%ld EV",this->nofile);
med_float *tmflo=new med_float[np*3];
for (int i=0; i<np*3; i++) Ff>>tmflo[i];
- if (verbose>4) cout<<"Vertices "<<tmflo[0]<<" "<<tmflo[1]<<"... "<<tmflo[np*3-1]<<endl;
+ if (verbose>4) std::cout<<"Vertices "<<tmflo[0]<<" "<<tmflo[1]<<"... "<<tmflo[np*3-1]<<std::endl;
montab=new CVWtab(np*3,tmflo);
tmp=tmp.sprintf("NB%ld VC",this->nofile);
ok=this->insert_key(tmp,montab);
Ff>>subnumber;
- if (verbose>2) cout<<"NumberOfSubdomains="<<subnumber<<endl;
- tmint=new med_int[subnumber*3];
- for (int i=0; i<subnumber*3; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Subdomains "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[subnumber*3-1]<<endl;
+ if (verbose>2) std::cout<<"NumberOfSubdomains="<<subnumber<<std::endl;
+ //tmint=new med_int[subnumber*3];
+ tmint=new med_int[subnumber*3];
+ long onelong,maxint;
+ maxint=std::numeric_limits<int>::max();
+ //pb from tepalv2
+ bool isproblem=true;
+ for (int i=0; i<subnumber*3; i++) {
+ Ff>>onelong;
+ //pb from tepalv2
+ if (onelong<0) {
+ if (isproblem && verbose>1) std::cout<<"There is one or more negative med_int value in NumberOfSubdomains "<<onelong<<std::endl;
+ isproblem=false;
+ onelong=-1;
+ }
+ if (onelong>maxint) {
+ if (isproblem && verbose>1) std::cout<<"There is one or more truncated med_int value in NumberOfSubdomains "<<onelong<<std::endl;
+ isproblem=false;
+ onelong=-2;
+ }
+ tmint[i]=(int)onelong;
+ }
+ if (verbose>4) std::cout<<"Subdomains "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[subnumber*3-1]<<std::endl;
montab=new CVWtab(subnumber*3,tmint);
tmp=tmp.sprintf("NB%ld SN",this->nofile);
{
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");
//=> 2*long(68) (68=17*4octets)
long r1[17+2];
if (!Ff){
- cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
//read datas :
fread(&r1,sizeof(long),17+2,Ff);
- for (long i=1; i<18; i++) cout<<"R1("<<i<<")="<<r1[i]<<endl;
+ for (long i=1; i<18; i++) std::cout<<"R1("<<i<<")="<<r1[i]<<std::endl;
if (r1[0]!=68){
- cerr<<"First FORTRAN record of File '"<<FileName.toLatin1().constData()<<"' not length 17*long"<<endl;
+ std::cerr<<"First FORTRAN record of File '"<<FileName.toLatin1().constData()<<"' not length 17*long"<<std::endl;
return false;
}
ne=r1[1];
np=r1[2];
npfixe=r1[3];
if (verbose>3){
- cout<<"NoboitebNumberOfElements="<<ne<<endl;
- cout<<"NoboitebNumberOfVertices="<<np<<endl;
- cout<<"NoboitebNumberOfSpecifiedPoints="<<npfixe<<endl;
+ std::cout<<"NoboitebNumberOfElements="<<ne<<std::endl;
+ std::cout<<"NoboitebNumberOfVertices="<<np<<std::endl;
+ std::cout<<"NoboitebNumberOfSpecifiedPoints="<<npfixe<<std::endl;
}
//etc...could be done if necessary not debugged
fread(&reste,sizeof(long),1,Ff);
fread(&reste,sizeof(long),1,Ff);
for (long i=0; i<ne*4; i++) tmint[i]=tlong[i];
delete tlong;
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<std::endl;
CVWtab *montab=new CVWtab(ne*4,tmint);
tmp=tmp.sprintf("NB%ld EV",this->nofile);
ok=this->insert_key(tmp,montab);
fread(&reste,sizeof(long),1,Ff);
- //cout<<"info "<<reste<<" "<<np*3<<" "<<sizeof(med_float)<<endl;
+ //std::cout<<"info "<<reste<<" "<<np*3<<" "<<sizeof(med_float)<<std::endl;
float *tfloat=new float[np*3];
med_float *tmflo=new med_float[np*3];
fread(tfloat,sizeof(float),np*3,Ff);
fread(&reste,sizeof(long),1,Ff);
fread(&subnumber,sizeof(long),1,Ff);
fread(&reste,sizeof(long),1,Ff);
- if (verbose>2) cout<<"NumberOfSubdomains="<<subnumber<<endl;
+ if (verbose>2) std::cout<<"NumberOfSubdomains="<<subnumber<<std::endl;
fread(&reste,sizeof(long),1,Ff);
tlong=new long[subnumber*3];
fread(tlong,sizeof(long),subnumber*3,Ff);
long maxlen=128;
bool ok=true;
- //Lit les données :
+ //Lit les donn�s :
QFile Ff(FileName);
//NOT Raw because Raw=non-buffered file access
//qt3 ok=Ff.open(IO_ReadOnly|IO_Translate);
ok=Ff.open(QIODevice::ReadOnly|QIODevice::Text);
if (!ok){
- cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
tmp=Ff.readLine(maxlen);
tmp=tmp.simplified();
nb=tmp.toLong(&ok);
if (!ok){
- cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<endl;
+ std::cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<std::endl;
return false;
}
- if (verbose>2) cout<<"NumberOfVertices="<<nb<<endl;
+ if (verbose>2) std::cout<<"NumberOfVertices="<<nb<<std::endl;
med_float *tmflo=new med_float[3*nb]; //coordinates
med_int *tmint=new med_int[nb]; //nrs (attribute of point)
long il3=0;
tmp=tmp.simplified();
for ( int j=0; j<3; j++ ){
tmflo[il3]=tmp.section(' ',j,j).toDouble(&ok);
- //cout<<"cv '"<<tmflo[il3]<<"' "<<il3<<endl;
+ //std::cout<<"cv '"<<tmflo[il3]<<"' "<<il3<<std::endl;
il3++;
if (!ok){
- cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<endl;
+ std::cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<std::endl;
return false;
}
}
//nrs is vertex attribute
tmint[il]=tmp.section(' ',3,3).toLong(&ok);
if (!ok){
- cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<endl;
+ std::cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<std::endl;
return false;
}
}
while ( it.hasNext() ) {
it.next();
QString nom = it.key().leftJustified(32,' ');
- cout<<nom.toLatin1().constData()<<"-> size="<<it.value()->size<<endl;
+ std::cout<<nom.toLatin1().constData()<<"-> size="<<it.value()->size<<std::endl;
}
return true;
}
it.next();
if (it.key().contains(rxp)) {
nbremove++;
- if (this->verbose>6) cout<<"remove key "<<it.key().toLatin1().constData()<<endl;
+ if (this->verbose>6) std::cout<<"remove key "<<it.key().toLatin1().constData()<<std::endl;
delete it.value();
it.remove();
}
long ghs3dprl_mesh_wrap::nb_key_mesh_wrap(const QRegExp &rxp)
{
long nbremove=0;
- //cout<<"nb_key_mesh_wrap on "<<endl;
+ //std::cout<<"nb_key_mesh_wrap on "<<std::endl;
QMutableHashIterator<QString,CVWtab*> it(this->mestab);
while ( it.hasNext() ){
it.next();
if (it.key().contains(rxp)) nbremove++;
}
- //cout<<"nb_key_mesh_wrap found "<<nbremove<<endl;
+ //std::cout<<"nb_key_mesh_wrap found "<<nbremove<<std::endl;
return nbremove;
}
fwrite(&taille,sizeof(taille),1,fichier);
if (tab->tmint){
if (verbose>3)
- cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
+ std::cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
" NbElements "<<taille<<
" SizeElement_med_int "<<sizeof(med_int)<<
- " TotalSizeBinary " <<taille*sizeof(med_int)<<endl;
+ " TotalSizeBinary " <<taille*sizeof(med_int)<<std::endl;
fwrite(tab->tmint,sizeof(med_int),taille,fichier);
//fread(&gagnants,sizeof(gagnants),1,fichier);
}
if (tab->tmflo){
if (verbose>3)
- cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
+ std::cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
" NbElements "<<taille<<
" SizeElement_med_float "<<sizeof(med_float)<<
- " TotalSizeBinary " <<taille*sizeof(med_float)<<endl;
+ " TotalSizeBinary " <<taille*sizeof(med_float)<<std::endl;
fwrite(tab->tmflo,sizeof(med_float),taille,fichier);
}
fclose(fichier);
}
else{
- if (verbose>3) cout<<"SwapOnFile in binary file done yet "<<
- tab->filename.toLatin1().constData()<<endl;
+ if (verbose>3) std::cout<<"SwapOnFile in binary file done yet "<<
+ tab->filename.toLatin1().constData()<<std::endl;
}
//deallocate because swap disk binary mode
tab->CVWtab_deallocate(); //free memory
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 "<<it.value()->size<<">"<<ifgreaterthan<<endl;
+ " size "<<it.value()->size<<">"<<ifgreaterthan<<std::endl;
//free memory
ok=SwapOnFile(it.key(),this->path,it.value(),this->verbose);
}
{
CVWtab *montab=this->mestab[key];
if (montab){
- //cout<<"key "<<key<<"trouvee -> size="<<montab->size<<endl;
+ //std::cout<<"key "<<key<<"trouvee -> size="<<montab->size<<std::endl;
if (montab->type==1)
for ( long i=0; i<montab->size; i++ )
- cout<<montab->tmint[i]<<" ";
+ std::cout<<montab->tmint[i]<<" ";
if (montab->type==2)
for ( long i=0; i<montab->size; i++ )
- cout<<montab->tmflo[i]<<" ";
- cout<<endl;
+ std::cout<<montab->tmflo[i]<<" ";
+ std::cout<<std::endl;
}
else
- cout<<"key "<<key.toLatin1().constData()<<" not found"<<endl;
+ std::cout<<"key "<<key.toLatin1().constData()<<" not found"<<std::endl;
return true;
}
//************************************
bool ghs3dprl_mesh_wrap::insert_key(const QString &key,CVWtab *tab)
-//insertion conditionnée par limite this->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 "<<key.toLatin1().constData()<<
- " size="<<tab->size<<endl;
+ std::cout<<"insert key "<<key.toLatin1().constData()<<
+ " size="<<tab->size<<std::endl;
tab->filename="_NO_FILE";
if (this->nbelem_limit_swap<tab->size) {
- if (verbose>3) cout<<"insert key automatic SwapOnFile "<<
- key.toLatin1().constData()<<endl;
+ if (verbose>3) std::cout<<"insert key automatic SwapOnFile "<<
+ key.toLatin1().constData()<<std::endl;
ok=SwapOnFile(key,this->path,tab,this->verbose);
}
this->mestab.insert(key,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 "<<tab->size<<endl;
- else cout<<" -> tab NULL\n";*/
+ /*if (tab) std::cout<<" -> size in proc "<<tab->size<<std::endl;
+ else std::cout<<" -> tab NULL\n";*/
if (!tab) //it is NOT a problem
{
- if (verbose>6) cout<<"restore key not found "<<key.toLatin1().constData()<<endl;
+ if (verbose>6) std::cout<<"restore key not found "<<key.toLatin1().constData()<<std::endl;
return NULL;
}
if (tab->size > 0){
- if (verbose>5) cout<<"restore key direct from memory "<<key.toLatin1().constData()<<" size="<<tab->size<<endl;
+ if (verbose>5) std::cout<<"restore key direct from memory "<<key.toLatin1().constData()<<" size="<<tab->size<<std::endl;
return tab;
}
//restore from binary file
if ((tab->type<1)||(tab->type>2)){
- cerr<<"Problem restore key from binary file "<<tab->filename.toLatin1().constData()<<
- " type unexpexted "<<tab->type<<endl;
+ std::cerr<<"Problem restore key from binary file "<<tab->filename.toLatin1().constData()<<
+ " type unexpexted "<<tab->type<<std::endl;
return NULL;
}
- //cout<<"restore_key from binary file "<<tab->filename<<endl;
+ //std::cout<<"restore_key from binary file "<<tab->filename<<std::endl;
//swap disque binaire
FILE *fichier=fopen(tab->filename.toLatin1().constData(),"rb");
long taille;
fread(&taille,sizeof(long),1,fichier);
if (taille!=-tab->size){
- cerr<<"Problem restore_key from binary file "<<tab->filename.toLatin1().constData()<<
- " size unexpexted "<<taille<<" expected "<<-tab->size<<endl;
+ std::cerr<<"Problem restore_key from binary file "<<tab->filename.toLatin1().constData()<<
+ " size unexpexted "<<taille<<" expected "<<-tab->size<<std::endl;
fclose(fichier);
return NULL;
}
if (tab->type==1){
if (verbose>5)
- cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
+ std::cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
" number of elements "<<taille<<
" size_element med_float "<<sizeof(med_float)<<
- " total_size_binary " <<taille*sizeof(med_float)<<endl;
+ " total_size_binary " <<taille*sizeof(med_float)<<std::endl;
//allocate because swap disque binaire
tab->tmint=new med_int[taille]; //allocate memory
}
if (tab->type==2){
if (verbose>5)
- cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
+ std::cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
" number of elements "<<taille<<
" size_element med_float "<<sizeof(med_float)<<
- " total_size_binary " <<taille*sizeof(med_float)<<endl;
+ " total_size_binary " <<taille*sizeof(med_float)<<std::endl;
//allocate because swap disque binaire
tab->tmflo=new med_float[taille]; //allocate memory
for (int i=0; i<taille ; i++) tab->tmflo[i]=-1e0;
fread(tab->tmflo,sizeof(med_float),taille,fichier);
- /*for (int i=0; i<taille ; i++) cout<<tab->tmflo[i]<<"/";
- cout<<endl;*/
+ /*for (int i=0; i<taille ; i++) std::cout<<tab->tmflo[i]<<"/";
+ std::cout<<std::endl;*/
}
fclose(fichier);
tab->size=-tab->size;
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 "<<key1<<" et key "<<key2<<endl;
+ //std::cout<<"key "<<key1<<" et key "<<key2<<std::endl;
tab1=this->restore_key(key1);
//tab1=this->mestab[key1];
tab2=this->restore_key(key2);
//tab2=this->mestab[key2];
- //cout<<"sortie key "<<key1<<" et key "<<key2<<endl;
+ //std::cout<<"sortie key "<<key1<<" et key "<<key2<<std::endl;
if (!tab1 && !tab2) continue; //case not neighbours
if (!tab1)
- { cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<endl;
+ { std::cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<std::endl;
ok=false;
}
else
{
if (!tab2)
- { cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<endl;
+ { std::cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<std::endl;
ok=false;
}
else
if (!tab1->is_equal(tab2))
- { cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de contenu differents"<<endl;
+ { std::cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de contenu differents"<<std::endl;
ok=false;
}
}
tab2=this->restore_key(key2); //tab2=this->mestab[key2];
if (!tab1 && !tab2) continue; //case not neighbours
if (!tab1)
- { cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<endl;
+ { std::cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<std::endl;
ok=false;
}
else
{
if (!tab2)
- { cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<endl;
+ { std::cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<std::endl;
ok=false;
}
else
if ((tab1->type!=tab2->type)||(tab1->size!=tab2->size))
- { cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de type ou tailles differents"<<endl;
+ { std::cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de type ou tailles differents"<<std::endl;
ok=false;
}
}
if (!tab1 && !tab2) continue; //cas non voisins
if (!tab1)
{
- cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
- " NOT existing but key "<<key2.toLatin1().constData()<<" existing"<<endl;
+ std::cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
+ " NOT existing but key "<<key2.toLatin1().constData()<<" existing"<<std::endl;
ok=false; continue;
}
if (!tab2)
{
- cerr<<"TestEqualityCoordinates key "<<key2.toLatin1().constData()<<
- " NOT existing but key "<<key1.toLatin1().constData()<<" existing"<<endl;
+ std::cerr<<"TestEqualityCoordinates key "<<key2.toLatin1().constData()<<
+ " NOT existing but key "<<key1.toLatin1().constData()<<" existing"<<std::endl;
ok=false; continue;
}
if (tab1->size!=tab2->size)
{
- cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
- " and key "<<key2.toLatin1().constData()<<" NOT same size"<<endl;
+ std::cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
+ " and key "<<key2.toLatin1().constData()<<" NOT same size"<<std::endl;
ok=false; continue;
}
if (ok)
//1 for print vertices not equals
if (!CVW_is_equal_vertices(tab11,i1,tab22,i2,1))
{
- cerr<<j<<" Vertice "<<i1<<" != Vertice "<<i2<<"\n"<<endl;
+ std::cerr<<j<<" Vertice "<<i1<<" != Vertice "<<i2<<"\n"<<std::endl;
ok=false; ok1=false;
}
}
if ((verbose>2)&&(ok1))
- cout<<"TestEqualityCoordinates "<<tab1->size<<
- " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" ok"<<endl;
+ std::cout<<"TestEqualityCoordinates "<<tab1->size<<
+ " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" ok"<<std::endl;
if (!ok1)
- cerr<<"TestEqualityCoordinates "<<tab1->size<<
- " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" NO_OK"<<endl;
+ std::cerr<<"TestEqualityCoordinates "<<tab1->size<<
+ " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" NO_OK"<<std::endl;
key11old=key11; key22old=key22;
}
}
med_int i,nb,jd,js;
cooskin=this->restore_key(QString("SKIN_VERTICES_COORDINATES"));
- if (verbose>4)cout<<"NumberVerticesSKIN="<<cooskin->size/3<<endl;
if (!cooskin) return false;
+ if (verbose>4)std::cout<<"NumberVerticesSKIN="<<cooskin->size/3<<std::endl;
//ici pourrait creer BBtree sur skin
for (int ifile=1; ifile<=this->nbfiles; ifile++)
{
key2=key2.sprintf("GL%ld VE",ifile);
glodom=this->restore_key(key2);
if (verbose>4)
- cout<<"NumberVerticesDOMAIN_"<<ifile<<"="<<glodom->size<<endl;
+ std::cout<<"NumberVerticesDOMAIN_"<<ifile<<"="<<glodom->size<<std::endl;
if (coodom->size!=glodom->size*3)
{
- cerr<<"Find_VerticesDomainToVerticesSkin key "<<key1.toLatin1().constData()<<
- " and key "<<key2.toLatin1().constData()<<" NOT coherent sizes"<<endl;
+ std::cerr<<"Find_VerticesDomainToVerticesSkin key "<<key1.toLatin1().constData()<<
+ " and key "<<key2.toLatin1().constData()<<" NOT coherent sizes"<<std::endl;
ok=false; continue;
}
//test on equality of xyz_coordinates of commons vertices
i=0;
nb=0; //nb equals vertices
if (verbose>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"<<jd<<"\t"<<glodom->tmint[jd]<<endl;
- cout<<"\nresults: no i js iglo\n";
+ std::cout<<"\t"<<jd<<"\t"<<glodom->tmint[jd]<<std::endl;
+ std::cout<<"\nresults: no i js iglo\n";
for (jd=0; jd < coodom->size; jd=jd+3)
{
p2=(coodom->tmflo+jd);
p1=(cooskin->tmflo+js);
if (p1[0]==p2[0] && p1[1]==p2[1] && p1[2]==p2[2])
{
- cout<<"\t"<<nb<<"\t"<<i<<"\t"<<js/3<<"\t"<<glodom->tmint[i]-1<<
- key2.sprintf("\t%13.5e%13.5e%13.5e",p1[0],p1[1],p1[2]).toLatin1().constData()<<endl;
+ std::cout<<"\t"<<nb<<"\t"<<i<<"\t"<<js/3<<"\t"<<glodom->tmint[i]-1<<
+ key2.sprintf("\t%13.5e%13.5e%13.5e",p1[0],p1[1],p1[2]).toLatin1().constData()<<std::endl;
tab[i]=js/3; nb++; continue;
}
}
tmp=tmp.sprintf("NB%ld GL_SKIN",ifile);
ok=this->insert_key(tmp,montab);
if (verbose>4){
- cout<<"NumberOfEqualsVerticesDOMAIN_"<<ifile<<"="<<nb<<endl;
+ std::cout<<"NumberOfEqualsVerticesDOMAIN_"<<ifile<<"="<<nb<<std::endl;
}
}
}
//Creating child nodes
//Version tag
med_int majeur,mineur,release;
- //Quelle version de MED est utilisée
- MEDversionDonner(&majeur,&mineur,&release);
+ //Quelle version de MED est utilis�
+ MEDlibraryNumVersion(&majeur,&mineur,&release);
if (verbose>0) fprintf(stdout,"Files write with MED V%d.%d.%d\n",majeur,mineur,release);
node = xmlNewChild(root_node, 0, BAD_CAST "version",0);
//xmlNewProp(node, BAD_CAST "maj", BAD_CAST int2string2(majeur).c_str());
//Description tag
node = xmlNewChild(root_node,0, BAD_CAST "description",0);
xmlNewProp(node, BAD_CAST "what", BAD_CAST "tetrahedral mesh by tepal");
+#ifdef WIN32
+ SYSTEMTIME present;
+ GetLocalTime ( &present );
+ sprintf(buff,"%04d/%02d/%02d %02dh%02dm",
+ present.wYear,present.wMonth,present.wDay,
+ present.wHour,present.wMinute);
+#else
time_t present;
time(&present);
struct tm *time_asc = localtime(&present);
sprintf(buff,"%04d/%02d/%02d %02dh%02dm",
time_asc->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");
{
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)"<<endl;
+ std::cerr<<"CaseNameMed truncated (no more 20 characters)"<<std::endl;
medname.truncate(20);
}
//create file resume DOMAIN.joints.med of all joints for quick display (...may be...)
tmp=path+medname+tmp.sprintf("_joints.med",idom);
- charendnull(distfilename,tmp,MED_TAILLE_DESC);
- fidjoint=MEDouvrir(distfilename,MED_CREATION);
- if (fidjoint<0) cerr<<"Problem MEDouvrir "<<distfilename<<endl;
- if (verbose>0) cout<<"CreateMEDFile for all joints <"<<distfilename<<">\n";
+ charendnull(distfilename,tmp,MED_COMMENT_SIZE);
+ fidjoint=MEDfileOpen(distfilename,MED_ACC_CREAT);
+ if (fidjoint<0) std::cerr<<"Problem MEDfileOpen "<<distfilename<<std::endl;
+ if (verbose>0) std::cout<<"CreateMEDFile for all joints <"<<distfilename<<">\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 = "<<cmd<<endl;
- system(cmd.toLatin1().constData());
- if (verbose>0)cout<<"CreateMEDFile for initial skin <"<<tmp.toLatin1().constData()<<">\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 = "<<cmd<<std::endl;
+ system(cmd.toLatin1().constData());
+ if (verbose>0) std::cout<<"CreateMEDFile for initial skin <"<<tmp.toLatin1().constData()<<">\n"; }
+ else {
+ if (verbose>0) std::cout<<"No CreateMEDFile <"<<tmp.toLatin1().constData()<<"> for initial skin because <"<<
+ cmd.toLatin1().constData()<<"> does not exist\n"; }
//define family 0 if not existing, no groups
families.add("0","");
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="<<nbfilestot<<endl;
+ if (verbose>6){std::cout<<"\nIntermediatesFamilies\n"; families.write();}
+ if (verbose>6) std::cout<<"\nNumber0fFiles="<<nbfilestot<<std::endl;
familles intermediatesfamilies=families;
//initialisations on all domains
nbtetrastotal=0;
if (idom>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<<"<"<<distfilename<<">"<<endl;
- fid=MEDouvrir(distfilename,MED_CREATION);
- if (fid<0) {cerr<<"Problem MEDouvrir "<<distfilename<<endl; goto erreur;}
+ //std::cout<<"<"<<distfilename<<">"<<std::endl;
+ fid=MEDfileOpen(distfilename,MED_ACC_CREAT);
+ if (fid<0) {std::cerr<<"Problem MEDfileOpen "<<distfilename<<std::endl; goto erreur;}
if (verbose>0){
- if (verbose>2) cout<<endl;
- cout<<"CreateMEDFile "<<idom<<" <"<<distfilename<<">\n";
+ if (verbose>2) std::cout<<std::endl;
+ std::cout<<"CreateMEDFile "<<idom<<" <"<<distfilename<<">\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 : "<<description<<endl;
- err=MEDmaaCr(fid,nomfinal,3,MED_NON_STRUCTURE,description);
- if (err<0) {cerr<<"Problem MEDmaaCr"<<nomfinal<<endl; goto erreur;}
+ if (verbose>4) std::cout<<"Description : "<<description<<std::endl;
+ err=MEDmeshCr(fid,nomfinal,3,3,MED_UNSTRUCTURED_MESH,description,dtunit,MED_SORT_DTIT,MED_CARTESIAN,axisname,axisunit);
+ if (err<0) {std::cerr<<"Problem MEDmeshCr"<<nomfinal<<std::endl; goto erreur;}
- if (!idom_nodes()) {cerr<<"Problem on Nodes"<<endl; goto erreur;}
- if (!idom_edges()) {cerr<<"Problem on Edges"<<endl; goto erreur;}
- if (!idom_faces()) {cerr<<"Problem on Faces"<<endl; goto erreur;}
- if (!idom_tetras()) {cerr<<"Problem on tetrahedra"<<endl; goto erreur;}
- if (!idom_joints()) {cerr<<"Problem on Joints"<<endl; goto erreur;}
+ if (!idom_nodes()) {std::cerr<<"Problem on Nodes"<<std::endl; goto erreur;}
+ if (!idom_edges()) {std::cerr<<"Problem on Edges"<<std::endl; goto erreur;}
+ if (!idom_faces()) {std::cerr<<"Problem on Faces"<<std::endl; goto erreur;}
+ if (!idom_tetras()) {std::cerr<<"Problem on tetrahedra"<<std::endl; goto erreur;}
+ if (!idom_joints()) {std::cerr<<"Problem on Joints"<<std::endl; goto erreur;}
- if (verbose>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="<<nb<<endl;
+ if (verbose>5)std::cout<<"NumberOfFamiliesNodes="<<nb<<std::endl;
- err=MEDfamEcr(fid,nomfinal,famnodes,nbnodes,MED_NOEUD,MED_NONE);
+ err=MEDmeshEntityFamilyNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_NODE,MED_UNDEF_GEOMETRY_TYPE,nbnodes,famnodes);
if (verbose>8)
- cout<<"MEDfamEcr nodes "<<nbnodes<<":"<<
- famnodes[0]<<"..."<<famnodes[nbnodes-1]<<" "<<endl;
+ std::cout<<"MEDmeshEntityFamilyNumberWr nodes "<<nbnodes<<":"<<
+ famnodes[0]<<"..."<<famnodes[nbnodes-1]<<" "<<std::endl;
delete[] famnodes;
- if (err<0) cerr<<"Problem MEDfamEcr nodes"<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshEntityFamilyNumberWr nodes"<<std::endl;
//for others families
nb=create_families(fid,-1);
- if (verbose>5)cout<<"NumberOfFamiliesFacesAndEdgesEtc="<<nb<<endl;
+ if (verbose>5)std::cout<<"NumberOfFamiliesFacesAndEdgesEtc="<<nb<<std::endl;
- err=MEDfamEcr(fid,nomfinal,famtria3,nbtria3,MED_MAILLE,MED_TRIA3);
+ err=MEDmeshEntityFamilyNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,nbtria3,famtria3);
if (verbose>8)
- cout<<"MEDfamEcr tria3 "<<nbtria3<<":"<<
- famtria3[0]<<"..."<<famtria3[nbtria3-1]<<" "<<endl;
+ std::cout<<"MEDmeshEntityFamilyNumberWr tria3 "<<nbtria3<<":"<<
+ famtria3[0]<<"..."<<famtria3[nbtria3-1]<<" "<<std::endl;
delete[] famtria3;
- if (err<0) cerr<<"Problem MEDfamEcr tria3"<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshEntityFamilyNumberWr tria3"<<std::endl;
- err=MEDfamEcr(fid,nomfinal,famtetra4,nbtetra4,MED_MAILLE,MED_TETRA4);
+ err=MEDmeshEntityFamilyNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TETRA4,nbtetra4,famtetra4);
if (verbose>8)
- cout<<"MEDfamEcr tetra4 "<<nbtetra4<<":"<<
- famtetra4[0]<<"..."<<famtetra4[nbtria3-1]<<" "<<endl;
+ std::cout<<"MEDmeshEntityFamilyNumberWr tetra4 "<<nbtetra4<<":"<<
+ famtetra4[0]<<"..."<<famtetra4[nbtria3-1]<<" "<<std::endl;
delete[] famtetra4;
- if (err<0) cerr<<"Problem MEDfamEcr tria3"<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshEntityFamilyNumberWr tria3"<<std::endl;
- MEDfermer(fid); //no error
+ MEDfileClose(fid); //no error
//master.xml writings
oktmp=Write_masterxmlMEDfile();
continue; //and loop on others domains
erreur: //error
ok=false;
- MEDfermer(fid); //but loop on others domains
+ MEDfileClose(fid); //but loop on others domains
}
- MEDfermer(fidjoint); //no error
- if (verbose>0)cout<<"\nTotalNumberOftetrahedra="<<nbtetrastotal<<endl;
+ MEDfileClose(fidjoint); //no error
+ if (verbose>0)std::cout<<"\nTotalNumberOftetrahedra="<<nbtetrastotal<<std::endl;
return ok;
}
//qt3 xx=this->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"<<endl; return false;}
- if (verbose>4)cout<<"NumberOfNodes="<<nbnodes<<endl;
+ err=MEDmeshNodeCoordinateWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,0.,MED_FULL_INTERLACE,nbnodes,tab->tmflo);
+ if (err<0) {std::cerr<<"Problem MEDmeshNodeCoordinateWr"<<std::endl; return false;}
+ if (verbose>4)std::cout<<"NumberOfNodes="<<nbnodes<<std::endl;
//writing indices of nodes
arrayi=new med_int[nbnodes];
for (i=0; i<nbnodes ; i++) arrayi[i]=i+1;
- err=MEDnumEcr(fid,nomfinal,arrayi,nbnodes,MED_NOEUD,MED_NONE);
+ err=MEDmeshEntityNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_NODE,MED_UNDEF_GEOMETRY_TYPE,nbnodes,arrayi);
delete[] arrayi;
- if (err<0) {cerr<<"Problem MEDnumEcr of nodes"<<endl; return false;}
+ if (err<0) {std::cerr<<"Problem MEDmeshEntityNumberWr of nodes"<<std::endl; return false;}
key1=key1.sprintf("GL%d VE",idom); //global numerotation
tab1=this->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 "<<tmp.toLatin1().constData()<<endl; return false;}
+ if (!ok) {std::cerr<<"Problem file "<<tmp.toLatin1().constData()<<std::endl; return false;}
tab1=this->restore_key(key1); //tab1=this->mestab[key1];
if (!tab1) return false;
}
- if (nbnodes!=tab1->size){cerr<<"Problem size GLi VE!=nbnodes!"<<endl; return false;}
+ if (nbnodes!=tab1->size){std::cerr<<"Problem size GLi VE!=nbnodes!"<<std::endl; return false;}
key2=key2.sprintf("SKIN_VERTICES_FAMILIES",idom); //on global numerotation
tab2=this->restore_key(key2); //tab1=this->mestab[key1];
- med_int nbskin=tab2->size;
- //for (i=0; i<nbskin; i++) cout<<i<<" "<<tab2->tmint[i]<<endl;
+ med_int nbskin=0;
+ if (tab2) med_int nbskin=tab2->size;
+ //for (i=0; i<nbskin; i++) std::cout<<i<<" "<<tab2->tmint[i]<<std::endl;
//set families of nodes existing in GHS3DPRL_skin.med
med_int nb=nbnodes;
ok=set_one_more_family(famnodes,fammore,nb);
delete[] fammore;
- //cout<<"nodes loc "<<i<<" = gl "<<j<<"\t << "<<tab2->tmint[j]<<
+ //std::cout<<"nodes loc "<<i<<" = gl "<<j<<"\t << "<<tab2->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])<<endl;
+ // tab3->tmflo[i*3+1],tab3->tmflo[i*3+2])<<std::endl;
//writing nodes(vertices) global numbering
- err=MEDglobalNumEcr(fid,nomfinal,tab1->tmint,nbnodes,MED_NOEUD,MED_NONE);
- if (err<0){cerr<<"Problem MEDglobalNumEcr nodes"<<endl; return false;}
+ err=MEDmeshGlobalNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_NODE,MED_UNDEF_GEOMETRY_TYPE,nbnodes,tab1->tmint);
+ if (err<0){std::cerr<<"Problem MEDmeshGlobalNumberWr nodes"<<std::endl; return false;}
return ok;
}
if (more[i]==0) continue;
if (fami[i]==0) {
fami[i]=more[i];
- //cout<<"sur "<<i<<" en plus "<<more[i]<<endl;
+ //std::cout<<"sur "<<i<<" en plus "<<more[i]<<std::endl;
}
else { //intersection
if (fami[i]==more[i]) continue; //same families
morfam=more[i];
//create new family intersection if needed
newfam=families.find_family_on_groups(oldfam,morfam);
- //cout<<"oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<endl;
+ //std::cout<<"oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<std::endl;
fami[i]=newfam;
}
}
med_int *newfami;
nb_fam=families.fam.size(); //on families negative and positive
- //cout<<"size families "<<nb_fam<<endl;
+ //std::cout<<"size families "<<nb_fam<<std::endl;
if (nb_fam<=0) nb_fam=5; //precaution
i_zero=nb_fam*2; //offset for negative indices of families
nb_max=nb_fam*4;
- if (nb_fam>300) cout<<
- "***set_one_more_family*** warning many initial families could decrease speed "<<nb_fam<<endl;
+ if (nb_fam>300) std::cout<<
+ "***set_one_more_family*** warning many initial families could decrease speed "<<nb_fam<<std::endl;
nb_tot=nb_max*nb_max; //max oversizing *2 on families
//newfami is for speed (avoid calls find_family_on_groups)
//it is an array[nb_fam*4][nb_fam*4] implemented on vector[nb_max]
if (more[i]==0) continue;
if (fami[i]==0) {
fami[i]=more[i];
- //cout<<"sur "<<i<<" en plus "<<more[i]<<endl;
+ //std::cout<<"sur "<<i<<" en plus "<<more[i]<<std::endl;
}
else { //intersection
if (fami[i]==more[i]) continue; //same families
else {
if (nb_mess<3) {
nb_mess++;
- cout<<"***set_one_more_family*** warning many new families decrease speed "<<nb_fam<<endl;
+ std::cout<<"***set_one_more_family*** warning many new families decrease speed "<<nb_fam<<std::endl;
}
ii=-1;
newfam=0;
if (newfam==0) {
//create new family intersection if needed
newfam=families.find_family_on_groups(oldfam,morfam);
- //cout<<"new oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<endl;
+ //std::cout<<"new oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<std::endl;
if (ii>=0) newfami[ii]=newfam;
}
/*else {
- cout<<"!!! oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<endl;
+ std::cout<<"!!! oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<std::endl;
}*/
fami[i]=newfam;
}
if (!tab1) return false;
}
nbtria3=tab1->size/7;
- if (verbose>4) cout<<"NumberOfTriangles="<<nbtria3<<endl;
+ if (verbose>4) std::cout<<"NumberOfTriangles="<<nbtria3<<std::endl;
arrayi=new med_int[nbtria3*3];
ii=0,i=0 ;
for (j=0; j<nbtria3 ; j++){
arrayi[ii]=tab1->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"<<endl; return false;}
+ if (err<0){std::cerr<<"Problem MEDmeshElementConnectivityWr for triangles connectivity"<<std::endl; return false;}
//writing indices of faces triangles of wrap
//caution!
//if not in "//writing indices of tetrahedra" -> arrayi[i]=!NBFACES!+i+1
arrayi=new med_int[nbtria3];
for (i=0; i<nbtria3 ; i++) arrayi[i]=nbseg2+i+1;
- err=MEDnumEcr(fid,nomfinal,arrayi,nbtria3,MED_MAILLE,MED_TRIA3);
+ err=MEDmeshEntityNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,nbtria3,arrayi);
delete[] arrayi;
- if (err<0){cerr<<"Problem MEDnumEcr of triangles"<<endl; return false;}
+ if (err<0){std::cerr<<"Problem MEDmeshEntityNumberWr of triangles"<<std::endl; return false;}
//GLx FA=files.GLo FAces
key1=key1.sprintf("GL%d FA",idom);
tab1=this->restore_key(key1); //tab1=this->mestab[key1];
- if (nbtria3!=tab1->size){cerr<<"Problem size GLi FA!=nbtria3!"<<endl; return false;}
+ if (nbtria3!=tab1->size){std::cerr<<"Problem size GLi FA!=nbtria3!"<<std::endl; return false;}
key2=key2.sprintf("SKIN_TRIA3_FAMILIES",idom); //on global numerotation
tab2=this->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];
}
ok=set_one_more_family(famtria3,fammore,nb);
delete[] fammore;
-
+
//writing faces(triangles) global numbering
- //if (verbose>2)
- // cout<<"CreateMEDglobalNumerotation_Faces "<<key1<<" "<<tab1->size<<endl;
- err=MEDglobalNumEcr(fid,nomfinal,tab1->tmint,tab1->size,MED_MAILLE,MED_TRIA3);
- if (err<0){cerr<<"Problem MEDglobalNumEcr faces"<<endl; return false;}
+ if (verbose>2)
+ std::cout<<"CreateMEDglobalNumerotation_Faces "<<key1.toLatin1().constData()<<" "<<tab1->size<<std::endl;
+ err=MEDmeshGlobalNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,tab1->size,tab1->tmint);
+ if (err<0){std::cerr<<"Problem MEDmeshGlobalNumberWr faces"<<std::endl; return false;}
//xx=this->remove_key_mesh_wrap(QRegExp("FC*",true,true));
tmp=tmp.sprintf("GL%d FA",idom);
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
tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfilestot,idom)+".msg";
ok=this->ReadFileMSGnew(tmp);
if (!ok) {
- cerr<<"Problem in file "<<tmp.toLatin1().constData()<<endl;
+ std::cerr<<"Problem in file "<<tmp.toLatin1().constData()<<std::endl;
return false;
}
}
if (idom==ineig) continue; //impossible
//!*************nodes
- //cout<<"\n nodes joints\n";
- key1=key1.sprintf("MS%d NE%d VE SE",idom,ineig); //SE or RE?
+ //std::cout<<"\n nodes joints\n";
+ key1=key1.sprintf("MS%d NE%d VE SE",idom,ineig); //SE or RE identicals
tab1=restore_key(key1);
if (!tab1) continue; //case (ifile,ineig) are not neighbours=>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 <send> equals <receive>
- if (!tab2) cerr<<"Problem nodes joint <send> with no <receive> in file .msg"<<endl;
- nb=tab1->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 "<<tmp.toLatin1().constData()<<std::endl;
+ continue;
+ }
+ tab2=this->restore_key(key1);
+ }
+ if (!tab2) std::cerr<<"Problem existing nodes joint in domain "<<idom<<
+ " with none in neighbourg "<<ineig<<" files .msg"<<std::endl;
+ nb=tab1->size; nbnodesneig=tab2->size;
+ if (nb!=nbnodesneig) {
+ std::cerr<<"Problem in file "<<tmp.toLatin1().constData()<<
+ " number of nodes of joint "<<idom<<"<->"<<ineig<<" not equals"<<std::endl;
+ continue;
+ }
nbjoints++; //one more joint for this domain
sjoints=sjoints+" "+i2a(ineig);
if (verbose>4)
- cout<<"NumberOfNodesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<endl;
+ std::cout<<"NumberOfNodesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<std::endl;
namejoint=namejoint.sprintf("JOINT_%d_%d_Nodes",idom,ineig);
strcpy(namejnt,namejoint.toLatin1().constData());
tmp=tmp.sprintf("JOINT_%d_%d among %d domains of ",idom,ineig,nbfilestot)+nomfinal;
strcpy(descjnt,tmp.toLatin1().constData());
tmp=medname+tmp.sprintf("_%d",ineig);
strcpy(namedist,tmp.toLatin1().constData());
- err=MEDjointCr(fid,nomfinal,namejnt,descjnt,ineig,namedist);
- if (err<0) cerr<<"Problem MEDjointCr"<<endl;
+ err=MEDsubdomainJointCr(fid,nomfinal,namejnt,descjnt,ineig,namedist);
+ if (err<0) std::cerr<<"Problem MEDsubdomainJointCr"<<std::endl;
- ok=families.get_number_of_new_family(1,&famjoint,&tmp);
- families.add(tmp,namejoint);
+ famjoint=0;
+ if (namejoint.contains(deletegroups)==0){
+ ok=families.get_number_of_new_family(1,&famjoint,&tmp);
+ families.add(tmp,namejoint);
+ }
key=key.sprintf("NB%d VC",idom); //files.NoBoite Vertex Coordinates
tab=this->restore_key(key); //tab1=this->mestab[key1];
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"<<endl;
+ err=MEDsubdomainCorrespondenceWr(fid,nomfinal,namejnt,MED_NO_DT,MED_NO_IT,
+ MED_NODE,MED_UNDEF_GEOMETRY_TYPE,MED_NODE,MED_UNDEF_GEOMETRY_TYPE,nb,arrayi);
+ if (err<0) std::cerr<<"Problem MEDsubdomainCorrespondenceWr nodes"<<std::endl;
delete[] arrayi;
//!*************TRIA3
//writing correspondence triangles-triangles
- //cout<<"\n faces joints\n";
+ //std::cout<<"\n faces joints\n";
nbtria3neig=0;
- key1=key1.sprintf("MS%d NE%d FA SE",idom,ineig); //SE or RE?
+ key1=key1.sprintf("MS%d NE%d FA SE",idom,ineig); //SE or RE identicals
tab1=this->restore_key(key1); //tab1=this->mestab[key1];
if (!tab1){
if (verbose>4)
- cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"=0"<<endl;
+ std::cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"=0"<<std::endl;
//continue; //case (ifile,ineig) are not neighbours=>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 <send> equals <receive>
- if (!tab2) cerr<<"Problem triangles joint send with no receive"<<endl;
+ key1=key1.sprintf("MS%d NE%d FA SE",ineig,idom); //SE or RE identicals
+ tab2=this->restore_key(key1);
+ if (!tab2) std::cerr<<"Problem existing triangles of joint in domain "<<idom<<
+ " with none in neighbourg "<<ineig<<" files .msg"<<std::endl;
+ nb=tab1->size; nbtria3neig=tab2->size;
+ if (nb!=nbtria3neig) {
+ std::cerr<<"Problem in file "<<tmp.toLatin1().constData()<<
+ " number of triangles of joint "<<idom<<"<->"<<ineig<<" not equals"<<std::endl;
+ continue;
+ }
namejoint=namejoint.sprintf("JOINT_%d_%d_Faces",idom,ineig);
- ok=families.get_number_of_new_family(-1,&famjoint,&tmp);
- families.add(tmp,namejoint);
+ famjoint=0;
+ if (namejoint.contains(deletegroups)==0){
+ ok=families.get_number_of_new_family(-1,&famjoint,&tmp);
+ families.add(tmp,namejoint);
+ }
key=key.sprintf("FC%d",idom); //files.FaCes faces (wrap and triangles only)
tab=this->restore_key(key); //tab1=this->mestab[key1];
med_int nb=tab1->size; nbtria3neig=nb;
if (verbose>4)
- cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<endl;
+ std::cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<std::endl;
arrayi=new med_int[nb*2];
arrayfaces=new med_int[nbtria3neig*3]; //for file DOMAIN_join.med
fammore=new med_int[nbtria3];
for (i=0; i<nbtria3 ; i++) fammore[i]=0;
ii=0; jj=0;
for (i=0; i<nb ; i++){
- //no need because <send> equals <receive> tab1->tmint[i]==tab2->tmint[i]
arrayi[ii]=tab1->tmint[i]; ii++;
fammore[tab1->tmint[i]-1]=famjoint;
//famtria3[tab1->tmint[i]-1]=famjoint;
arrayi[ii]=tab2->tmint[i]; ii++;
- //cout<<arrayi[ii-1]<<"="<<arrayi[ii-2]<<endl;
+ //std::cout<<arrayi[ii-1]<<"="<<arrayi[ii-2]<<std::endl;
k=(tab1->tmint[i]-1)*7; //indice of node connectivity
arrayfaces[jj]=inodes[tab->tmint[k]-1]+1; jj++;
arrayfaces[jj]=inodes[tab->tmint[k+1]-1]+1; jj++;
arrayfaces[jj]=inodes[tab->tmint[k+2]-1]+1; jj++;
}
- ok=set_one_more_family(famtria3,fammore,nbtria3);
+ if (namejoint.contains(deletegroups)==0){
+ ok=set_one_more_family(famtria3,fammore,nbtria3);
+ }
delete[] fammore;
- err=MEDjointEcr(fid,nomfinal,namejnt,arrayi,nb,MED_MAILLE,MED_TRIA3,MED_MAILLE,MED_TRIA3);
- if (err<0) cerr<<"Problem MEDjointEcr triangles"<<endl;
+ err=MEDsubdomainCorrespondenceWr(fid,nomfinal,namejnt,MED_NO_DT,MED_NO_IT,
+ MED_CELL,MED_TRIA3,MED_CELL,MED_TRIA3,nb,arrayi);
+ if (err<0) std::cerr<<"Problem MEDsubdomainCorrespondenceWr triangles"<<std::endl;
delete[] arrayi;
}
if (idom<=ineig) { //no duplicate joint_1_2 and joint_2_1
//create mesh
namejoint=namejoint.sprintf("JOINT_%d_%d",idom,ineig);
- charendnull(namejnt,namejoint,MED_TAILLE_NOM);
+ charendnull(namejnt,namejoint,MED_NAME_SIZE);
tmp=tmp.sprintf("joint between %d and %d",idom,ineig);
- charendnull(descjnt,tmp,MED_TAILLE_DESC);
- err=MEDmaaCr(fidjoint,namejnt,3,MED_NON_STRUCTURE,descjnt);
- if (err<0) cerr<<"Problem MEDmaaCr "<<namejnt<<endl;
+ charendnull(descjnt,tmp,MED_COMMENT_SIZE);
+ err=MEDmeshCr(fidjoint,namejnt,3,3,MED_UNSTRUCTURED_MESH,descjnt,dtunit,MED_SORT_DTIT,MED_CARTESIAN,axisname,axisunit);
+ if (err<0) std::cerr<<"Problem MEDmeshCr "<<namejnt<<std::endl;
//write nodes
- err=MEDcoordEcr(fidjoint,namejnt,3,arraynodes,MED_FULL_INTERLACE,
- nbnodesneig,MED_CART,nomcoo,unicoo);
- if (err<0) cerr<<"Problem MEDcoordEcr "<<namejnt<<endl;
+ err=MEDmeshNodeCoordinateWr(fidjoint,namejnt,MED_NO_DT,MED_NO_IT,0.,MED_FULL_INTERLACE,nbnodesneig,arraynodes);
+ if (err<0) std::cerr<<"Problem MEDmeshNodeCoordinateWr "<<namejnt<<std::endl;
arrayi=new med_int[nbnodesneig];
for (i=0; i<nbnodesneig ; i++) arrayi[i]=i+1;
- err=MEDnumEcr(fidjoint,namejnt,arrayi,nbnodesneig,MED_NOEUD,MED_NONE);
+ err=MEDmeshEntityNumberWr(fidjoint,namejnt,MED_NO_DT,MED_NO_IT,MED_NODE,MED_UNDEF_GEOMETRY_TYPE,nbnodesneig,arrayi);
delete[] arrayi;
- if (err<0) cerr<<"Problem MEDnumEcr of nodes "<<namejnt<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshEntityNumberWr of nodes "<<namejnt<<std::endl;
//write tria3
if (nbtria3neig>0) {
- //for (i=0; i<nbtria3neig ; i++) cout<<i+1<<" "<<
- // arrayfaces[i*3]<<" "<<arrayfaces[i*3+1]<<" "<<arrayfaces[i*3+2]<<endl;
- err=MEDconnEcr(fidjoint,namejnt,3,arrayfaces,MED_FULL_INTERLACE,
- nbtria3neig,MED_MAILLE,MED_TRIA3,MED_NOD);
- if (err<0) cerr<<"Problem MEDconnEcr for triangles connectivity "<<namejnt<<endl;
+ //for (i=0; i<nbtria3neig ; i++) std::cout<<i+1<<" "<<
+ // arrayfaces[i*3]<<" "<<arrayfaces[i*3+1]<<" "<<arrayfaces[i*3+2]<<std::endl;
+ err=MEDmeshElementConnectivityWr(fidjoint,namejnt,MED_NO_DT,MED_NO_IT,0.,
+ MED_CELL,MED_TRIA3,MED_NODAL,MED_FULL_INTERLACE,nbtria3neig,arrayfaces);
+ if (err<0) std::cerr<<"Problem MEDmeshElementConnectivityWr for triangles connectivity "<<namejnt<<std::endl;
//writing indices of faces triangles of joint
arrayi=new med_int[nbtria3neig];
for (i=0; i<nbtria3neig ; i++) arrayi[i]=i+1;
- err=MEDnumEcr(fidjoint,namejnt,arrayi,nbtria3neig,MED_MAILLE,MED_TRIA3);
+ err=MEDmeshEntityNumberWr(fidjoint,namejnt,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,nbtria3neig,arrayi);
delete[] arrayi;
- if (err<0) cerr<<"Problem MEDnumEcr of triangles "<<namejnt<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshEntityNumberWr of triangles "<<namejnt<<std::endl;
}
}
tmp=tmp.sprintf("NB%d VC",idom);
//qt3 xx=this->remove_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));
tab1=this->restore_key(key1); //tab1=this->mestab[key1];
nbtetra4=tab1->size/4;
nbtetrastotal=nbtetrastotal + nbtetra4;
- if (verbose>5)cout<<"NumberOftetrahedra="<<nbtetra4<<endl;
- err=MEDconnEcr(fid,nomfinal,3,tab1->tmint,MED_FULL_INTERLACE,nbtetra4,MED_MAILLE,MED_TETRA4,MED_NOD);
- if (err<0){cerr<<"Problem MEDconnEcr for tetra connectivity"<<endl; return false;}
+ if (verbose>5)std::cout<<"NumberOftetrahedra="<<nbtetra4<<std::endl;
+ err=MEDmeshElementConnectivityWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,0.,MED_CELL,MED_TETRA4,MED_NODAL,MED_FULL_INTERLACE,nbtetra4,tab1->tmint);
+ if (err<0){std::cerr<<"Problem MEDmeshElementConnectivityWr for tetra connectivity"<<std::endl; return false;}
//writing indices of tetrahedra
arrayi=new med_int[nbtetra4];
for (i=0; i<nbtetra4 ; i++) arrayi[i]=nbseg2+nbtria3+i+1;
- //for (i=0; i<nbtria3 ; i++) cout<<i<<" "<<arrayi[i]<<endl;
- err=MEDnumEcr(fid,nomfinal,arrayi,nbtetra4,MED_MAILLE,MED_TETRA4);
+ //for (i=0; i<nbtria3 ; i++) std::cout<<i<<" "<<arrayi[i]<<std::endl;
+ err=MEDmeshEntityNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TETRA4,nbtetra4,arrayi);
delete[] arrayi;
- if (err<0){cerr<<"Problem MEDnumEcr of tetrahedra"<<endl; return false;}
+ if (err<0){std::cerr<<"Problem MEDmeshEntityNumberWr of tetrahedra"<<std::endl; return false;}
famtetra4=new med_int[nbtetra4];
for (i=0; i<nbtetra4 ; i++) famtetra4[i]=famnewtetra4;
}
if (tab1->size!=nbtetra4){
- cerr<<"Problem incorrect size of tetrahedra global numbering"<<endl; return false;}
+ std::cerr<<"Problem incorrect size of tetrahedra global numbering"<<std::endl; return false;}
if (verbose>2)
- cout<<"CreateMEDglobalNumerotation_tetrahedra "<<key1.toLatin1().constData()<<" "<<tab1->size<<endl;
- err=MEDglobalNumEcr(fid,nomfinal,tab1->tmint,tab1->size,MED_MAILLE,MED_TETRA4);
- if (err<0){cerr<<"Problem MEDglobalNumEcr tetrahedra"<<endl; return false;}
+ std::cout<<"CreateMEDglobalNumerotation_tetrahedra "<<key1.toLatin1().constData()<<" "<<tab1->size<<std::endl;
+ err=MEDmeshGlobalNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TETRA4,tab1->size,tab1->tmint);
+ if (err<0){std::cerr<<"Problem MEDmeshGlobalNumberWr tetrahedra"<<std::endl; return false;}
tmp=tmp.sprintf("NB%d EV",idom);
//qt3 xx=this->remove_key_mesh_wrap(QRegExp(tmp,true,true));
//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;
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 <"<<nomfam<<">\tNbGroups="<<ngro;
- gro=new char[MED_TAILLE_LNOM*ngro+2];
+ std::cout<<"CreateFamilyInMEDFile <"<<nomfam<<">\tNbGroups="<<ngro;
+ gro=new char[MED_LNAME_SIZE*ngro+2];
gb=(*it1).second;
i=0;
for (it2=gb.begin(); it2!=gb.end(); ++it2){
- charendnull(&gro[i*MED_TAILLE_LNOM],(*it2).first,MED_TAILLE_LNOM);
- if (verbose>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<<endl;
- err=MEDfamCr(fid,nomfinal,nomfam,num,NULL,NULL,NULL,0,gro,ngro);
- //&attide,&attval,attdes,natt,gro,ngro);
- if (err<0) cerr<<"Problem MEDfamCr"<<endl;
+ if (verbose>5)std::cout<<std::endl;
+ err=MEDfamilyCr(fid,nomfinal,nomfam,num,ngro,gro);
+ if (err<0) std::cerr<<"Problem MEDfamilyCr"<<std::endl;
delete[] gro;
- if (err<0) cerr<<"Problem MEDfamCr of "<<nomfam<<endl;
+ if (err<0) std::cerr<<"Problem MEDfamilyCr of "<<nomfam<<std::endl;
}
return ires;
}
-
-// 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// ---
-//
// File : ghs3dprl_mesh_wrap.h
// Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
-//
// ---
-
+//
#ifndef GHS3DPRL_MESH_WRAP_H
#define GHS3DPRL_MESH_WRAP_H
-#include <QHash>
+#include <string>
#include <map>
+#include <QHash>
#include <QRegExp>
-//Med File V 2.2 attributes
-#undef MED_H
-#undef MED_PROTO_H
-namespace med_2_2 {
- extern "C" {
-#include <med.h>
-#include <med_proto.h>
- }
-}
-
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
-using namespace std;
-using namespace med_2_2;
+//Med File V 2.2 attributes
+//#undef MED_H
+//#undef MED_PROTO_H
+
+ extern "C" {
+#include <med.h>
+//#include <med_proto.h>
+ }
class CVWtab
//contains size=size of vector and the vector (med_int or med_float)
bool is_equal(CVWtab *tab2);
};
-typedef map<QString, int> fend;
-typedef map<QString, fend> fagr;
+typedef std::map<QString, int> fend;
+typedef std::map<QString, fend> fagr;
class familles{
private:
void newfam(QString nom);
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;
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;
-// 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
//
// 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 <iostream>
#include "ghs3dprl_msg_parser.h"
#include "ghs3dprl_mesh_wrap.h"
-using namespace med_2_2;
-
//************************************
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<<indent.toLatin1().constData()<<qName.toLatin1().constData()<<std::endl;
//************************************
bool ghs3dprl_msg_parser::endElement(const QString &namespaceURI,
- const QString &localName,
- const QString &qName)
+ const QString &localName,
+ const QString &qName)
{
indent.remove((uint)0,3);
if (verbose) std::cout<<indent.toLatin1().constData()<<"\\"<<qName.toLatin1().constData()<<std::endl;
double ver=str.toDouble(&ok);
if (!ok || ver!=1e0)
{
- std::cout<<"version "<<str.toLatin1().constData()<<" fichier .msg inconnue"<<std::endl;
- return false;
+ std::cout<<"version "<<str.toLatin1().constData()<<" fichier .msg inconnue"<<std::endl;
+ return false;
}
else return true;
}
//printf("%staille attendue=%i taille vue=%i\n",(const char *)indent.toLatin1().constData(),nbcount,nb);
do
{
- tmint[i]=str.section(' ',i,i).toLong(&ok);
- //printf("tmint[%i]=%i\n",i,tmint[i]);
- i++;
+ tmint[i]=str.section(' ',i,i).toLong(&ok);
+ //printf("tmint[%i]=%i\n",i,tmint[i]);
+ i++;
} while ((i<nb) && ok );
if (i<nb)
{
- std::cout<<"pb conversion "<<i<<" eme entier="<<str.section(' ',i-1,i-1).toLatin1().constData()<<std::endl;
- std::cout<<indent.toLatin1().constData()<<"etat="<<etat<<" nb="<<nb<<std::endl<<str.toLatin1().constData()<<std::endl;
+ std::cout<<"pb conversion "<<i<<" eme entier="<<str.section(' ',i-1,i-1).toLatin1().constData()<<std::endl;
+ std::cout<<indent.toLatin1().constData()<<"etat="<<etat<<" nb="<<nb<<std::endl<<str.toLatin1().constData()<<std::endl;
}
}
if (nb==1)
tmint[0]=str.toLong(&ok);
if (!ok)
{
- std::cout<<"pb conversion 1er entier="<<str.toLatin1().constData()<<std::endl;
- std::cout<<indent.toLatin1().constData()<<"etat="<<etat<<" nb="<<nb<<std::endl;
+ std::cout<<"pb conversion 1er entier="<<str.toLatin1().constData()<<std::endl;
+ std::cout<<indent.toLatin1().constData()<<"etat="<<etat<<" nb="<<nb<<std::endl;
}
}
" neighbour="<<neighbourindice<<
" file="<<mailw->nofile<<std::endl;*/
tmp=tmp.sprintf("MS%ld NE%ld ",
- mailw->nofile,neighbourindice)+
- shorttypel+shortsendreceive;
+ mailw->nofile,neighbourindice)+
+ shorttypel+shortsendreceive;
tmp=tmp.simplified();
ok=mailw->insert_key(tmp,montab);
return true;
-// 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
//
// 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
-// 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// ---
-//
// File : tepal2med.cxx
// Author : Christian VAN WAMBEKE (CEA)
-//
// ---
-
+//
/*
** prog principal de ghs3dprl
*/
#include <stdio.h> /* printf clrscr fopen fread fwrite fclose */
#include <string>
#include <cstring>
+#include <cstdlib>
#include <iostream>
#include <sstream>
#include <fstream>
+#include <vector>
+#ifndef WIN32
+#include <unistd.h>
+#endif
#include <qstring.h>
+
#include <QXmlSimpleReader>
#include <QXmlInputSource>
#include <QApplication>
#include "ghs3dprl_msg_parser.h"
#include "dlg_ghs3dmain.h"
+#ifdef WIN32
+#include <io.h>
+#include <windows.h>
+#define F_OK 0
+#endif
+
//#include "MEDMEM_Exception.hxx"
//#include "MEDMEM_define.hxx"
extern "C" {
#include <med.h>
//#include <med_config.h>
-#include <med_utils.h>
+//#include <med_utils.h>
//#include <med_misc.h>
-#include <stdlib.h>
}
-using namespace std;
-using namespace med_2_2;
-
//************************************
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 "<<fichier<<" not HDF V5 formatted\n";
+ std::cerr<<"File "<<fichier<<" not MED or HDF V5 formatted\n";
return fid;
}
/* Quelle version de MED est utilise par mdump ? */
- MEDversionDonner(&majeur,&mineur,&release);
+ MEDlibraryNumVersion(&majeur,&mineur,&release);
if (verbose>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); }
{
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 *** "<<chaine<<"\n";
-
- /*version qt4
- char chaine[nomfilemed.length() + 1];
- strncpy(chaine, nomfilemed.toStdString().c_str(), nomfilemed.length());
- //?chaine[nomfilemed.length()]= '\0';
- cout<<"fichier "<<chaine<<"\n";*/
+ //std::cout<<"*** ReadFileMED *** "<<chaine<<"\n";
- //char *pt=chaine;
fid=ouvre_fichier_MED(chaine,mymailw->verbose);
+ free(chaine);
if (fid == 0) {
- cerr<<"Problem opening file "<<nomfilemed.toLatin1().constData()<<"\n";
- //ret = MEDfermer(fid);
+ std::cerr<<"Problem opening file "<<nomfilemed.toLatin1().constData()<<"\n";
return false;
}
- nmaa = MEDnMaa(fid);
+ nmaa = MEDnMesh(fid);
if (nmaa <= 0){
- cerr<<"No meshes in "<<nomfilemed.toLatin1().constData()<<"\n";
- ret = MEDfermer(fid);
+ std::cerr<<"No meshes in "<<nomfilemed.toLatin1().constData()<<"\n";
+ ret = MEDfileClose(fid);
return false;
}
- if (nmaa > 1) cout<<"More than one mesh in "<<nomfilemed.toLatin1().constData()<<", first one taken\n";
- ret = MEDmaaInfo(fid,numero,mymailw->nommaa,&mdim,&type_maillage,
- mymailw->maillage_description);
+ if (nmaa > 1) std::cout<<"More than one mesh in "<<nomfilemed.toLatin1().constData()<<", first one taken\n";
+ ret = MEDmeshInfo(fid,numero,mymailw->nommaa,&sdim,&mdim,&type_maillage,mymailw->maillage_description,
+ dtunit,&sortingtype,&nstep,&axistype,axisname,axisunit);
if (ret < 0){
- cerr<<"Problem MEDmaaInfo in "<<nomfilemed.toLatin1().constData()<<"\n";
- ret = MEDfermer(fid);
+ std::cerr<<"Problem MEDmeshInfo in "<<nomfilemed.toLatin1().constData()<<"\n";
+ ret = MEDfileClose(fid);
return false;
}
if (mdim != 3){
- cerr<<"Problem dimension mesh should be 3: "<<mdim<<"\n";
- ret = MEDfermer(fid);
+ std::cerr<<"Problem mesh dimension should be 3: "<<mdim<<"\n";
+ ret = MEDfileClose(fid);
return false;
}
- edim = MEDdimEspaceLire(fid,mymailw->nommaa);
- if (!((edim == 3)||(edim == -1))){
- cerr<<"Problem dimension Espace should be 3 or -1: "<<edim<<"\n";
- ret = MEDfermer(fid);
+ if (sdim != 3){
+ std::cerr<<"Problem space dimension should be 3: "<<sdim<<"\n";
+ ret = MEDfileClose(fid);
return false;
}
- if (type_maillage != MED_NON_STRUCTURE){
- cerr<<"Problem type mesh should be MED_NON_STRUCTURE: "<<type_maillage<<endl;
- ret = MEDfermer(fid);
+ if (type_maillage != MED_UNSTRUCTURED_MESH){
+ std::cerr<<"Problem type mesh should be MED_NON_STRUCTURE: "<<type_maillage<<std::endl;
+ ret = MEDfileClose(fid);
return false;
}
//lecture nb de noeuds
- med_int nnoe=MEDnEntMaa(fid,mymailw->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;
/*for (i=0;i<MED_NBR_GEOMETRIE_MAILLE;i++){
nmailles[i]=MEDnEntMaa(fid,mymailw->nommaa,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"<<nommai[i]<<"="<<nmailles[i]<<endl;
+ if (mymailw->verbose>6) std::cout<<"NumberOf"<<nommai[i]<<"="<<nmailles[i]<<std::endl;
}*/
- nbtria3=MEDnEntMaa(fid,mymailw->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="<<nfam<<endl;
- cout<<"NumberOfVertices="<<nnoe<<endl;
- cout<<"NumberOfMED_SEG2="<<nbseg2<<endl;
- cout<<"NumberOfMED_TRIA3="<<nbtria3<<"\n\n";
+ std::cout<<"\nNumberOfFamilies="<<nfam<<std::endl;
+ std::cout<<"NumberOfVertices="<<nnoe<<std::endl;
+ std::cout<<"NumberOfMED_SEG2="<<nbseg2<<std::endl;
+ std::cout<<"NumberOfMED_TRIA3="<<nbtria3<<"\n\n";
}
if (nbtria3<3){
- cerr<<"Problem number of MED_TRIA3 < 3, not a skin of a volume\n";
- ret = MEDfermer(fid);
+ std::cerr<<"Problem number of MED_TRIA3 < 3, not a skin of a volume\n";
+ ret = MEDfileClose(fid);
return false;
}
-med_int famdelete[nfam],ifamdelete=0,idelete;
+med_int ifamdelete=0,idelete;
+std::vector<med_int> famdelete = std::vector<med_int>(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;i<nfam;i++) famdelete[i]=0;
for (i=0;i<nfam;i++) {
//nombre de groupes
- ngro = MEDnGroupe(fid,mymailw->nommaa,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 "<<numfam<<" have "<<natt<<" attributes and "<<ngro<<" groups\n";
+ std::cout<<"Family "<<numfam<<" have "<<ngro<<" groups\n";
//affichage des resultats
- for (j=0;j<natt;j++) {
- if (j==0) cout<<" Attributes :\n";
- strncpy(str1,attdes+j*MED_TAILLE_DESC,MED_TAILLE_DESC);
- str1[MED_TAILLE_DESC] = '\0';
- fprintf(stdout," ident = %d\t value = %d\t description = %s\n",
- *(attide+j),*(attval+j),str1);
- }
for (j=0;j<ngro;j++) {
- if (j==0) cout<<" Groups :\n";
- strncpy(str2,gro+j*MED_TAILLE_LNOM,MED_TAILLE_LNOM);
- str2[MED_TAILLE_LNOM] = '\0';
+ if (j==0) std::cout<<" Groups :\n";
+ strncpy(str2,gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
+ str2[MED_LNAME_SIZE] = '\0';
fprintf(stdout," name = %s\n",str2);
}
- if (i==nfam-1) cout<<endl;
+ if (i==nfam-1) std::cout<<std::endl;
}
QString sfam,sgro;
sfam=sfam.sprintf("%d",numfam);
idelete=0;
for (j=0;j<ngro;j++){
- strncpy(str2,gro+j*MED_TAILLE_LNOM,MED_TAILLE_LNOM);
- str2[MED_TAILLE_LNOM]='\0';
+ strncpy(str2,gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
+ str2[MED_LNAME_SIZE]='\0';
sgro=str2;
if (sgro.contains(mymailw->deletegroups)>0) {
- //cout<<"idelete++ "<<sgro<<endl;
+ //std::cout<<"idelete++ "<<sgro<<std::endl;
idelete++;
}
}
if (idelete==ngro && ngro>0) { //only delete family whith all delete groups
- //cout<<"famdelete++ "<<numfam<<" "<<ifamdelete<<" "<<ngro<<endl;
+ //std::cout<<"famdelete++ "<<numfam<<" "<<ifamdelete<<" "<<ngro<<std::endl;
famdelete[ifamdelete]=numfam;
ifamdelete++;
}
else {
for (j=0;j<ngro;j++){
- strncpy(str2,gro+j*MED_TAILLE_LNOM,MED_TAILLE_LNOM);
- str2[MED_TAILLE_LNOM]='\0';
+ strncpy(str2,gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
+ str2[MED_LNAME_SIZE]='\0';
sgro=str2;
QRegExp qgroup=QRegExp("Group_Of_All",Qt::CaseSensitive,QRegExp::RegExp);
if (sgro.contains(mymailw->deletegroups)==0){
if (sgro.contains(qgroup)>0) {
sgro="Skin_"+sgro; //pas sur que ce soit pertinent
}
- if (mymailw->verbose>8) cout<<"families.add("<<sfam.toLatin1().constData()<<
+ if (mymailw->verbose>8) std::cout<<"families.add("<<sfam.toLatin1().constData()<<
","<<sgro.toLatin1().constData()<<")\n";
mymailw->families.add(sfam,sgro);
}
else {
//sgro="Skin_"+sgro; //pas sur que ce soit pertinent
- //cout<<"--deletegroups matches \""<<sfam<<","<<sgro<<"\"\n";
- if (mymailw->verbose>3) cout<<"--deletegroups matches \""<<
+ //std::cout<<"--deletegroups matches \""<<sfam<<","<<sgro<<"\"\n";
+ if (mymailw->verbose>3) std::cout<<"--deletegroups matches \""<<
sgro.toLatin1().constData()<<
- "\" in family "<<numfam<<endl;
+ "\" in family "<<numfam<<std::endl;
}
}
}
/*for (j=0;j<ngro;j++){
- strncpy(str2,gro+j*MED_TAILLE_LNOM,MED_TAILLE_LNOM);
- str2[MED_TAILLE_LNOM]='\0';
+ strncpy(str2,gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
+ str2[MED_LNAME_SIZE]='\0';
sgro=str2;
- //cout<<"families.add("<<sfam<<","<<sgro<<")\n";
+ //std::cout<<"families.add("<<sfam<<","<<sgro<<")\n";
if (sgro.contains(mymailw->deletegroups)==0){
//sgro="Skin_"+sgro; //pas sur que ce soit pertinent
- cout<<"families.add("<<sfam<<","<<sgro<<")\n";
+ std::cout<<"families.add("<<sfam<<","<<sgro<<")\n";
mymailw->families.add(sfam,sgro);
}
else {
- cout<<"--deletegroups matches \""<<sgro<<"\"\n";
+ std::cout<<"--deletegroups matches \""<<sgro<<"\"\n";
famdelete[ifamdelete]=numfam
ifamdelete++;
}
}*/
//on libere la memoire
- free(attide);
- free(attval);
- free(attdes);
free(gro);
}
}
-//cout<<"famdelete"; for (j=0;j<ifamdelete;j++) cout<<" "<<famdelete[j]; cout<<endl;
+//std::cout<<"famdelete"; for (j=0;j<ifamdelete;j++) std::cout<<" "<<famdelete[j]; std::cout<<std::endl;
if (mymailw->verbose>3){
- cout<<"\nFamiliesAndGroupsOf "<<nomfilemed.toLatin1().constData()<<endl;
+ std::cout<<"\nFamiliesAndGroupsOf "<<nomfilemed.toLatin1().constData()<<std::endl;
mymailw->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;i<nnoe*mdim;i=i+3) {
fprintf(stdout,"%5d %13.5e %13.5e %13.5e %5d \n",
(i/3+1), coo[i], coo[i+1], coo[i+2], famnodesskin[i/3]);
}
- cout<<endl;
+ std::cout<<std::endl;
}
med_int *conn2=new med_int[nbseg2*2];
- ret=MEDconnLire(fid,mymailw->nommaa,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;i<nbseg2*2;i=i+2) {
fprintf(stdout,"%5d %5d %5d %5d \n",
(i/2+1), conn2[i], conn2[i+1], famseg2skin[i/2]);
}
- cout<<endl;
+ std::cout<<std::endl;
}
med_int *conn3=new med_int[nbtria3*3];
- ret=MEDconnLire(fid,mymailw->nommaa,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;i<nbtria3*3;i=i+3) {
fprintf(stdout,"%5d %5d %5d %5d %5d \n",
(i/3+1), conn3[i], conn3[i+1], conn3[i+2], famtria3skin[i/3]);
}
- cout<<endl;
+ std::cout<<std::endl;
}
/*liberation memoire?
delete[] nufano;*/
if (ifamdelete>0) {
- //cout<<"!!!!!!!!nodes "<<famnodesskin[0]<<" "<<nnoe<<famdelete[1]<<endl;
+ //std::cout<<"!!!!!!!!nodes "<<famnodesskin[0]<<" "<<nnoe<<famdelete[1]<<std::endl;
for (i=0;i<nnoe;i++) {
for (j=0;j<ifamdelete;j++) {
if (famnodesskin[i]==famdelete[j]) {
- //cout<<"nodes "<<famnodesskin[i]<<" "<<i<<" "<<famdelete[j]<<endl;
+ //std::cout<<"nodes "<<famnodesskin[i]<<" "<<i<<" "<<famdelete[j]<<std::endl;
famnodesskin[i]=0; }
}
}
//if (mymailw->verbose>6) ok=mymailw->list_keys_mesh_wrap();
- ret = MEDfermer(fid);
+ ret = MEDfileClose(fid);
if (ret < 0){
- cerr<<"Problem closing "<<nomfilemed.toLatin1().constData()<<"\n";
+ std::cerr<<"Problem closing "<<nomfilemed.toLatin1().constData()<<"\n";
return false;
}
return true;
bool string2int(const string &s, int *v)
//string s=argv[1] ; int ii;
//ok=string2int(s,&ii);
-//cout<<"test "<<ii<<" "<<ok<<endl;
+//std::cout<<"test "<<ii<<" "<<ok<<std::endl;
{
string splus=s + " -1"; //evite conversion ok sur "+9truc" qui passe sinon
istringstream ss(splus);
bool string2float(const string &s, float *v)
//float ff;
//ok=string2float(s,&ff);
-//cout<<"test3 "<<ff<<" "<<ok<<endl;
+//std::cout<<"test3 "<<ff<<" "<<ok<<std::endl;
{
string splus=s + " -1"; //evite conversion ok sur "+9truc" qui passe sinon
istringstream ss(splus);
int i,nb,nbfiles,limit_swap,nbelem_limit_swap,limit_swap_defaut,verbose;
QString path,pathini,casename,casenamemed,fileskinmed,
tmp,cmd,format,
- test,menu,launchtepal,background,meshholes,deletegroups,
- version="V1.4";
+ test,menu,launchtepal,background,deletegroups,
+ version="V2.0 (MED3)";
char *chelp=NULL,
*ccasename=NULL,
*cmenu=NULL,
*claunchtepal=NULL,
*cbackground=NULL,
- *cmeshholes=NULL,
*cdeletegroups=NULL;
for (i = 0; i < argc; i++){
else if (!strncmp (argv[i], "--menu=", sizeof ("--menu"))) cmenu = &(argv[i][sizeof ("--menu")]);
else if (!strncmp (argv[i], "--launchtepal=", sizeof ("--launchtepal"))) claunchtepal = &(argv[i][sizeof ("--launchtepal")]);
else if (!strncmp (argv[i], "--background=", sizeof ("--background"))) cbackground = &(argv[i][sizeof ("--background")]);
- else if (!strncmp (argv[i], "--meshholes=", sizeof ("--meshholes"))) cmeshholes = &(argv[i][sizeof ("--meshholes")]);
else if (!strncmp (argv[i], "--deletegroups=", sizeof ("--deletegroups"))) cdeletegroups = &(argv[i][sizeof ("--deletegroups")]);
}
if (argc < 2 || chelp){
- cout<<"Available options:\n"
+ std::cout<<"tepal2med "<<version.toLatin1().constData()<<" Available options:\n"
" --help : produces this help message\n"<<
" --casename : path and name of input tepal2med files which are\n"<<
" - output files of tepal .msg .noboite .faces .points .glo\n"<<
" --menu : a GUI menu for option number\n"<<
" --launchtepal : also launch tepal on files casename.faces and casename.points and option number\n"<<
" --background : force background mode from launch tepal and generation of final MED files (big meshes)\n"<<
- " --meshholes : force parameter component of tetmesh-ghs3d to mesh holes\n"<<
" --deletegroups : regular expression (see QRegExp) which matches unwanted groups in final MED files\n"<<
+ " (try --deletegroups=\"(\\bJOINT)\"\n"<<
" (try --deletegroups=\"(\\bAll_Nodes|\\bAll_Faces)\"\n"<<
" (try --deletegroups=\"((\\bAll_|\\bNew_)(N|F|T))\"\n";
- cout<<"example:\n"<<
- " tepal2med --casename=/tmp/GHS3DPRL --number=2 --medname=DOMAIN\n"<<
- " --limitswap=1000 --verbose=0 --test=yes --menu=no --launchtepal=no\n\n";
+ std::cout<<"example:\n tepal2med --casename=/tmp/GHS3DPRL --number=2 --medname=DOMAIN "<<
+ "--limitswap=1000 --verbose=0 --test=yes --menu=no --launchtepal=no\n\n";
return 1; //no output files
}
if (!ccasename){
- cerr<<"--casename: a path/name is expected\n\n";
+ std::cerr<<"--casename: a path/name is expected\n\n";
return 1;
}
casename=ccasename;
if (!cnumber){
- cerr<<"--number: an integer is expected\n\n";
+ std::cerr<<"--number: an integer is expected\n\n";
return 1;
}
tmp=cnumber;
nbfiles=tmp.toLong(&ok,10);
if (!ok){
- cerr<<"--number: an integer is expected\n\n";
+ std::cerr<<"--number: an integer is expected\n\n";
return 1;
}
if (nbfiles<=0){
- cerr<<"--number: a positive integer is expected\n\n";
+ std::cerr<<"--number: a positive integer is expected\n\n";
return 1;
}
if (nbfiles>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;
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;
}
}
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;
}
}
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
m->show();
a.exec();
if ( m->result() == QDialog::Accepted ) {
- cout<<"parameters "<<m->KeepFiles()<<" "<<m->NbPart()<<endl;
+ std::cout<<"parameters "<<m->KeepFiles()<<" "<<m->NbPart()<<std::endl;
nbfiles=m->NbPart();
}
else {
path="./";
casenamemed=casenamemed.section('/',-1);
if (casenamemed.length()>20){
- cerr<<"--medname truncated (no more 20 characters)"<<endl;
+ std::cerr<<"--medname truncated (no more 20 characters)"<<std::endl;
casenamemed.truncate(20);
}
pathini="./";
casename=casename.section('/',-1);
if (casename.length()>20){
- cerr<<"--casename truncated (no more 20 characters)"<<endl;
+ std::cerr<<"--casename truncated (no more 20 characters)"<<std::endl;
casename.truncate(20);
}
- /*cout<<"CaseNameMed="<<casenamemed<<endl;
- cout<<"PathMed="<<path<<endl;*/
+ /*std::cout<<"CaseNameMed="<<casenamemed<<std::endl;
+ std::cout<<"PathMed="<<path<<std::endl;*/
deletegroups="(\\bxyz)"; //default improbable name
if (cdeletegroups){
//verbose=5;
if (verbose>0)
- cout<<"tepal2med "<<version.toLatin1().constData()<<" parameters:"<<
+ std::cout<<"tepal2med "<<version.toLatin1().constData()<<" parameters:"<<
"\n --casename="<<pathini.toLatin1().constData()<<casename.toLatin1().constData()<<
"\n --number="<<nbfiles<<
"\n --medname="<<path.toLatin1().constData()<<casenamemed.toLatin1().constData()<<
"\n --menu="<<menu.toLatin1().constData()<<
"\n --launchtepal="<<launchtepal.toLatin1().constData()<<
"\n --background="<<background.toLatin1().constData()<<
- "\n --meshholes="<<meshholes.toLatin1().constData()<<
"\n --deletegroups=\""<<deletegroups.toLatin1().constData()<<"\"\n";
- //med_idt fid=MEDouvrir("/tmp/empty.med",MED_CREATION);
- //med_err ret=MEDfermer(fid);
- //system("sleep 30");
- //return 0; //ok
-
//utile si appel par plugin ghs3dprl sur big meshes et tepal sur plusieurs jours
+#ifndef WIN32
if (background=="yes"){
pid_t pid = fork();
if (pid > 0) {
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="<<cbackground<<
- "\n "<<cmd.toLatin1().constData()<<endl;
+ cmd="tepal -f "+pathini+casename+" -n "+cmd.sprintf("%d",nbfiles)+" > "+path+"tepal.log";
+ std::cout<<"\nlaunchtepal command: background="<<cbackground<<
+ "\n "<<cmd.toLatin1().constData()<<std::endl;
system(cmd.toLatin1().constData()); // run
//sometimes it is better to wait flushing files on slow filesystem...
system("sleep 3");
//handler.verbose=true;
handler.mailw=mymailw;
mymailw->families.no=1;
- //cout<<"coucou1 "<<mymailw->families.no<<endl;
+ //std::cout<<"coucou1 "<<mymailw->families.no<<std::endl;
//mymailw->families.add(casename,casenamemed);
format=format.sprintf("%d",nbfiles);
int nbf=format.length();
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 <"<<fileskinmed.toLatin1().constData()<<"> 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
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="<<tmp.toLatin1().constData()<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
ok=mymailw->ReadFileMSGnew(tmp);
}
if (verbose>0)
- cout<<"NumberOfFilesMSGacquired="<<mymailw->nbfiles<<"\n\n";
+ std::cout<<"NumberOfFilesMSGacquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles){
- cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
return 1;
}
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="<<tmp<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp<<std::endl;
QFile File(tmp);
QXmlInputSource source(&File);
reader.parse(source);
File.close();
}
if (verbose>0)
- cout<<"NumberOfFilesMSGAcquired="<<mymailw->nbfiles<<"\n";
+ std::cout<<"NumberOfFilesMSGAcquired="<<mymailw->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;
}
}
//because <send> equals <receive>
nb=0;
nb=mymailw->remove_key_mesh_wrap(QRegExp("RE",Qt::CaseSensitive,QRegExp::RegExp));
- if (verbose>3) cout<<"NumberOfKeysRemoved="<<nb<<endl;
+ if (verbose>3) std::cout<<"NumberOfKeysRemoved="<<nb<<std::endl;
if (verbose>3) ok=mymailw->list_keys_mesh_wrap();
//test read files .noboiteb
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="<<tmp.toLatin1().constData()<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
ok=mymailw->ReadFileNOBOITE(tmp);
}
if (verbose>0)
- cout<<"NumberOfFilesNOBOITEAcquired="<<mymailw->nbfiles<<"\n";
+ std::cout<<"NumberOfFilesNOBOITEAcquired="<<mymailw->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;
}
//}
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="<<tmp.toLatin1().constData()<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
ok=mymailw->ReadFileFACES(tmp);
}
if (verbose>0)
- cout<<"NumberOfFilesFACESAcquired="<<mymailw->nbfiles<<"\n\n";
+ std::cout<<"NumberOfFilesFACESAcquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles){
- cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
return 1;
}
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="<<tmp.toLatin1().constData()<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
ok=mymailw->ReadFilePOINTS(tmp);
}
if (verbose>0)
- cout<<"NumberOfFilesPOINTSAcquired="<<mymailw->nbfiles<<"\n\n";
+ std::cout<<"NumberOfFilesPOINTSAcquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles)
{
- cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
return 1;
}
*/
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="<<tmp.toLatin1().constData()<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
ok=mymailw->ReadFileGLO(tmp);
//mymailw->SwapOutOfMemory_key_mesh_wrap(QRegExp("GL",true,false));
}
if (verbose>0)
- cout<<"NumberOfFilesGLOAcquired="<<mymailw->nbfiles<<"\n\n";
+ std::cout<<"NumberOfFilesGLOAcquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles){
- cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
return 1;
}
//test remove points (type 3)
//nb=mymailw->remove_key_mesh_wrap(QRegExp("PO",true,false));
- //cout<<"***remove_key_mesh_wrap*** remove nb="<<nb<<endl;
+ //std::cout<<"***remove_key_mesh_wrap*** remove nb="<<nb<<std::endl;
//ok=mymailw->list_keys_mesh_wrap();
ok=mymailw->Find_VerticesDomainToVerticesSkin();
ok=mymailw->Write_MEDfiles_v2(true); //deletekeys=true
nb=mymailw->remove_all_keys_mesh_wrap();
- if (verbose>3)cout<<"***remove_all_key_mesh_wrap*** "<<nb<<" keys removed\n";
- if (verbose>0)cout<<endl<<"===end of "<<argv[0]<<"==="<<endl;
+ if (verbose>3)std::cout<<"***remove_all_key_mesh_wrap*** "<<nb<<" keys removed\n";
+ if (verbose>0)std::cout<<std::endl<<"===end of "<<argv[0]<<"==="<<std::endl;
//for debug
//int res=dumpMED("/home/wambeke/tmp/DOMAIN_1.med",1);
return 0; //ok
}
-
--- /dev/null
+# 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
+#
+
+# File : Makefile.in
+# Module : GHS3DPRLPLUGIN
+#
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+
+# Scripts to be installed.
+dist_salomescript_DATA= \
+ facespoints2mesh.py \
+ mesh2facespoints.py
+
+install-data-hook:
+ @for f in $(dist_salomescript_DATA) ; do \
+ chmod -f a+x $(DESTDIR)$(salomescriptdir)/$$f ; \
+ done
--- /dev/null
+#!/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 input files .faces and .points of Tepal V1
+to input file .mesh of Tepal V2
+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
+
+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
--- /dev/null
+#!/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+'<cr>'
+ res=fs.readline()
+ break
+ if tag+' ' in line:
+ #print 'vertices<sp>'
+ 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)