Compare commits

...

38 Commits

Author SHA1 Message Date
ouv
2e650d124a First compilable version 2009-12-14 11:43:31 +00:00
vsr
10fc3eb3e0 Merge from V5_1_3_BR branch (07/12/09) 2009-12-08 16:04:11 +00:00
adam
ab2d564ff9 *** empty log message *** 2009-10-27 13:04:27 +00:00
adam
9744d220ed Netgen 4.9.11 compatibility 2009-10-26 17:13:37 +00:00
maintenance team
5ca9caacaa Changing version to 5.1.3 2009-10-12 07:30:13 +00:00
eap
4a9ffe08f7 minor change 2009-10-08 13:48:26 +00:00
eap
f39abee419 0020526: [CEA] Disk meshing fails
care of orientation of a sole edge in a wire
2009-10-08 13:41:49 +00:00
eap
26f711647c 0020526: [CEA] Disk meshing fails
1) in PrepareOCCgeometry(), map all subshapes in meshedSM is not provided
2) untabify
2009-10-08 13:39:52 +00:00
vsr
b09de1d401 Remove JoinObjectParameters() method 2009-10-01 11:42:20 +00:00
vsr
417c06b5ac Issue 0020377: [windows] Problems with OSD_File Remove 2009-10-01 11:15:36 +00:00
ptv
347223da4b 0019296: Too small Max element Area 2009-10-01 06:28:39 +00:00
adam
fb14d85a93 Fix an un-initialisation 2009-09-14 14:58:16 +00:00
vsr
86ce9df746 Issue 20371: remove the creation of netgen.prof : additional patch 2009-08-26 07:02:49 +00:00
skl
59cd9829d6 Additional protection in method Evaluate(). 2009-08-25 07:49:58 +00:00
ptv
10408a1fcd 0019296: EDF 681 SMESH - Pre-evaluation of the number of elements before mesh
Replace hard coded values of element types by new enumeration (added in advanced mesh info Improvement)
2009-08-25 05:47:16 +00:00
vsr
f40c6eace6 Issue 20406: Time compilation when recompiling 2009-08-21 08:32:58 +00:00
vsr
a2e972884c Issue 0020194: EDF 977 ALL: Get rid of warnings PACKAGE_VERSION already defined 2009-08-13 05:40:23 +00:00
adam
fd6f6eae03 Contribution from Eduardo Suárez <esuarez@itccanarias.org>
on the forum ...
2009-08-07 08:53:33 +00:00
adam
84651dec8d Fix :
o The incomplete makeForSalome.sh
 o missing  #include <cstring> in
     libsrc/general/symbolta.hpp
     libsrc/occ/occgeom.hpp
2009-08-07 08:11:56 +00:00
skl
3cd53c4b5e Protection before invalid hypothesises for "Evaluate" operation. 2009-08-06 12:46:03 +00:00
vsr
9a0411d941 Merge from V5_1_2_BR branch (14 July 2009) 2009-07-15 08:19:56 +00:00
maintenance team
fa15077ca0 Fix compilation problem on Debian Sarge 2009-07-10 06:26:38 +00:00
skl
5b90097c3f Implememtation of evaluation for improvement 0019296. 2009-06-29 13:17:40 +00:00
eap
75c7a9333a 0020206: EDF SMESH 987: Netgen1D2D3D +submesh (Regression : Compute Mesh_2)
SMDS_MeshElement::GetNode() no more wraps indices
2009-06-10 09:02:43 +00:00
maintenance team
58429b7405 Changing version to 5.1.2 2009-06-01 10:25:38 +00:00
vsr
4178edae0a Issue 20371: remove the creation of netgen.prof ? 2009-05-29 07:02:39 +00:00
adam
b32d520638 cmake port 2009-05-26 09:43:27 +00:00
vsr
0857e7bffe 0020354: EDF 1031 OTHER warnings with automake 1.10 2009-05-22 12:35:34 +00:00
eap
46adf58292 0020279: [CEA 334] control the "random" use when using mesh algorithms
sort faces by IDs
2009-05-19 15:44:24 +00:00
eap
4db4ace92a 0020206: EDF SMESH 987: Netgen1D2D3D +submesh
orient previosly generated faces correctly
2009-03-12 12:11:11 +00:00
eap
1552ad307a 0020200: EDF SMESH 983: changing algo of a mesh and switching back to original algo leads to different result than original
sort nodes by ID
2009-03-10 16:36:42 +00:00
eap
92aed1e510 0020198: EDF NETGENPLUGIN 979 : mesh of parallepiped with Netgen1D2D3D crashes Salome
-        mparams.grading = 0;
+        mparams.grading = 0.01;
2009-03-10 10:51:11 +00:00
adam
74459a0d46 Test EXPORTS definition with target name as suggested by cmake 2009-03-06 15:11:53 +00:00
mzn
e3e64a8856 Fix for bug 0019977: Installation of Salome modules wihtout gui. 2009-02-25 17:53:39 +00:00
adam
d044e30e9c compatibility windows compilation with cmake 2009-02-24 09:35:11 +00:00
adam
19f84535d7 *** empty log message *** 2009-02-24 09:09:25 +00:00
eap
93b251f66d 19923: EDF 765 SMESH : default values of hypothesis
set default values
2009-02-24 08:28:39 +00:00
maintenance team
af62c662c5 Changing version to 5.1.1 2009-02-18 07:06:20 +00:00
33 changed files with 1159 additions and 445 deletions

View File

@ -45,7 +45,7 @@ SUBDIRS = idl adm_local resources src bin
DIST_SUBDIRS = idl adm_local resources src bin DIST_SUBDIRS = idl adm_local resources src bin
DISTCLEANFILES = a.out aclocal.m4 configure DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh
salomeinclude_DATA = NETGENPLUGIN_version.h salomeinclude_DATA = NETGENPLUGIN_version.h

View File

@ -0,0 +1,50 @@
# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
SET(NETGENHOME $ENV{NETGENHOME})
FIND_PATH(NETGEN_INCLUDES_DIR nglib.h ${NETGENHOME}/include)
SET(NETGEN_INCLUDES)
SET(NETGEN_INCLUDES ${NETGEN_INCLUDES} -I${NETGEN_INCLUDES_DIR})
SET(NETGEN_INCLUDES ${NETGEN_INCLUDES} -DNO_PARALLEL_THREADS -DOCCGEOMETRY)
FIND_LIBRARY(NETGEN_LIB_csg csg PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_gen gen PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_geom2d geom2d PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_gprim gprim PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_la la PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_mesh mesh PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_nginterface nginterface PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_occ occ PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_opti opti PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_stlgeom stlgeom PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
SET(NETGEN_LIBS)
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_csg})
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_gen})
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_geom2d})
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_gprim})
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_la})
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_mesh})
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_nginterface})
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_occ})
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_opti})
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_stlgeom})

View File

@ -35,6 +35,8 @@ AC_ARG_WITH(netgen,
NETGEN_INCLUDES="" NETGEN_INCLUDES=""
NETGEN_LIBS_DIR="" NETGEN_LIBS_DIR=""
NETGEN_LIBS=""
NETGEN_NEW=no
Netgen_ok=no Netgen_ok=no
@ -52,29 +54,29 @@ fi
if test "x$NETGEN_HOME" != "x"; then if test "x$NETGEN_HOME" != "x"; then
echo if test -f ${NETGEN_HOME}/lib/libnglib.so ; then
echo NETGEN_NEW=yes
echo ------------------------------------------------- fi
echo ----------------------------------------------------------
echo ----------------------------------------------------------
echo You are about to choose to use somehow the echo You are about to choose to use somehow the
echo Netgen Library to generate Tetrahedric mesh. echo Netgen Library to generate Tetrahedric mesh.
echo
echo WARNING
echo ---------------------------------------------------------- echo ----------------------------------------------------------
echo ---------------------------------------------------------- echo ----------------------------------------------------------
echo You are strongly advised to consult the file echo You are strongly advised to consult the file
echo NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers, particularly about echo NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers, particularly
echo assumptions made on the installation of the Netgen echo about assumptions made on the installation of the Netgen
echo application and libraries. echo application and libraries.
echo Ask your system administrator for those details.
echo ---------------------------------------------------------- echo ----------------------------------------------------------
echo ---------------------------------------------------------- echo ----------------------------------------------------------
echo
echo
NETGEN_INCLUDES="-I${NETGEN_HOME}/include" NETGEN_INCLUDES="-I${NETGEN_HOME}/include"
if test "$NETGEN_NEW" = "yes" ; then
NETGEN_INCLUDES="${NETGEN_INCLUDES} -DNETGEN_NEW -I${NETGEN_HOME}/share/netgen/include"
fi
# check ${NETGEN_HOME}/lib/LINUX directory for libraries # check ${NETGEN_HOME}/lib/LINUX directory for libraries
if test -f ${NETGEN_HOME}/lib/LINUX/libcsg.a ; then if test -f ${NETGEN_HOME}/lib/LINUX/libcsg.a ; then
NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX" NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX"
@ -99,6 +101,8 @@ if test "x$NETGEN_HOME" != "x"; then
AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no) AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no)
if test "x$Netgen_ok" == "xyes"; then if test "x$Netgen_ok" == "xyes"; then
if test "$NETGEN_NEW" = "no" ; then
AC_MSG_CHECKING(for Netgen libraries) AC_MSG_CHECKING(for Netgen libraries)
LDFLAGS_old="$LDFLAGS" LDFLAGS_old="$LDFLAGS"
@ -127,22 +131,100 @@ namespace nglib {
rm -rf linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o csgparser.o dynamicmem.o extrusion.o occconstruction.o parthreads.o readuser.o writeabaqus.o writediffpack.o writeelmer.o writefeap.o writefluent.o writegmsh.o writejcm.o writepermas.o writetecplot.o writetochnog.o writeuser.o wuchemnitz.o, rm -rf linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o csgparser.o dynamicmem.o extrusion.o occconstruction.o parthreads.o readuser.o writeabaqus.o writediffpack.o writeelmer.o writefeap.o writefluent.o writegmsh.o writejcm.o writepermas.o writetecplot.o writetochnog.o writeuser.o wuchemnitz.o,
Netgen_ok=no) Netgen_ok=no)
AC_CACHE_VAL(salome_netgen_lib,[ AC_CACHE_VAL(salome_cv_netgen_lib,[
AC_TRY_LINK( AC_TRY_LINK([
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
namespace nglib { namespace nglib {
#include "nglib.h" #include "nglib.h"
} }
#define OCCGEOMETRY #define OCCGEOMETRY
#include <occgeom.hpp> #include <occgeom.hpp>
,nglib::Ng_Init(); ],[
netgen::OCCGeometry occgeo; nglib::Ng_Init();
nglib::Ng_Exit();, netgen::OCCGeometry occgeo;
eval "salome_netgen_lib=yes";rm -rf libNETGEN.so,eval "salome_netgen_lib=no";rm -rf libNETGEN.so) nglib::Ng_Exit();
]) ],
Netgen_ok="$salome_netgen_lib" [eval "salome_cv_netgen_lib=yes";rm -rf libNETGEN.so],
[eval "salome_cv_netgen_lib=no";rm -rf libNETGEN.so])
])
Netgen_ok="$salome_cv_netgen_lib"
else
LDFLAGS_old="$LDFLAGS"
LDFLAGS="-L${NETGEN_LIBS_DIR} -lnglib $CAS_LDPATH -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo $LDFLAGS"
AC_MSG_CHECKING(for official Netgen libraries)
AC_CACHE_VAL(salome_cv_netgen_lib,[
AC_TRY_LINK([
#include <iostream>
#include <fstream>
namespace nglib {
#include "nglib.h"
}
],[
nglib::Ng_Init();
nglib::Ng_Exit();
],
[eval "salome_cv_netgen_lib=yes"],
[eval "salome_cv_netgen_lib=no"])
])
Netgen_ok="$salome_cv_netgen_lib"
if test "$Netgen_ok" = "yes" ; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(for occ support in Netgen libraries)
AC_CACHE_VAL(salome_cv_netgen_occ_lib,[
AC_TRY_LINK([
#include <iostream>
#include <fstream>
#define OCCGEOMETRY
namespace nglib {
#include "nglib.h"
}
],[
nglib::Ng_Init();
nglib::Ng_OCC_Geometry * ng_occ_geom = nglib::Ng_OCC_NewGeometry();
nglib::Ng_Exit();
],
[eval "salome_cv_netgen_occ_lib=yes"],
[eval "salome_cv_netgen_occ_lib=no"])
])
Netgen_ok="$salome_cv_netgen_occ_lib"
fi
if test "$Netgen_ok" = "yes" ; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(for salome patch in Netgen installation)
AC_CACHE_VAL(salome_cv_netgen_salome_patch_lib,[
AC_TRY_LINK([
#include <iostream>
#include <fstream>
#define OCCGEOMETRY
namespace nglib {
#include "nglib.h"
}
#include <occgeom.hpp>
],[
nglib::Ng_Init();
netgen::OCCGeometry occgeo;
nglib::Ng_Exit();
],
[eval "salome_cv_netgen_salome_patch_lib=yes"],
[eval "salome_cv_netgen_salome_patch_lib=no"])
])
Netgen_ok="$salome_cv_netgen_salome_patch_lib"
fi
if test "x$Netgen_ok" == xno ; then
AC_MSG_RESULT(no)
AC_MSG_ERROR(Netgen is not properly installed)
fi
NETGEN_LIBS="-L${NETGEN_LIBS_DIR} -lnglib"
fi
LDFLAGS="$LDFLAGS_old" LDFLAGS="$LDFLAGS_old"
fi fi
@ -160,6 +242,8 @@ fi
AC_SUBST(NETGEN_INCLUDES) AC_SUBST(NETGEN_INCLUDES)
AC_SUBST(NETGEN_LIBS_DIR) AC_SUBST(NETGEN_LIBS_DIR)
AC_SUBST(NETGEN_LIBS)
AM_CONDITIONAL(NETGEN_NEW, [test x"$NETGEN_NEW" = x"yes"])
AC_LANG_RESTORE AC_LANG_RESTORE

View File

@ -19,6 +19,14 @@
# #
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@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 # This file defines the common definitions used in several
# Makefile. This file must be included, if needed, by the file # Makefile. This file must be included, if needed, by the file

30
build_cmake Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
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 --netgenplugin
status=$?
cd ${CURRENT_DIR}
exit $status

2
build_cmake.bat Normal file
View File

@ -0,0 +1,2 @@
%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --netgenplugin

View File

@ -30,7 +30,6 @@
# #
ORIG_DIR=`pwd` ORIG_DIR=`pwd`
CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"` CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
NETGENPLUGIN_WITH_GUI="yes"
######################################################################## ########################################################################
# Test if the KERNEL_ROOT_DIR is set correctly # Test if the KERNEL_ROOT_DIR is set correctly
@ -46,27 +45,6 @@ fi
# echo "failed : KERNEL_SRC variable is not correct !" # echo "failed : KERNEL_SRC variable is not correct !"
# exit # exit
#fi #fi
for option
do
case $option in
-with-gui | --with-gui)
NETGENPLUGIN_WITH_GUI="yes"
break;;
-without-gui | --without-gui | -with-gui=no | --with-gui=no)
NETGENPLUGIN_WITH_GUI="no"
break;;
esac
done
########################################################################
# Test if the GUI_ROOT_DIR is set correctly
if test ${NETGENPLUGIN_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 # Test if the MED_ROOT_DIR is set correctly
@ -96,53 +74,21 @@ cd ${CONF_DIR}
ABS_CONF_DIR=`pwd` ABS_CONF_DIR=`pwd`
####################################################################### #######################################################################
# Update configure.ac script: to set NETGENPLUGIN_WITH_GUI variable
sed -e s/NETGENPLUGIN_WITH_GUI=[a-z]*/NETGENPLUGIN_WITH_GUI=${NETGENPLUGIN_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 # 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. # and KERNEL config_files directory.
# output: # output:
# aclocal.m4 # aclocal.m4
# autom4te.cache (directory) # autom4te.cache (directory)
echo "====================================================== aclocal" echo "======================================================= aclocal"
if test ${NETGENPLUGIN_WITH_GUI} = yes; then aclocal -I adm_local/unix/config_files \
aclocal -I adm_local/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \ -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
-I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
else
aclocal -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
-I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
fi
# ____________________________________________________________________ # ____________________________________________________________________
# libtoolize creates some configuration files (ltmain.sh, # libtoolize creates some configuration files (ltmain.sh,
@ -150,10 +96,10 @@ fi
# version. The files are created in the directory specified with the # version. The files are created in the directory specified with the
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
# output: # output:
# salome_adm/unix/config_files/config.guess # adm_local/unix/config_files/config.guess
# salome_adm/unix/config_files/config.sub # adm_local/unix/config_files/config.sub
# salome_adm/unix/config_files/ltmain.sh # adm_local/unix/config_files/ltmain.sh
#echo "====================================================== libtoolize" echo "==================================================== libtoolize"
libtoolize --force --copy --automake || exit 1 libtoolize --force --copy --automake || exit 1
@ -173,11 +119,11 @@ autoconf
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
# creates the Makefile.in files from the Makefile.am files. # creates the Makefile.in files from the Makefile.am files.
# output: # output:
# salome_adm/unix/config_files/compile # adm_local/unix/config_files/compile
# salome_adm/unix/config_files/depcomp # adm_local/unix/config_files/depcomp
# salome_adm/unix/config_files/install-sh # adm_local/unix/config_files/install-sh
# salome_adm/unix/config_files/missing # adm_local/unix/config_files/missing
# salome_adm/unix/config_files/py-compile # adm_local/unix/config_files/py-compile
# Makefile.in (from Makefile.am) # Makefile.in (from Makefile.am)
echo "====================================================== automake" echo "====================================================== automake"

View File

@ -31,11 +31,11 @@
# Reorganization for usage of autotools # Reorganization for usage of autotools
# Created from configure.in.base # Created from configure.in.base
# #
AC_INIT([Salome2 Project NETGENPLUGIN module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeNETGENPLUGIN]) AC_INIT([Salome2 Project NETGENPLUGIN module], [5.1.3], [webmaster.salome@opencascade.com], [SalomeNETGENPLUGIN])
AC_CONFIG_AUX_DIR(salome_adm/unix/config_files) AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE([-Wno-portability])
XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'` XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
AC_SUBST(XVERSION) AC_SUBST(XVERSION)
@ -80,6 +80,7 @@ echo
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_PROG_INSTALL AC_PROG_INSTALL
AC_LOCAL_INSTALL
dnl dnl
dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques ! dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
@ -101,7 +102,7 @@ dnl Fix up the INSTALL macro if it s a relative path. We want the
dnl full-path to the binary instead. dnl full-path to the binary instead.
case "$INSTALL" in case "$INSTALL" in
*install-sh*) *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 esac
@ -237,11 +238,34 @@ AC_SUBST_FILE(CORBA)
corba=make_$ORB corba=make_$ORB
CORBA=adm_local/unix/$corba CORBA=adm_local/unix/$corba
NETGENPLUGIN_WITH_GUI=yes echo
echo ---------------------------------------------
echo Testing GUI
echo ---------------------------------------------
echo
AM_CONDITIONAL(NETGENPLUGIN_ENABLE_GUI, [test "${NETGENPLUGIN_WITH_GUI}" = "yes"]) CHECK_GUI_MODULE
if test "${NETGENPLUGIN_WITH_GUI}" = "yes"; then gui_ok=no
if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then
gui_ok=yes
fi
AM_CONDITIONAL(NETGENPLUGIN_ENABLE_GUI, [test "${gui_ok}" = "yes"])
if test "${SalomeGUI_need}" == "yes"; then
if test "${FullGUI_ok}" != "yes"; then
AC_MSG_WARN(For configure NETGENPLUGIN 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 --------------------------------------------- echo ---------------------------------------------
echo testing openGL echo testing openGL
@ -265,26 +289,6 @@ if test "${NETGENPLUGIN_WITH_GUI}" = "yes"; then
echo echo
CHECK_VTK CHECK_VTK
echo
echo ---------------------------------------------
echo Testing GUI
echo ---------------------------------------------
echo
CHECK_SALOME_GUI
echo
echo ---------------------------------------------
echo Testing full GUI
echo ---------------------------------------------
echo
CHECK_CORBA_IN_GUI
if test "x${CORBA_IN_GUI}" != "xyes"; then
echo "failed : For configure NETGENPLUGIN module necessary full GUI !"
exit
fi
fi fi
echo echo
@ -360,11 +364,13 @@ echo
#AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"]) #AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
echo Configure echo Configure
if test "${NETGENPLUGIN_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 SMesh_ok Netgen_ok" if test "${gui_ok}" = "yes"; then
fi 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 gui_ok Geom_ok SMesh_ok Netgen_ok"
if test "${NETGENPLUGIN_WITH_GUI}" = "no"; then elif test "${SalomeGUI_need}" != "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 SMesh_ok Netgen_ok" 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 gui_ok Geom_ok SMesh_ok Netgen_ok"
else
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 SMesh_ok Netgen_ok"
fi fi
for var in $variables for var in $variables
@ -405,18 +411,17 @@ echo
# autoscan, the Makefile list is generated in the output file configure.scan. # autoscan, the Makefile list is generated in the output file configure.scan.
# This could be helpfull to update de configuration. # This could be helpfull to update de configuration.
AC_OUTPUT([ \ AC_OUTPUT([ \
./salome_adm/unix/SALOMEconfig.h \ adm_local/Makefile \
./adm_local/Makefile \ adm_local/unix/Makefile \
./adm_local/unix/Makefile \ adm_local/unix/config_files/Makefile \
./adm_local/unix/config_files/Makefile \ bin/VERSION \
./bin/VERSION \ bin/Makefile \
./bin/Makefile \ NETGENPLUGIN_version.h \
./NETGENPLUGIN_version.h \ src/Makefile \
./src/Makefile \ src/GUI/Makefile \
./src/GUI/Makefile \ src/NETGEN/Makefile \
./src/NETGEN/Makefile \ src/NETGENPlugin/Makefile \
./src/NETGENPlugin/Makefile \ resources/Makefile \
./resources/Makefile \ idl/Makefile \
./idl/Makefile \
Makefile \ Makefile \
]) ])

View File

@ -46,7 +46,6 @@ libSalomeIDLNETGENPLUGIN_la_CPPFLAGS = \
$(SMESH_CXXFLAGS) \ $(SMESH_CXXFLAGS) \
@CORBA_CXXFLAGS@ \ @CORBA_CXXFLAGS@ \
@CORBA_INCLUDES@ \ @CORBA_INCLUDES@ \
-I$(top_builddir)/salome_adm/unix \
-I$(top_builddir)/idl -I$(top_builddir)/idl
libSalomeIDLNETGENPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0 libSalomeIDLNETGENPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0
@ -71,8 +70,7 @@ IDLCXXFLAGS = \
-I$(top_builddir)/idl/salome \ -I$(top_builddir)/idl/salome \
-I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome \
-I$(GEOM_ROOT_DIR)/idl/salome \ -I$(GEOM_ROOT_DIR)/idl/salome \
-I$(SMESH_ROOT_DIR)/idl/salome \ -I$(SMESH_ROOT_DIR)/idl/salome
-I$(top_builddir)/salome_adm/unix
IDLPYFLAGS = \ IDLPYFLAGS = \
@IDLPYFLAGS@ \ @IDLPYFLAGS@ \
-I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome \
@ -108,7 +106,7 @@ mostlyclean-local:
@for dep in $^ dummy; do \ @for dep in $^ dummy; do \
if [ $$dep != "dummy" ]; then \ if [ $$dep != "dummy" ]; then \
echo Building dependencies for $$dep; \ echo Building dependencies for $$dep; \
$(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(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/' >>$@; \ sed 's/\.o/\SK.cc/' >>$@; \
fi; \ fi; \
done ; done ;

View File

@ -63,11 +63,12 @@ libNETGENPluginGUI_la_CPPFLAGS = \
$(CORBA_CXXFLAGS) \ $(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \ $(CORBA_INCLUDES) \
-I$(srcdir)/../NETGENPlugin \ -I$(srcdir)/../NETGENPlugin \
-I$(top_builddir)/idl \ -I$(top_builddir)/idl
-I$(top_builddir)/salome_adm/unix
libNETGENPluginGUI_la_LDFLAGS = \ libNETGENPluginGUI_la_LDFLAGS = \
../NETGENPlugin/libNETGENEngine.la \ ../NETGENPlugin/libNETGENEngine.la \
${QT_MT_LIBS} \
${GUI_LDFLAGS} -lSalomeApp -lqtx -lsuit \
${SMESH_LDFLAGS} -lSMESH \ ${SMESH_LDFLAGS} -lSMESH \
$(CAS_KERNEL) $(CAS_KERNEL)

View File

@ -26,7 +26,7 @@
// $Header: // $Header:
// //
#ifdef WIN32 #ifdef WIN32
#ifdef NETGENPLUGIN_GUI_EXPORTS #if defined NETGENPLUGIN_GUI_EXPORTS || defined NETGENPluginGUI_EXPORTS
#define NETGENPLUGIN_GUI_EXPORT __declspec( dllexport ) #define NETGENPLUGIN_GUI_EXPORT __declspec( dllexport )
#else #else
#define NETGENPLUGIN_GUI_EXPORT __declspec( dllimport ) #define NETGENPLUGIN_GUI_EXPORT __declspec( dllimport )

View File

@ -37,8 +37,8 @@
#include <SUIT_ResourceMgr.h> #include <SUIT_ResourceMgr.h>
#include <SalomeApp_Tools.h> #include <SalomeApp_Tools.h>
#include <SalomeApp_DoubleSpinBox.h> #include <SalomeApp_DoubleSpinBox.h>
#include <SalomeApp_Notebook.h>
#include <QComboBox> #include <QComboBox>
#include <QLabel> #include <QLabel>
@ -69,7 +69,7 @@ NETGENPluginGUI_HypothesisCreator::~NETGENPluginGUI_HypothesisCreator()
{ {
} }
bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg) const bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg, QStringList& absentParams) const
{ {
NetgenHypothesisData data_old, data_new; NetgenHypothesisData data_old, data_new;
readParamsFromHypo( data_old ); readParamsFromHypo( data_old );
@ -77,10 +77,10 @@ bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg) const
bool res = storeParamsToHypo( data_new ); bool res = storeParamsToHypo( data_new );
storeParamsToHypo( data_old ); storeParamsToHypo( data_old );
res = myMaxSize->isValid(msg,true) && res; res = myMaxSize->isValid(msg,absentParams,true) && res;
res = myGrowthRate->isValid(msg,true) && res; ; res = myGrowthRate->isValid(msg,absentParams,true) && res; ;
res = myNbSegPerEdge->isValid(msg,true) && res; res = myNbSegPerEdge->isValid(msg,absentParams,true) && res;
res = myNbSegPerRadius->isValid(msg,true) && res; res = myNbSegPerRadius->isValid(msg,absentParams,true) && res;
return res; return res;
} }
@ -242,20 +242,20 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromHypo( NetgenHypothesisData
HypothesisData* data = SMESH::GetHypothesisData( hypType() ); HypothesisData* data = SMESH::GetHypothesisData( hypType() );
h_data.myName = isCreation() && data ? data->Label : ""; h_data.myName = isCreation() && data ? data->Label : "";
SMESH::ListOfParameters_var aParameters = h->GetLastParameters(); SALOME::StringArray* aParameters = h->GetParameters();
h_data.myMaxSize = h->GetMaxSize(); h_data.myMaxSize = h->GetMaxSize();
h_data.myMaxSizeVar = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString(""); h_data.myMaxSizeVar = (aParameters->length() > 0) ? QString(aParameters->operator[](0).in()) : QString("");
h_data.mySecondOrder = h->GetSecondOrder(); h_data.mySecondOrder = h->GetSecondOrder();
h_data.myOptimize = h->GetOptimize(); h_data.myOptimize = h->GetOptimize();
h_data.myFineness = (int) h->GetFineness(); h_data.myFineness = (int) h->GetFineness();
h_data.myGrowthRate = h->GetGrowthRate(); h_data.myGrowthRate = h->GetGrowthRate();
h_data.myGrowthRateVar = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString(""); h_data.myGrowthRateVar = (aParameters->length() > 1) ? QString(aParameters->operator[](1).in()) : QString("");
h_data.myNbSegPerEdge = h->GetNbSegPerEdge(); h_data.myNbSegPerEdge = h->GetNbSegPerEdge();
h_data.myNbSegPerEdgeVar = (aParameters->length() > 2) ? QString(aParameters[2].in()) : QString(""); h_data.myNbSegPerEdgeVar = (aParameters->length() > 2) ? QString(aParameters->operator[](2).in()) : QString("");
h_data.myNbSegPerRadius = h->GetNbSegPerRadius(); h_data.myNbSegPerRadius = h->GetNbSegPerRadius();
h_data.myNbSegPerRadiusVar = (aParameters->length() > 3) ? QString(aParameters[3].in()) : QString(""); h_data.myNbSegPerRadiusVar = (aParameters->length() > 3) ? QString(aParameters->operator[](3).in()) : QString("");
if ( myIs2D ) if ( myIs2D )
{ {
@ -307,14 +307,7 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi
h_2d->SetQuadAllowed( h_data.myAllowQuadrangles ); h_2d->SetQuadAllowed( h_data.myAllowQuadrangles );
} }
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); getNotebook()->setParameters( h, aVariablesList );
if( fineness==UserDefined )
{
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
}
} }
catch(const SALOME::SALOME_Exception& ex) catch(const SALOME::SALOME_Exception& ex)
{ {

View File

@ -57,7 +57,7 @@ public:
NETGENPluginGUI_HypothesisCreator( const QString& ); NETGENPluginGUI_HypothesisCreator( const QString& );
virtual ~NETGENPluginGUI_HypothesisCreator(); virtual ~NETGENPluginGUI_HypothesisCreator();
virtual bool checkParams(QString& msg) const; virtual bool checkParams(QString& msg, QStringList& absentParams) const;
virtual QString helpPage() const; virtual QString helpPage() const;
protected: protected:

View File

@ -39,6 +39,7 @@
// SALOME GUI includes // SALOME GUI includes
#include <SalomeApp_Tools.h> #include <SalomeApp_Tools.h>
#include <SalomeApp_IntSpinBox.h> #include <SalomeApp_IntSpinBox.h>
#include <SalomeApp_Notebook.h>
// Qt includes // Qt includes
#include <QLabel> #include <QLabel>
@ -83,14 +84,14 @@ NETGENPluginGUI_SimpleCreator::~NETGENPluginGUI_SimpleCreator()
{ {
} }
bool NETGENPluginGUI_SimpleCreator::checkParams(QString& msg) const bool NETGENPluginGUI_SimpleCreator::checkParams(QString& msg, QStringList& absentParams) const
{ {
bool result = true; bool result = true;
result = myNbSeg->isValid(msg,true) && result; result = myNbSeg->isValid(msg,absentParams,true) && result;
result = myLength->isValid(msg,true) && result; result = myLength->isValid(msg,absentParams,true) && result;
result = myArea->isValid(msg,true) && result; result = myArea->isValid(msg,absentParams,true) && result;
if (myVolume) if (myVolume)
result = myVolume->isValid(msg,true) && result; result = myVolume->isValid(msg,absentParams,true) && result;
return result; return result;
} }
@ -225,37 +226,35 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
if ( isCreation() ) if ( isCreation() )
myName->setText( hypName() ); myName->setText( hypName() );
// set default real values // Set default values
NETGENPlugin_SimpleHypothesis_2D_var h = NETGENPlugin_SimpleHypothesis_2D_var h =
NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis( hasInitParamsHypothesis() )); NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis( hasInitParamsHypothesis() ));
if ( double len = h->GetLocalLength() ) int dfltNbSeg = (int) h->GetNumberOfSegments();
myNbSeg->setValue( dfltNbSeg );
if ( double len = h->GetLocalLength() ) {
myLength->setValue( len ); myLength->setValue( len );
if ( double area = h->GetMaxElementArea() ) myArea->setValue( len * len );
myArea->setValue( area ); if ( myVolume )
if ( myVolume ) { myVolume->setValue( len * len * len );
NETGENPlugin_SimpleHypothesis_3D_var h3d =
NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis( hasInitParamsHypothesis()) );
if ( double volume = (double) h3d->GetMaxElementVolume() )
myVolume->setValue( volume );
} }
h = NETGENPlugin_SimpleHypothesis_2D::_narrow( hypothesis() ); h = NETGENPlugin_SimpleHypothesis_2D::_narrow( hypothesis() );
// set values of hypothesis // set values of hypothesis
SMESH::ListOfParameters_var aParameters = h->GetLastParameters(); SALOME::StringArray* aParameters = h->GetParameters();
// 1D // 1D
int nbSeg = (int) h->GetNumberOfSegments(); int nbSeg = isCreation() ? dfltNbSeg : (int) h->GetNumberOfSegments();
myNbSegRadioBut->setChecked( nbSeg ); myNbSegRadioBut->setChecked( nbSeg );
myLengthRadioBut->setChecked( !nbSeg ); myLengthRadioBut->setChecked( !nbSeg );
QString aPrm; QString aPrm;
if ( nbSeg ) { if ( nbSeg ) {
myLength->setEnabled( false ); myLength->setEnabled( false );
myNbSeg->setEnabled( true ); myNbSeg->setEnabled( true );
aPrm = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString(""); aPrm = (aParameters->length() > 0) ? QString(aParameters->operator[](0).in()) : QString("");
if(aPrm.isEmpty()) if(aPrm.isEmpty())
myNbSeg->setValue( nbSeg ); myNbSeg->setValue( nbSeg );
else else
@ -264,7 +263,7 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
else { else {
myNbSeg->setEnabled( false ); myNbSeg->setEnabled( false );
myLength->setEnabled( true ); myLength->setEnabled( true );
aPrm = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString(""); aPrm = (aParameters->length() > 0) ? QString(aParameters->operator[](0).in()) : QString("");
if(aPrm.isEmpty()) if(aPrm.isEmpty())
myLength->setValue( h->GetLocalLength() ); myLength->setValue( h->GetLocalLength() );
else else
@ -275,7 +274,7 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
if ( double area = h->GetMaxElementArea() ) { if ( double area = h->GetMaxElementArea() ) {
myLenFromEdgesCheckBox->setChecked( false ); myLenFromEdgesCheckBox->setChecked( false );
myArea->setEnabled( true ); myArea->setEnabled( true );
aPrm = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString(""); aPrm = (aParameters->length() > 1) ? QString(aParameters->operator[](1).in()) : QString("");
if(aPrm.isEmpty()) if(aPrm.isEmpty())
myArea->setValue( area ); myArea->setValue( area );
else else
@ -292,7 +291,7 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
if ( double volume = (double) h->GetMaxElementVolume() ) { if ( double volume = (double) h->GetMaxElementVolume() ) {
myLenFromFacesCheckBox->setChecked( false ); myLenFromFacesCheckBox->setChecked( false );
myVolume->setEnabled( true ); myVolume->setEnabled( true );
aPrm = (aParameters->length() > 2) ? QString(aParameters[2].in()) : QString(""); aPrm = (aParameters->length() > 2) ? QString(aParameters->operator[](2).in()) : QString("");
if(aPrm.isEmpty()) if(aPrm.isEmpty())
myVolume->setValue( volume ); myVolume->setValue( volume );
else else
@ -331,8 +330,6 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
aVariablesList.append(myLength->text()); aVariablesList.append(myLength->text());
} }
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
// 2D // 2D
if ( myArea->isEnabled() ) { if ( myArea->isEnabled() ) {
h->SetMaxElementArea( myArea->value() ); h->SetMaxElementArea( myArea->value() );
@ -345,8 +342,6 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
aVariablesList.append(QString()); aVariablesList.append(QString());
} }
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
// 3D // 3D
if ( myVolume ) { if ( myVolume ) {
NETGENPlugin_SimpleHypothesis_3D_var h = NETGENPlugin_SimpleHypothesis_3D_var h =
@ -361,8 +356,9 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
valStr += "; lenFromFaces"; valStr += "; lenFromFaces";
aVariablesList.append(QString()); aVariablesList.append(QString());
} }
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
} }
getNotebook()->setParameters( h, aVariablesList );
} }
catch(const SALOME::SALOME_Exception& ex) catch(const SALOME::SALOME_Exception& ex)
{ {

View File

@ -45,7 +45,7 @@ public:
NETGENPluginGUI_SimpleCreator(const QString& theHypType); NETGENPluginGUI_SimpleCreator(const QString& theHypType);
virtual ~NETGENPluginGUI_SimpleCreator(); virtual ~NETGENPluginGUI_SimpleCreator();
virtual bool checkParams(QString& msg) const; virtual bool checkParams(QString& msg, QStringList& absentParams) const;
virtual QString helpPage() const; virtual QString helpPage() const;
protected: protected:

View File

@ -27,7 +27,11 @@
# #
include $(top_srcdir)/adm_local/unix/make_common_starter.am include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = NETGEN NETGENPlugin SUBDIRS =
if ! NETGEN_NEW
SUBDIRS += NETGEN
endif
SUBDIRS += NETGENPlugin
if NETGENPLUGIN_ENABLE_GUI if NETGENPLUGIN_ENABLE_GUI
SUBDIRS += GUI SUBDIRS += GUI

View File

@ -1,3 +1,41 @@
# ------------------------------------------------------------------
# ------------------------------------------------------------------
# Notes for Netgen >= 4.9
# ------------------------------------------------------------------
# ------------------------------------------------------------------
Netgen can be find at http://www.hpfem.jku.at/netgen/
1. How to build Netgen for Netgen Plugin
------------------------------
1.1. Download Netgen archive (here netgen-4.9.11.tar.gz) and unpack it
1.2. Configure the netgen compilation. The "good" options are
../netgen-4.9.11/configure \
--prefix=THE_INSTALLATION_PATH \
--enable-occ --enable-nglib --with-occ=${CASROOT} \
CXXFLAGS="-DOCCGEOMETRY -I${CASROOT}/inc -DHAVE_IOSTREAM -DHAVE_LIMITS -DHAVE_LIMITS_H -DHAVE_IOMANIP -I${TOGL_HOME}/include" \
LDFLAGS="-L${TOGL_HOME}/lib/Togl1.7"
1.3. Compile the netgen product
make then make install
1.4. Patch the installation directory to copy include files
needed by NETGEN Plugin. Use the script
NETGENPLUGIN_SRC/src/NETGEN/netgen_copy_include_for_salome
to achieve that. The first argument is the directory containing
the Netgen sources. The second argument is THE_INSTALLATION_PATH
Erwan ADAM
erwan.adam@cea.fr
# ------------------------------------------------------------------
# ------------------------------------------------------------------
# Notes for Netgen 4.5
# ------------------------------------------------------------------
# ------------------------------------------------------------------
The Netgen 4.5 from the web location : http://www.hpfem.jku.at/netgen/ The Netgen 4.5 from the web location : http://www.hpfem.jku.at/netgen/
(CVS access) is used in the SMESH Module of Salome3 distribution. (CVS access) is used in the SMESH Module of Salome3 distribution.
@ -92,3 +130,8 @@ The suggested patch alters some Netgen sources to compile them.
Michael SAZONOV Michael SAZONOV
m-sazonov@opencascade.com m-sazonov@opencascade.com
# ------------------------------------------------------------------
# ------------------------------------------------------------------
# ------------------------------------------------------------------
# ------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
diff -Naur netgen-4.5.old/libsrc/csg/meshsurf.cpp netgen-4.5.new/libsrc/csg/meshsurf.cpp diff -Naur netgen-4.5.old/libsrc/csg/meshsurf.cpp netgen-4.5.new/libsrc/csg/meshsurf.cpp
--- netgen-4.5.old/libsrc/csg/meshsurf.cpp 2006-02-14 11:54:35.000000000 +0300 --- netgen-4.5.old/libsrc/csg/meshsurf.cpp 2006-02-14 08:54:35.000000000 +0000
+++ netgen-4.5.new/libsrc/csg/meshsurf.cpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/csg/meshsurf.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -77,11 +77,12 @@ @@ -77,11 +77,12 @@
} }
@ -16,8 +16,8 @@ diff -Naur netgen-4.5.old/libsrc/csg/meshsurf.cpp netgen-4.5.new/libsrc/csg/mesh
void MeshOptimize2dSurfaces :: ProjectPoint2 (INDEX surfind, INDEX surfind2, void MeshOptimize2dSurfaces :: ProjectPoint2 (INDEX surfind, INDEX surfind2,
diff -Naur netgen-4.5.old/libsrc/csg/meshsurf.hpp netgen-4.5.new/libsrc/csg/meshsurf.hpp diff -Naur netgen-4.5.old/libsrc/csg/meshsurf.hpp netgen-4.5.new/libsrc/csg/meshsurf.hpp
--- netgen-4.5.old/libsrc/csg/meshsurf.hpp 2004-01-20 14:49:44.000000000 +0300 --- netgen-4.5.old/libsrc/csg/meshsurf.hpp 2004-01-20 11:49:44.000000000 +0000
+++ netgen-4.5.new/libsrc/csg/meshsurf.hpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/csg/meshsurf.hpp 2009-08-07 08:41:22.000000000 +0000
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
MeshOptimize2dSurfaces (const CSGeometry & ageometry); MeshOptimize2dSurfaces (const CSGeometry & ageometry);
@ -27,9 +27,40 @@ diff -Naur netgen-4.5.old/libsrc/csg/meshsurf.hpp netgen-4.5.new/libsrc/csg/mesh
/// ///
virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const; virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const;
/// ///
diff -Naur netgen-4.5.old/libsrc/general/profiler.cpp netgen-4.5.new/libsrc/general/profiler.cpp
--- netgen-4.5.old/libsrc/general/profiler.cpp 2006-01-11 10:05:59.000000000 +0000
+++ netgen-4.5.new/libsrc/general/profiler.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -34,8 +34,14 @@
{
StopTimer (total_timer);
- ofstream prof ("netgen.prof");
- Print (prof);
+ char* env;
+ if ((env = getenv("NETGEN_PROF")) && !strcmp(env, "1")) {
+ ofstream prof ("netgen.prof");
+ Print (prof);
+ }
+ else if ((env = getenv("NETGEN_PROF")) && !strcmp(env, "0")) {
+ Print (std::cout);
+ }
}
diff -Naur netgen-4.5.old/libsrc/include/mystdlib.h netgen-4.5.new/libsrc/include/mystdlib.h
--- netgen-4.5.old/libsrc/include/mystdlib.h 2006-01-16 14:16:56.000000000 +0000
+++ netgen-4.5.new/libsrc/include/mystdlib.h 2009-08-07 08:41:22.000000000 +0000
@@ -25,6 +25,7 @@
#include <cmath>
#include <cctype>
#include <ctime>
+#include <cstring>
#endif
diff -Naur netgen-4.5.old/libsrc/interface/Makefile netgen-4.5.new/libsrc/interface/Makefile diff -Naur netgen-4.5.old/libsrc/interface/Makefile netgen-4.5.new/libsrc/interface/Makefile
--- netgen-4.5.old/libsrc/interface/Makefile 2005-08-09 18:14:59.000000000 +0400 --- netgen-4.5.old/libsrc/interface/Makefile 2005-08-09 14:14:59.000000000 +0000
+++ netgen-4.5.new/libsrc/interface/Makefile 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/interface/Makefile 2009-08-07 08:41:22.000000000 +0000
@@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
-src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp writeelmer.cpp writegmsh.cpp writejcm.cpp readuser.cpp importsolution.cpp -src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp writeelmer.cpp writegmsh.cpp writejcm.cpp readuser.cpp importsolution.cpp
+#src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp writeelmer.cpp writegmsh.cpp writejcm.cpp readuser.cpp importsolution.cpp +#src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp writeelmer.cpp writegmsh.cpp writejcm.cpp readuser.cpp importsolution.cpp
@ -38,8 +69,8 @@ diff -Naur netgen-4.5.old/libsrc/interface/Makefile netgen-4.5.new/libsrc/interf
lib = nginterface lib = nginterface
libpath = libsrc/interface libpath = libsrc/interface
diff -Naur netgen-4.5.old/libsrc/interface/nglib.cpp netgen-4.5.new/libsrc/interface/nglib.cpp diff -Naur netgen-4.5.old/libsrc/interface/nglib.cpp netgen-4.5.new/libsrc/interface/nglib.cpp
--- netgen-4.5.old/libsrc/interface/nglib.cpp 2005-10-18 17:53:18.000000000 +0400 --- netgen-4.5.old/libsrc/interface/nglib.cpp 2005-10-18 13:53:18.000000000 +0000
+++ netgen-4.5.new/libsrc/interface/nglib.cpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/interface/nglib.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -56,7 +56,8 @@ @@ -56,7 +56,8 @@
void Ng_Exit () void Ng_Exit ()
@ -51,8 +82,8 @@ diff -Naur netgen-4.5.old/libsrc/interface/nglib.cpp netgen-4.5.new/libsrc/inter
diff -Naur netgen-4.5.old/libsrc/makefile.inc netgen-4.5.new/libsrc/makefile.inc diff -Naur netgen-4.5.old/libsrc/makefile.inc netgen-4.5.new/libsrc/makefile.inc
--- netgen-4.5.old/libsrc/makefile.inc 2005-09-02 17:17:51.000000000 +0400 --- netgen-4.5.old/libsrc/makefile.inc 2005-09-02 13:17:51.000000000 +0000
+++ netgen-4.5.new/libsrc/makefile.inc 2008-02-12 14:59:55.000000000 +0300 +++ netgen-4.5.new/libsrc/makefile.inc 2009-08-07 08:41:22.000000000 +0000
@@ -8,17 +8,14 @@ @@ -8,17 +8,14 @@
LIBSRC_DIR=$(CPP_DIR)/libsrc LIBSRC_DIR=$(CPP_DIR)/libsrc
LIB_DIR=$(CPP_DIR)/lib/$(MACHINE) LIB_DIR=$(CPP_DIR)/lib/$(MACHINE)
@ -77,8 +108,8 @@ diff -Naur netgen-4.5.old/libsrc/makefile.inc netgen-4.5.new/libsrc/makefile.inc
ARFLAGS = r ARFLAGS = r
# #
diff -Naur netgen-4.5.old/libsrc/makefile.mach.LINUX netgen-4.5.new/libsrc/makefile.mach.LINUX diff -Naur netgen-4.5.old/libsrc/makefile.mach.LINUX netgen-4.5.new/libsrc/makefile.mach.LINUX
--- netgen-4.5.old/libsrc/makefile.mach.LINUX 2004-10-11 23:49:26.000000000 +0400 --- netgen-4.5.old/libsrc/makefile.mach.LINUX 2004-10-11 19:49:26.000000000 +0000
+++ netgen-4.5.new/libsrc/makefile.mach.LINUX 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/makefile.mach.LINUX 2009-08-07 08:41:22.000000000 +0000
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# #
CFLAGS2 = CFLAGS2 =
@ -88,29 +119,9 @@ diff -Naur netgen-4.5.old/libsrc/makefile.mach.LINUX netgen-4.5.new/libsrc/makef
-ftemplate-depth-99 -finline-limit=10000 \ -ftemplate-depth-99 -finline-limit=10000 \
-Wdisabled-optimization -funroll-loops -DnoNGSOLVE -Wdisabled-optimization -funroll-loops -DnoNGSOLVE
diff -Naur netgen-4.5.old/libsrc/meshing/meshtype.cpp netgen-4.5.new/libsrc/meshing/meshtype.cpp
--- netgen-4.5.old/libsrc/meshing/meshtype.cpp 2006-02-10 13:11:08.000000000 +0300
+++ netgen-4.5.new/libsrc/meshing/meshtype.cpp 2008-03-14 13:19:53.000000000 +0300
@@ -1,4 +1,5 @@
#include <mystdlib.h>
+#include <float.h>
#include "meshing.hpp"
@@ -774,7 +775,7 @@
frob /= 2;
double det = trans.Det();
- if (det <= 0)
+ if (det <= DBL_MIN)
err += 1e12;
else
err += frob * frob / det;
diff -Naur netgen-4.5.old/libsrc/meshing/improve2.cpp netgen-4.5.new/libsrc/meshing/improve2.cpp diff -Naur netgen-4.5.old/libsrc/meshing/improve2.cpp netgen-4.5.new/libsrc/meshing/improve2.cpp
--- netgen-4.5.old/libsrc/meshing/improve2.cpp 2006-01-11 19:08:19.000000000 +0300 --- netgen-4.5.old/libsrc/meshing/improve2.cpp 2006-01-11 16:08:19.000000000 +0000
+++ netgen-4.5.new/libsrc/meshing/improve2.cpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/meshing/improve2.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
#include <opti.hpp> #include <opti.hpp>
@ -121,8 +132,8 @@ diff -Naur netgen-4.5.old/libsrc/meshing/improve2.cpp netgen-4.5.new/libsrc/mesh
namespace netgen namespace netgen
diff -Naur netgen-4.5.old/libsrc/meshing/improve2.hpp netgen-4.5.new/libsrc/meshing/improve2.hpp diff -Naur netgen-4.5.old/libsrc/meshing/improve2.hpp netgen-4.5.new/libsrc/meshing/improve2.hpp
--- netgen-4.5.old/libsrc/meshing/improve2.hpp 2004-10-12 23:22:55.000000000 +0400 --- netgen-4.5.old/libsrc/meshing/improve2.hpp 2004-10-12 19:22:55.000000000 +0000
+++ netgen-4.5.new/libsrc/meshing/improve2.hpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/meshing/improve2.hpp 2009-08-07 08:41:22.000000000 +0000
@@ -32,17 +32,16 @@ @@ -32,17 +32,16 @@
/// ///
virtual void SelectSurfaceOfPoint (const Point3d & p, virtual void SelectSurfaceOfPoint (const Point3d & p,
@ -149,9 +160,39 @@ diff -Naur netgen-4.5.old/libsrc/meshing/improve2.hpp netgen-4.5.new/libsrc/mesh
/// ///
virtual void GetNormalVector(INDEX surfind, const Point3d & p, PointGeomInfo & gi, Vec3d & n) const; virtual void GetNormalVector(INDEX surfind, const Point3d & p, PointGeomInfo & gi, Vec3d & n) const;
diff -Naur netgen-4.5.old/libsrc/meshing/meshtype.cpp netgen-4.5.new/libsrc/meshing/meshtype.cpp
--- netgen-4.5.old/libsrc/meshing/meshtype.cpp 2006-02-10 10:11:08.000000000 +0000
+++ netgen-4.5.new/libsrc/meshing/meshtype.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -1,4 +1,5 @@
#include <mystdlib.h>
+#include <float.h>
#include "meshing.hpp"
@@ -774,7 +775,7 @@
frob /= 2;
double det = trans.Det();
- if (det <= 0)
+ if (det <= DBL_MIN)
err += 1e12;
else
err += frob * frob / det;
diff -Naur netgen-4.5.old/libsrc/meshing/meshtype.hpp netgen-4.5.new/libsrc/meshing/meshtype.hpp
--- netgen-4.5.old/libsrc/meshing/meshtype.hpp 2006-02-10 10:11:08.000000000 +0000
+++ netgen-4.5.new/libsrc/meshing/meshtype.hpp 2009-08-07 08:41:22.000000000 +0000
@@ -13,7 +13,7 @@
Classes for NETGEN
*/
-
+class Mesh;
enum ELEMENT_TYPE {
SEGMENT = 1, SEGMENT3 = 2,
TRIG = 10, QUAD=11, TRIG6 = 12, QUAD6 = 13, QUAD8 = 14,
diff -Naur netgen-4.5.old/libsrc/meshing/smoothing2.cpp netgen-4.5.new/libsrc/meshing/smoothing2.cpp diff -Naur netgen-4.5.old/libsrc/meshing/smoothing2.cpp netgen-4.5.new/libsrc/meshing/smoothing2.cpp
--- netgen-4.5.old/libsrc/meshing/smoothing2.cpp 2006-01-11 19:08:20.000000000 +0300 --- netgen-4.5.old/libsrc/meshing/smoothing2.cpp 2006-01-11 16:08:20.000000000 +0000
+++ netgen-4.5.new/libsrc/meshing/smoothing2.cpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/meshing/smoothing2.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -300,7 +300,7 @@ @@ -300,7 +300,7 @@
double Opti2SurfaceMinFunction :: double Opti2SurfaceMinFunction ::
FuncGrad (const Vector & x, Vector & grad) const FuncGrad (const Vector & x, Vector & grad) const
@ -270,9 +311,119 @@ diff -Naur netgen-4.5.old/libsrc/meshing/smoothing2.cpp netgen-4.5.new/libsrc/me
if (moveisok) if (moveisok)
{ {
for (j = 0; j < locelements.Size(); j++) for (j = 0; j < locelements.Size(); j++)
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Inter2d.cxx netgen-4.5.new/libsrc/occ/Partition_Inter2d.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Inter2d.cxx 2005-06-09 14:51:10.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/Partition_Inter2d.cxx 2009-08-07 08:41:22.000000000 +0000
@@ -29,10 +29,10 @@
// $Header$
//using namespace std;
-#include "Partition_Inter2d.ixx"
-
#include "utilities.h"
+#include "Partition_Inter2d.ixx"
+
#include <BRepAdaptor_Curve.hxx>
#include <BRepAlgo_AsDes.hxx>
#include <BRepLib_MakeVertex.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Inter3d.cxx netgen-4.5.new/libsrc/occ/Partition_Inter3d.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Inter3d.cxx 2005-06-09 14:51:10.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/Partition_Inter3d.cxx 2009-08-07 08:41:22.000000000 +0000
@@ -29,13 +29,17 @@
// $Header$
//using namespace std;
+
+#include "utilities.h"
+
#include "Partition_Inter2d.hxx"
#include "Partition_Inter3d.ixx"
-#include "utilities.h"
#include <BRepAlgo_AsDes.hxx>
#include <BRepAlgo_Image.hxx>
#include <BRepLib.hxx>
+//using namespace std;
+
#include <BRepOffset_Tool.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Loop.cxx netgen-4.5.new/libsrc/occ/Partition_Loop.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Loop.cxx 2005-06-09 14:51:10.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/Partition_Loop.cxx 2009-08-07 08:41:22.000000000 +0000
@@ -29,12 +29,14 @@
// $Header$
//using namespace std;
-#include <stdio.h>
-#include "Partition_Loop.ixx"
#include "utilities.h"
+#include <stdio.h>
+
+#include "Partition_Loop.ixx"
+
#include <BRep_Builder.hxx>
#include <BRepAlgo_FaceRestrictor.hxx>
#include <BRep_Tool.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Loop2d.cxx netgen-4.5.new/libsrc/occ/Partition_Loop2d.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Loop2d.cxx 2005-06-09 14:51:10.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/Partition_Loop2d.cxx 2009-08-07 08:41:22.000000000 +0000
@@ -12,9 +12,11 @@
// $Header$
//using namespace std;
-#include "Partition_Loop2d.ixx"
+
#include "utilities.h"
+
+#include "Partition_Loop2d.ixx"
#include <stdio.h>
#include <BRepAdaptor_Curve2d.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Loop3d.cxx netgen-4.5.new/libsrc/occ/Partition_Loop3d.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Loop3d.cxx 2005-06-09 14:51:10.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/Partition_Loop3d.cxx 2009-08-07 08:41:22.000000000 +0000
@@ -10,6 +10,11 @@
// Module : GEOM
//using namespace std;
+
+
+
+#include "utilities.h"
+
#include "Partition_Loop3d.ixx"
#include <TopExp_Explorer.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Spliter.cxx netgen-4.5.new/libsrc/occ/Partition_Spliter.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Spliter.cxx 2005-07-11 06:33:27.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/Partition_Spliter.cxx 2009-08-07 08:41:22.000000000 +0000
@@ -29,14 +29,15 @@
// $Header$
//using namespace std;
+
+#include "utilities.h"
+
#include "Partition_Inter2d.hxx"
#include "Partition_Inter3d.hxx"
#include "Partition_Loop2d.hxx"
#include "Partition_Loop3d.hxx"
#include "Partition_Spliter.ixx"
-#include "utilities.h"
-
#include <Precision.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopExp.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/occconstruction.cpp netgen-4.5.new/libsrc/occ/occconstruction.cpp diff -Naur netgen-4.5.old/libsrc/occ/occconstruction.cpp netgen-4.5.new/libsrc/occ/occconstruction.cpp
--- netgen-4.5.old/libsrc/occ/occconstruction.cpp 2005-12-06 18:15:53.000000000 +0300 --- netgen-4.5.old/libsrc/occ/occconstruction.cpp 2005-12-06 15:15:53.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/occconstruction.cpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/occ/occconstruction.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -28,8 +28,8 @@ @@ -28,8 +28,8 @@
#include <BRepAlgoAPI_Common.hxx> #include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgoAPI_Fuse.hxx> #include <BRepAlgoAPI_Fuse.hxx>
@ -285,8 +436,8 @@ diff -Naur netgen-4.5.old/libsrc/occ/occconstruction.cpp netgen-4.5.new/libsrc/o
#include <ShapeFix_Shape.hxx> #include <ShapeFix_Shape.hxx>
namespace netgen namespace netgen
diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/occgenmesh.cpp diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/occgenmesh.cpp
--- netgen-4.5.old/libsrc/occ/occgenmesh.cpp 2006-02-07 13:12:48.000000000 +0300 --- netgen-4.5.old/libsrc/occ/occgenmesh.cpp 2006-02-07 10:12:48.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/occgenmesh.cpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/occ/occgenmesh.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
return Point<3> (p.X(), p.Y(), p.Z()); return Point<3> (p.X(), p.Y(), p.Z());
} }
@ -418,7 +569,7 @@ diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/oc
multithread.task = "Surface meshing"; multithread.task = "Surface meshing";
geom.facemeshstatus = 0; geom.facemeshstatus = 0;
@@ -751,7 +760,7 @@ @@ -751,7 +757,7 @@
multithread.task = savetask; multithread.task = savetask;
} }
@ -427,7 +578,7 @@ diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/oc
{ {
double hret; double hret;
kappa *= mparam.curvaturesafety; kappa *= mparam.curvaturesafety;
@@ -779,7 +788,7 @@ @@ -779,7 +785,7 @@
double nq = n*q; double nq = n*q;
Point<3> p = p0 + 0.5*n; Point<3> p = p0 + 0.5*n;
@ -436,7 +587,7 @@ diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/oc
if (lambda >= 0 && lambda <= 1) if (lambda >= 0 && lambda <= 1)
{ {
@@ -799,55 +808,55 @@ @@ -799,55 +805,55 @@
@ -512,7 +663,7 @@ diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/oc
//(*testout) << "curvature " << curvature << endl; //(*testout) << "curvature " << curvature << endl;
@@ -886,51 +895,47 @@ @@ -886,51 +892,47 @@
pm1.SetX(0.5*(par0.X()+par2.X())); pm1.SetY(0.5*(par0.Y()+par2.Y())); pm1.SetX(0.5*(par0.X()+par2.X())); pm1.SetY(0.5*(par0.Y()+par2.Y()));
pm2.SetX(0.5*(par1.X()+par0.X())); pm2.SetY(0.5*(par1.Y()+par0.Y())); pm2.SetX(0.5*(par1.X()+par0.X())); pm2.SetY(0.5*(par1.Y()+par0.Y()));
@ -579,7 +730,7 @@ diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/oc
(*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl; (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl;
*/ */
} }
@@ -970,7 +975,7 @@ @@ -970,7 +972,7 @@
if (mparam.uselocalh) if (mparam.uselocalh)
{ {
@ -588,7 +739,7 @@ diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/oc
multithread.percent = 0; multithread.percent = 0;
mesh->SetLocalH (bb.PMin(), bb.PMax(), mparam.grading); mesh->SetLocalH (bb.PMin(), bb.PMax(), mparam.grading);
@@ -1075,7 +1080,6 @@ @@ -1075,7 +1077,6 @@
if (triangulation.IsNull()) continue; if (triangulation.IsNull()) continue;
BRepAdaptor_Surface sf(face, Standard_True); BRepAdaptor_Surface sf(face, Standard_True);
@ -596,7 +747,7 @@ diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/oc
int ntriangles = triangulation -> NbTriangles(); int ntriangles = triangulation -> NbTriangles();
for (int j = 1; j <= ntriangles; j++) for (int j = 1; j <= ntriangles; j++)
@@ -1096,7 +1100,7 @@ @@ -1096,7 +1097,7 @@
maxside = max (maxside, p[1].Distance(p[2])); maxside = max (maxside, p[1].Distance(p[2]));
//cout << "\rFace " << i << " pos11 ntriangles " << ntriangles << " maxside " << maxside << flush; //cout << "\rFace " << i << " pos11 ntriangles " << ntriangles << " maxside " << maxside << flush;
@ -606,8 +757,8 @@ diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/oc
} }
} }
diff -Naur netgen-4.5.old/libsrc/occ/occgeom.cpp netgen-4.5.new/libsrc/occ/occgeom.cpp diff -Naur netgen-4.5.old/libsrc/occ/occgeom.cpp netgen-4.5.new/libsrc/occ/occgeom.cpp
--- netgen-4.5.old/libsrc/occ/occgeom.cpp 2006-01-25 16:35:50.000000000 +0300 --- netgen-4.5.old/libsrc/occ/occgeom.cpp 2006-01-25 13:35:50.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/occgeom.cpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/occ/occgeom.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
#include "ShapeAnalysis_ShapeContents.hxx" #include "ShapeAnalysis_ShapeContents.hxx"
#include "ShapeAnalysis_CheckSmallFace.hxx" #include "ShapeAnalysis_CheckSmallFace.hxx"
@ -785,8 +936,8 @@ diff -Naur netgen-4.5.old/libsrc/occ/occgeom.cpp netgen-4.5.new/libsrc/occ/occge
return true; return true;
} }
diff -Naur netgen-4.5.old/libsrc/occ/occgeom.hpp netgen-4.5.new/libsrc/occ/occgeom.hpp diff -Naur netgen-4.5.old/libsrc/occ/occgeom.hpp netgen-4.5.new/libsrc/occ/occgeom.hpp
--- netgen-4.5.old/libsrc/occ/occgeom.hpp 2006-01-25 16:35:50.000000000 +0300 --- netgen-4.5.old/libsrc/occ/occgeom.hpp 2006-01-25 13:35:50.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/occgeom.hpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/occ/occgeom.hpp 2009-08-07 08:41:22.000000000 +0000
@@ -15,8 +15,6 @@ @@ -15,8 +15,6 @@
#include "Geom_Curve.hxx" #include "Geom_Curve.hxx"
#include "Geom2d_Curve.hxx" #include "Geom2d_Curve.hxx"
@ -864,8 +1015,8 @@ diff -Naur netgen-4.5.old/libsrc/occ/occgeom.hpp netgen-4.5.new/libsrc/occ/occge
{ {
cout << "OCCGeometry::GetSurface using PLANESPACE" << endl; cout << "OCCGeometry::GetSurface using PLANESPACE" << endl;
diff -Naur netgen-4.5.old/libsrc/occ/occmeshsurf.cpp netgen-4.5.new/libsrc/occ/occmeshsurf.cpp diff -Naur netgen-4.5.old/libsrc/occ/occmeshsurf.cpp netgen-4.5.new/libsrc/occ/occmeshsurf.cpp
--- netgen-4.5.old/libsrc/occ/occmeshsurf.cpp 2006-01-25 16:36:26.000000000 +0300 --- netgen-4.5.old/libsrc/occ/occmeshsurf.cpp 2006-01-25 13:36:26.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/occmeshsurf.cpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/occ/occmeshsurf.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -5,6 +5,8 @@ @@ -5,6 +5,8 @@
#include <occgeom.hpp> #include <occgeom.hpp>
#include <meshing.hpp> #include <meshing.hpp>
@ -982,8 +1133,8 @@ diff -Naur netgen-4.5.old/libsrc/occ/occmeshsurf.cpp netgen-4.5.new/libsrc/occ/o
diff -Naur netgen-4.5.old/libsrc/occ/occmeshsurf.hpp netgen-4.5.new/libsrc/occ/occmeshsurf.hpp diff -Naur netgen-4.5.old/libsrc/occ/occmeshsurf.hpp netgen-4.5.new/libsrc/occ/occmeshsurf.hpp
--- netgen-4.5.old/libsrc/occ/occmeshsurf.hpp 2005-06-09 18:51:10.000000000 +0400 --- netgen-4.5.old/libsrc/occ/occmeshsurf.hpp 2005-06-09 14:51:10.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/occmeshsurf.hpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/occ/occmeshsurf.hpp 2009-08-07 08:41:22.000000000 +0000
@@ -151,7 +151,7 @@ @@ -151,7 +151,7 @@
MeshOptimize2dOCCSurfaces (const OCCGeometry & ageometry); MeshOptimize2dOCCSurfaces (const OCCGeometry & ageometry);
@ -1003,9 +1154,20 @@ diff -Naur netgen-4.5.old/libsrc/occ/occmeshsurf.hpp netgen-4.5.new/libsrc/occ/o
}; };
diff -Naur netgen-4.5.old/libsrc/occ/utilities.h netgen-4.5.new/libsrc/occ/utilities.h
--- netgen-4.5.old/libsrc/occ/utilities.h 2005-02-11 11:35:43.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/utilities.h 2009-08-07 08:41:22.000000000 +0000
@@ -33,6 +33,7 @@
#include <string>
#include <iostream>
+#include <iomanip>
#include <cstdlib>
// #include "SALOME_Log.hxx"
diff -Naur netgen-4.5.old/libsrc/stlgeom/meshstlsurface.cpp netgen-4.5.new/libsrc/stlgeom/meshstlsurface.cpp diff -Naur netgen-4.5.old/libsrc/stlgeom/meshstlsurface.cpp netgen-4.5.new/libsrc/stlgeom/meshstlsurface.cpp
--- netgen-4.5.old/libsrc/stlgeom/meshstlsurface.cpp 2006-01-11 19:08:20.000000000 +0300 --- netgen-4.5.old/libsrc/stlgeom/meshstlsurface.cpp 2006-01-11 16:08:20.000000000 +0000
+++ netgen-4.5.new/libsrc/stlgeom/meshstlsurface.cpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/stlgeom/meshstlsurface.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -946,20 +946,23 @@ @@ -946,20 +946,23 @@
} }
@ -1055,8 +1217,8 @@ diff -Naur netgen-4.5.old/libsrc/stlgeom/meshstlsurface.cpp netgen-4.5.new/libsr
{ {
n = geom.GetChartNormalVector(); n = geom.GetChartNormalVector();
diff -Naur netgen-4.5.old/libsrc/stlgeom/meshstlsurface.hpp netgen-4.5.new/libsrc/stlgeom/meshstlsurface.hpp diff -Naur netgen-4.5.old/libsrc/stlgeom/meshstlsurface.hpp netgen-4.5.new/libsrc/stlgeom/meshstlsurface.hpp
--- netgen-4.5.old/libsrc/stlgeom/meshstlsurface.hpp 2004-09-30 17:13:56.000000000 +0400 --- netgen-4.5.old/libsrc/stlgeom/meshstlsurface.hpp 2004-09-30 13:13:56.000000000 +0000
+++ netgen-4.5.new/libsrc/stlgeom/meshstlsurface.hpp 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/libsrc/stlgeom/meshstlsurface.hpp 2009-08-07 08:41:22.000000000 +0000
@@ -79,12 +79,10 @@ @@ -79,12 +79,10 @@
virtual void SelectSurfaceOfPoint (const Point3d & p, virtual void SelectSurfaceOfPoint (const Point3d & p,
const PointGeomInfo & gi); const PointGeomInfo & gi);
@ -1072,13 +1234,17 @@ diff -Naur netgen-4.5.old/libsrc/stlgeom/meshstlsurface.hpp netgen-4.5.new/libsr
}; };
diff -Naur netgen-4.5.old/makeForSalome.sh netgen-4.5.new/makeForSalome.sh diff -Naur netgen-4.5.old/makeForSalome.sh netgen-4.5.new/makeForSalome.sh
--- netgen-4.5.old/makeForSalome.sh 1970-01-01 03:00:00.000000000 +0300 --- netgen-4.5.old/makeForSalome.sh 1970-01-01 00:00:00.000000000 +0000
+++ netgen-4.5.new/makeForSalome.sh 2008-02-12 14:57:01.000000000 +0300 +++ netgen-4.5.new/makeForSalome.sh 2009-08-07 08:41:22.000000000 +0000
@@ -0,0 +1,31 @@ @@ -0,0 +1,35 @@
+#! /bin/sh +#! /bin/sh
+cp ngtcltk/ngnewdelete.* libsrc/interface/ +cp ngtcltk/ngnewdelete.* libsrc/interface/
+ +
+MACHINE=LINUX +if test `uname -m` == "x86_64" ; then
+ MACHINE=LINUX64
+else
+ MACHINE=LINUX
+fi
+export MACHINE +export MACHINE
+make -C libsrc/csg +make -C libsrc/csg
+make -C libsrc/general +make -C libsrc/general
@ -1106,124 +1272,3 @@ diff -Naur netgen-4.5.old/makeForSalome.sh netgen-4.5.new/makeForSalome.sh
+ libsrc/occ/*.hpp libsrc/opti/*.hpp libsrc/include/mydefs.hpp \ + libsrc/occ/*.hpp libsrc/opti/*.hpp libsrc/include/mydefs.hpp \
+ libsrc/stlgeom/*.hpp libsrc/include/mystdlib.h \ + libsrc/stlgeom/*.hpp libsrc/include/mystdlib.h \
+ install/include + install/include
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Inter2d.cxx netgen-4.5.new/libsrc/occ/Partition_Inter2d.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Inter2d.cxx 2005-06-09 18:51:10.000000000 +0400
+++ netgen-4.5.new/libsrc/occ/Partition_Inter2d.cxx 2008-02-26 12:34:14.000000000 +0300
@@ -29,10 +29,10 @@
// $Header$
//using namespace std;
-#include "Partition_Inter2d.ixx"
-
#include "utilities.h"
+#include "Partition_Inter2d.ixx"
+
#include <BRepAdaptor_Curve.hxx>
#include <BRepAlgo_AsDes.hxx>
#include <BRepLib_MakeVertex.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Inter3d.cxx netgen-4.5.new/libsrc/occ/Partition_Inter3d.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Inter3d.cxx 2005-06-09 18:51:10.000000000 +0400
+++ netgen-4.5.new/libsrc/occ/Partition_Inter3d.cxx 2008-02-26 12:36:27.000000000 +0300
@@ -29,13 +29,17 @@
// $Header$
//using namespace std;
+
+#include "utilities.h"
+
#include "Partition_Inter2d.hxx"
#include "Partition_Inter3d.ixx"
-#include "utilities.h"
#include <BRepAlgo_AsDes.hxx>
#include <BRepAlgo_Image.hxx>
#include <BRepLib.hxx>
+//using namespace std;
+
#include <BRepOffset_Tool.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Loop2d.cxx netgen-4.5.new/libsrc/occ/Partition_Loop2d.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Loop2d.cxx 2005-06-09 18:51:10.000000000 +0400
+++ netgen-4.5.new/libsrc/occ/Partition_Loop2d.cxx 2008-02-26 12:37:10.000000000 +0300
@@ -12,9 +12,11 @@
// $Header$
//using namespace std;
-#include "Partition_Loop2d.ixx"
+
#include "utilities.h"
+
+#include "Partition_Loop2d.ixx"
#include <stdio.h>
#include <BRepAdaptor_Curve2d.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Loop3d.cxx netgen-4.5.new/libsrc/occ/Partition_Loop3d.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Loop3d.cxx 2005-06-09 18:51:10.000000000 +0400
+++ netgen-4.5.new/libsrc/occ/Partition_Loop3d.cxx 2008-02-26 12:39:32.000000000 +0300
@@ -10,6 +10,11 @@
// Module : GEOM
//using namespace std;
+
+
+
+#include "utilities.h"
+
#include "Partition_Loop3d.ixx"
#include <TopExp_Explorer.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Loop.cxx netgen-4.5.new/libsrc/occ/Partition_Loop.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Loop.cxx 2005-06-09 18:51:10.000000000 +0400
+++ netgen-4.5.new/libsrc/occ/Partition_Loop.cxx 2008-02-26 12:40:41.000000000 +0300
@@ -29,12 +29,14 @@
// $Header$
//using namespace std;
-#include <stdio.h>
-#include "Partition_Loop.ixx"
#include "utilities.h"
+#include <stdio.h>
+
+#include "Partition_Loop.ixx"
+
#include <BRep_Builder.hxx>
#include <BRepAlgo_FaceRestrictor.hxx>
#include <BRep_Tool.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/Partition_Spliter.cxx netgen-4.5.new/libsrc/occ/Partition_Spliter.cxx
--- netgen-4.5.old/libsrc/occ/Partition_Spliter.cxx 2005-07-11 10:33:27.000000000 +0400
+++ netgen-4.5.new/libsrc/occ/Partition_Spliter.cxx 2008-02-26 12:41:32.000000000 +0300
@@ -29,14 +29,15 @@
// $Header$
//using namespace std;
+
+#include "utilities.h"
+
#include "Partition_Inter2d.hxx"
#include "Partition_Inter3d.hxx"
#include "Partition_Loop2d.hxx"
#include "Partition_Loop3d.hxx"
#include "Partition_Spliter.ixx"
-#include "utilities.h"
-
#include <Precision.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopExp.hxx>
diff -Naur netgen-4.5.old/libsrc/occ/utilities.h netgen-4.5.new/libsrc/occ/utilities.h
--- netgen-4.5.old/libsrc/occ/utilities.h 2005-02-11 14:35:43.000000000 +0300
+++ netgen-4.5.new/libsrc/occ/utilities.h 2008-02-26 12:28:02.000000000 +0300
@@ -33,6 +33,7 @@
#include <string>
#include <iostream>
+#include <iomanip>
#include <cstdlib>
// #include "SALOME_Log.hxx"

View File

@ -0,0 +1,23 @@
#!/bin/sh
src_dir=$1
install_dir=$2
if ! test -d $src_dir/libsrc ; then
echo "No dir $src_dir/libsrc ... Bye"
exit 1
fi
if ! test -d $install_dir/share/netgen ; then
echo "No dir $install_dir/share/netgen ... Bye"
exit 1
fi
dest_dir=$install_dir/share/netgen/include
mkdir -p $dest_dir > /dev/null 2>&1
cp -af $src_dir/libsrc/occ/*.hpp $dest_dir
cp -af $src_dir/libsrc/meshing/*.hpp $dest_dir
cp -af $src_dir/libsrc/general/*.hpp $dest_dir
cp -af $src_dir/libsrc/gprim/*.hpp $dest_dir
cp -af $src_dir/libsrc/linalg/*.hpp $dest_dir
cp -af $src_dir/libsrc/include/mystdlib.h $dest_dir
cp -af $src_dir/libsrc/include/mydefs.hpp $dest_dir

View File

@ -82,11 +82,16 @@ libNETGENEngine_la_CPPFLAGS = \
$(CORBA_CXXFLAGS) \ $(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \ $(CORBA_INCLUDES) \
$(BOOST_CPPFLAGS) \ $(BOOST_CPPFLAGS) \
-I$(top_builddir)/idl \ -I$(top_builddir)/idl
-I$(top_builddir)/salome_adm/unix
libNETGENEngine_la_LDFLAGS = \ if ! NETGEN_NEW
../NETGEN/libNETGEN.la \ libNETGENEngine_la_LDFLAGS = ../NETGEN/libNETGEN.la
else
libNETGENEngine_la_LDFLAGS = $(NETGEN_LIBS)
endif
libNETGENEngine_la_LDFLAGS += \
../../idl/libSalomeIDLNETGENPLUGIN.la \ ../../idl/libSalomeIDLNETGENPLUGIN.la \
$(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \ $(CAS_LDPATH) -lTKernel -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKMesh -lTKSTL -lTKG3d -lTKTopAlgo -lTKG2d -lTKBool -lTKGeomAlgo -lTKOffset -lTKGeomBase -lTKBO \
$(KERNEL_LDFLAGS) -lSalomeGenericObj $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine -lStdMeshers -lSMESHDS -lSMDS -lSMESHControls \
$(KERNEL_LDFLAGS) -lSalomeGenericObj -lSALOMELocalTrace -lOpUtil

View File

@ -27,7 +27,7 @@
#define _NETGENPlugin_DEFS_HXX_ #define _NETGENPlugin_DEFS_HXX_
#ifdef WIN32 #ifdef WIN32
#ifdef NETGENPLUGIN_EXPORTS #if defined NETGENPLUGIN_EXPORTS || defined NETGENEngine_EXPORTS
#define NETGENPLUGIN_EXPORT __declspec( dllexport ) #define NETGENPLUGIN_EXPORT __declspec( dllexport )
#else #else
#define NETGENPLUGIN_EXPORT __declspec( dllimport ) #define NETGENPLUGIN_EXPORT __declspec( dllimport )

View File

@ -25,7 +25,7 @@
// Date : 28/03/2006 // Date : 28/03/2006
// Project : SALOME // Project : SALOME
// //
#include <NETGENPlugin_Hypothesis.hxx> #include "NETGENPlugin_Hypothesis.hxx"
#include <utilities.h> #include <utilities.h>
using namespace std; using namespace std;

View File

@ -27,7 +27,7 @@
// $Header$ // $Header$
//============================================================================= //=============================================================================
// //
#include <NETGENPlugin_Hypothesis_2D.hxx> #include "NETGENPlugin_Hypothesis_2D.hxx"
#include <utilities.h> #include <utilities.h>
using namespace std; using namespace std;

View File

@ -24,7 +24,6 @@
// Author : Michael Sazonov (OCN) // Author : Michael Sazonov (OCN)
// Date : 31/03/2006 // Date : 31/03/2006
// Project : SALOME // Project : SALOME
// $Header$
//============================================================================= //=============================================================================
// //
#include "NETGENPlugin_Mesher.hxx" #include "NETGENPlugin_Mesher.hxx"
@ -42,6 +41,7 @@
#include <utilities.h> #include <utilities.h>
#include <vector> #include <vector>
#include <limits>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
@ -52,7 +52,9 @@
#include <OSD_File.hxx> #include <OSD_File.hxx>
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_DataMapOfShapeInteger.hxx>
#include <Standard_ErrorHandler.hxx> #include <Standard_ErrorHandler.hxx>
#include <Standard_ProgramError.hxx>
// Netgen include files // Netgen include files
namespace nglib { namespace nglib {
@ -69,6 +71,16 @@ namespace netgen {
using namespace std; using namespace std;
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");
}
}
//============================================================================= //=============================================================================
/*! /*!
* *
@ -245,7 +257,7 @@ void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo,
TopExp::MapShapes(root->GetSubShape(), subShapes); TopExp::MapShapes(root->GetSubShape(), subShapes);
while ( smIt->more() ) { while ( smIt->more() ) {
SMESH_subMesh* sm = smIt->next(); SMESH_subMesh* sm = smIt->next();
if ( sm->IsEmpty() ) { if ( !meshedSM || sm->IsEmpty() ) {
TopoDS_Shape shape = sm->GetSubShape(); TopoDS_Shape shape = sm->GetSubShape();
if ( shape.ShapeType() != TopAbs_VERTEX ) if ( shape.ShapeType() != TopAbs_VERTEX )
shape = subShapes( subShapes.FindIndex( shape ));// - shape->index->oriented shape shape = subShapes( subShapes.FindIndex( shape ));// - shape->index->oriented shape
@ -265,6 +277,10 @@ void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo,
} }
occgeo.facemeshstatus.SetSize (occgeo.fmap.Extent()); occgeo.facemeshstatus.SetSize (occgeo.fmap.Extent());
occgeo.facemeshstatus = 0; occgeo.facemeshstatus = 0;
#ifdef NETGEN_NEW
occgeo.face_maxh.SetSize(occgeo.fmap.Extent());
occgeo.face_maxh = netgen::mparam.maxh;
#endif
} }
@ -273,15 +289,15 @@ void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo,
* \brief return id of netgen point corresponding to SMDS node * \brief return id of netgen point corresponding to SMDS node
*/ */
//================================================================================ //================================================================================
typedef map< const SMDS_MeshNode*, int > TNode2IdMap;
static int ngNodeId( const SMDS_MeshNode* node, static int ngNodeId( const SMDS_MeshNode* node,
netgen::Mesh& ngMesh, netgen::Mesh& ngMesh,
map< const SMDS_MeshNode*, int >& nodeNgIdMap) TNode2IdMap& nodeNgIdMap)
{ {
int newNgId = ngMesh.GetNP() + 1; int newNgId = ngMesh.GetNP() + 1;
pair< map< const SMDS_MeshNode*, int >::iterator, bool > it_isNew = pair< TNode2IdMap::iterator, bool > it_isNew = nodeNgIdMap.insert( make_pair( node, newNgId ));
nodeNgIdMap.insert( make_pair( node, newNgId ));
if ( it_isNew.second ) { if ( it_isNew.second ) {
netgen::MeshPoint p( netgen::Point<3> (node->X(), node->Y(), node->Z()) ); netgen::MeshPoint p( netgen::Point<3> (node->X(), node->Y(), node->Z()) );
@ -301,7 +317,7 @@ bool NETGENPlugin_Mesher::fillNgMesh(netgen::OCCGeometry& occgeom,
vector<SMDS_MeshNode*>& nodeVec, vector<SMDS_MeshNode*>& nodeVec,
const list< SMESH_subMesh* > & meshedSM) const list< SMESH_subMesh* > & meshedSM)
{ {
map< const SMDS_MeshNode*, int > nodeNgIdMap; TNode2IdMap nodeNgIdMap;
TopTools_MapOfShape visitedShapes; TopTools_MapOfShape visitedShapes;
@ -373,8 +389,13 @@ bool NETGENPlugin_Mesher::fillNgMesh(netgen::OCCGeometry& occgeom,
netgen::Segment seg; netgen::Segment seg;
// ng node ids // ng node ids
#ifdef NETGEN_NEW
seg.pnums[0] = prevNgId;
seg.pnums[1] = prevNgId = ngNodeId( p2.node, ngMesh, nodeNgIdMap );
#else
seg.p1 = prevNgId; seg.p1 = prevNgId;
seg.p2 = prevNgId = ngNodeId( p2.node, ngMesh, nodeNgIdMap ); seg.p2 = prevNgId = ngNodeId( p2.node, ngMesh, nodeNgIdMap );
#endif
// node param on curve // node param on curve
seg.epgeominfo[ 0 ].dist = p1.param; seg.epgeominfo[ 0 ].dist = p1.param;
seg.epgeominfo[ 1 ].dist = p2.param; seg.epgeominfo[ 1 ].dist = p2.param;
@ -400,7 +421,11 @@ bool NETGENPlugin_Mesher::fillNgMesh(netgen::OCCGeometry& occgeom,
seg.epgeominfo[ 1 ].v = otherSeamParam; seg.epgeominfo[ 1 ].v = otherSeamParam;
swap (seg.epgeominfo[0].u, seg.epgeominfo[1].u); swap (seg.epgeominfo[0].u, seg.epgeominfo[1].u);
} }
#ifdef NETGEN_NEW
swap (seg.pnums[0], seg.pnums[1]);
#else
swap (seg.p1, seg.p2); swap (seg.p1, seg.p2);
#endif
swap (seg.epgeominfo[0].dist, seg.epgeominfo[1].dist); swap (seg.epgeominfo[0].dist, seg.epgeominfo[1].dist);
seg.edgenr = ngMesh.GetNSeg() + 1; // segment id seg.edgenr = ngMesh.GetNSeg() + 1; // segment id
ngMesh.AddSegment (seg); ngMesh.AddSegment (seg);
@ -416,7 +441,7 @@ bool NETGENPlugin_Mesher::fillNgMesh(netgen::OCCGeometry& occgeom,
const TopoDS_Face& geomFace = TopoDS::Face( sm->GetSubShape() ); const TopoDS_Face& geomFace = TopoDS::Face( sm->GetSubShape() );
helper.SetSubShape( geomFace ); helper.SetSubShape( geomFace );
// find solids geomFace bounds // Find solids the geomFace bounds
int solidID1 = 0, solidID2 = 0; int solidID1 = 0, solidID2 = 0;
const TopTools_ListOfShape& ancestors = _mesh->GetAncestors( geomFace ); const TopTools_ListOfShape& ancestors = _mesh->GetAncestors( geomFace );
TopTools_ListIteratorOfListOfShape ancestorIt ( ancestors ); TopTools_ListIteratorOfListOfShape ancestorIt ( ancestors );
@ -433,7 +458,19 @@ bool NETGENPlugin_Mesher::fillNgMesh(netgen::OCCGeometry& occgeom,
_faceDescriptors[ faceID ].first = solidID1; _faceDescriptors[ faceID ].first = solidID1;
_faceDescriptors[ faceID ].second = solidID2; _faceDescriptors[ faceID ].second = solidID2;
// add surface elements // Orient the face correctly in solidID1 (issue 0020206)
bool reverse = false;
if ( solidID1 ) {
TopoDS_Shape solid = occgeom.somap( solidID1 );
for ( TopExp_Explorer f( solid, TopAbs_FACE ); f.More(); f.Next() ) {
if ( geomFace.IsSame( f.Current() )) {
reverse = SMESH_Algo::IsReversedSubMesh( TopoDS::Face( f.Current()), helper.GetMeshDS() );
break;
}
}
}
// Add surface elements
SMDS_ElemIteratorPtr faces = smDS->GetElements(); SMDS_ElemIteratorPtr faces = smDS->GetElements();
while ( faces->more() ) { while ( faces->more() ) {
@ -456,15 +493,21 @@ bool NETGENPlugin_Mesher::fillNgMesh(netgen::OCCGeometry& occgeom,
for ( int i = 0; i < 3; ++i ) { for ( int i = 0; i < 3; ++i ) {
const SMDS_MeshNode* node = f->GetNode( i ), * inFaceNode=0; const SMDS_MeshNode* node = f->GetNode( i ), * inFaceNode=0;
if ( helper.IsSeamShape( node->GetPosition()->GetShapeId() )) if ( helper.IsSeamShape( node->GetPosition()->GetShapeId() ))
if ( helper.IsSeamShape( f->GetNode( i+1 )->GetPosition()->GetShapeId() )) if ( helper.IsSeamShape( f->GetNodeWrap( i+1 )->GetPosition()->GetShapeId() ))
inFaceNode = f->GetNode( i-1 ); inFaceNode = f->GetNodeWrap( i-1 );
else else
inFaceNode = f->GetNode( i+1 ); inFaceNode = f->GetNodeWrap( i+1 );
gp_XY uv = helper.GetNodeUV( geomFace, node, inFaceNode ); gp_XY uv = helper.GetNodeUV( geomFace, node, inFaceNode );
tri.GeomInfoPi(i+1).u = uv.X(); if ( reverse ) {
tri.GeomInfoPi(i+1).v = uv.Y(); tri.GeomInfoPi(3-i).u = uv.X();
tri.PNum(i+1) = ngNodeId( node, ngMesh, nodeNgIdMap ); tri.GeomInfoPi(3-i).v = uv.Y();
tri.PNum (3-i) = ngNodeId( node, ngMesh, nodeNgIdMap );
} else {
tri.GeomInfoPi(i+1).u = uv.X();
tri.GeomInfoPi(i+1).v = uv.Y();
tri.PNum (i+1) = ngNodeId( node, ngMesh, nodeNgIdMap );
}
} }
ngMesh.AddSurfaceElement (tri); ngMesh.AddSurfaceElement (tri);
@ -486,7 +529,7 @@ bool NETGENPlugin_Mesher::fillNgMesh(netgen::OCCGeometry& occgeom,
// fill nodeVec // fill nodeVec
nodeVec.resize( ngMesh.GetNP() + 1 ); nodeVec.resize( ngMesh.GetNP() + 1 );
map< const SMDS_MeshNode*, int >::iterator node_NgId, nodeNgIdEnd = nodeNgIdMap.end(); TNode2IdMap::iterator node_NgId, nodeNgIdEnd = nodeNgIdMap.end();
for ( node_NgId = nodeNgIdMap.begin(); node_NgId != nodeNgIdEnd; ++node_NgId) for ( node_NgId = nodeNgIdMap.begin(); node_NgId != nodeNgIdEnd; ++node_NgId)
nodeVec[ node_NgId->second ] = (SMDS_MeshNode*) node_NgId->first; nodeVec[ node_NgId->second ] = (SMDS_MeshNode*) node_NgId->first;
@ -549,7 +592,7 @@ bool NETGENPlugin_Mesher::Compute()
// nb of segments // nb of segments
mparams.segmentsperedge = nbSeg + 0.1; mparams.segmentsperedge = nbSeg + 0.1;
mparams.maxh = occgeo.boundingbox.Diam(); mparams.maxh = occgeo.boundingbox.Diam();
mparams.grading = 0; mparams.grading = 0.01;
} }
else { else {
// segment length // segment length
@ -592,18 +635,25 @@ bool NETGENPlugin_Mesher::Compute()
else { else {
// length from edges // length from edges
double length = 0; double length = 0;
TopTools_MapOfShape tmpMap;
for ( TopExp_Explorer exp( _shape, TopAbs_EDGE ); exp.More(); exp.Next() ) for ( TopExp_Explorer exp( _shape, TopAbs_EDGE ); exp.More(); exp.Next() )
length += SMESH_Algo::EdgeLength( TopoDS::Edge( exp.Current() )); if( tmpMap.Add(exp.Current()) )
if ( ngMesh->GetNSeg() ) length += SMESH_Algo::EdgeLength( TopoDS::Edge( exp.Current() ));
mparams.maxh = length / ngMesh->GetNSeg();
if ( ngMesh->GetNSeg() ) {
// we have to multiply length by 2 since for each TopoDS_Edge there
// are double set of NETGEN edges or, in other words, we have to
// divide ngMesh->GetNSeg() on 2.
mparams.maxh = 2*length / ngMesh->GetNSeg();
}
else else
mparams.maxh = 1000; mparams.maxh = 1000;
mparams.grading = 0.2; // slow size growth mparams.grading = 0.2; // slow size growth
} }
mparams.maxh = min( mparams.maxh, occgeo.boundingbox.Diam()/2 ); mparams.maxh = min( mparams.maxh, occgeo.boundingbox.Diam()/2 );
ngMesh->SetGlobalH (mparams.maxh); ngMesh->SetGlobalH (mparams.maxh);
netgen::Box<3> bb = occgeo.GetBoundingBox(); netgen::Box<3> bb = occgeo.GetBoundingBox();
bb.Increase (bb.Diam()/20); bb.Increase (bb.Diam()/20);
ngMesh->SetLocalH (bb.PMin(), bb.PMax(), mparams.grading); ngMesh->SetLocalH (bb.PMin(), bb.PMax(), mparams.grading);
} }
// let netgen compute 2D mesh // let netgen compute 2D mesh
@ -638,10 +688,10 @@ bool NETGENPlugin_Mesher::Compute()
// length from faces // length from faces
mparams.maxh = ngMesh->AverageH(); mparams.maxh = ngMesh->AverageH();
} }
// netgen::ARRAY<double> maxhdom; // netgen::ARRAY<double> maxhdom;
// maxhdom.SetSize (occgeo.NrSolids()); // maxhdom.SetSize (occgeo.NrSolids());
// maxhdom = mparams.maxh; // maxhdom = mparams.maxh;
// ngMesh->SetMaxHDomain (maxhdom); // ngMesh->SetMaxHDomain (maxhdom);
ngMesh->SetGlobalH (mparams.maxh); ngMesh->SetGlobalH (mparams.maxh);
mparams.grading = 0.4; mparams.grading = 0.4;
ngMesh->CalcLocalH(); ngMesh->CalcLocalH();
@ -712,7 +762,11 @@ bool NETGENPlugin_Mesher::Compute()
newNodeOnVertex = true; newNodeOnVertex = true;
} }
if (!node) if (!node)
#ifdef NETGEN_NEW
node = meshDS->AddNode(ngPoint(0), ngPoint(1), ngPoint(2));
#else
node = meshDS->AddNode(ngPoint.X(), ngPoint.Y(), ngPoint.Z()); node = meshDS->AddNode(ngPoint.X(), ngPoint.Y(), ngPoint.Z());
#endif
if (!node) if (!node)
{ {
MESSAGE("Cannot create a mesh node"); MESSAGE("Cannot create a mesh node");
@ -734,12 +788,20 @@ bool NETGENPlugin_Mesher::Compute()
for (i = nbInitSeg+1; i <= nbSeg/* && isOK*/; ++i ) for (i = nbInitSeg+1; i <= nbSeg/* && isOK*/; ++i )
{ {
const netgen::Segment& seg = ngMesh->LineSegment(i); const netgen::Segment& seg = ngMesh->LineSegment(i);
#ifdef NETGEN_NEW
Link link(seg.pnums[0], seg.pnums[1]);
#else
Link link(seg.p1, seg.p2); Link link(seg.p1, seg.p2);
#endif
if (linkMap.Contains(link)) if (linkMap.Contains(link))
continue; continue;
linkMap.Add(link); linkMap.Add(link);
TopoDS_Edge aEdge; TopoDS_Edge aEdge;
#ifdef NETGEN_NEW
int pinds[3] = { seg.pnums[0], seg.pnums[1], seg.pnums[2] };
#else
int pinds[3] = { seg.p1, seg.p2, seg.pmid }; int pinds[3] = { seg.p1, seg.p2, seg.pmid };
#endif
int nbp = 0; int nbp = 0;
double param2 = 0; double param2 = 0;
for (int j=0; j < 3; ++j) for (int j=0; j < 3; ++j)
@ -928,12 +990,183 @@ bool NETGENPlugin_Mesher::Compute()
void NETGENPlugin_Mesher::RemoveTmpFiles() void NETGENPlugin_Mesher::RemoveTmpFiles()
{ {
TCollection_AsciiString str("test.out"); removeFile("test.out");
OSD_Path path1( str ); removeFile("problemfaces");
OSD_File file1( path1 ); removeFile("occmesh.rep");
file1.Remove(); }
str = "problemfaces";
OSD_Path path2( str );
OSD_File file2( path2 ); //=============================================================================
file2.Remove(); /*!
* Evaluate
*/
//=============================================================================
bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
{
#ifdef WNT
netgen::MeshingParameters& mparams = netgen::GlobalMeshingParameters();
#else
netgen::MeshingParameters& mparams = netgen::mparam;
#endif
// -------------------------
// Prepare OCC geometry
// -------------------------
netgen::OCCGeometry occgeo;
list< SMESH_subMesh* > meshedSM;
PrepareOCCgeometry( occgeo, _shape, *_mesh, &meshedSM );
bool tooManyElems = false;
const int hugeNb = std::numeric_limits<int>::max() / 100;
// ----------------
// evaluate 1D
// ----------------
// pass 1D simple parameters to NETGEN
int nbs = 0;
if ( _simpleHyp ) {
if ( int nbSeg = _simpleHyp->GetNumberOfSegments() ) {
nbs = nbSeg;
// nb of segments
mparams.segmentsperedge = nbSeg + 0.1;
mparams.maxh = occgeo.boundingbox.Diam();
mparams.grading = 0.01;
}
else {
// segment length
mparams.segmentsperedge = 1;
mparams.maxh = _simpleHyp->GetLocalLength();
}
}
TopTools_DataMapOfShapeInteger EdgesMap;
double fullLen = 0.0;
double fullNbSeg = 0;
for (TopExp_Explorer exp(_shape, TopAbs_EDGE); exp.More(); exp.Next()) {
TopoDS_Edge E = TopoDS::Edge( exp.Current() );
if( EdgesMap.IsBound(E) )
continue;
SMESH_subMesh *sm = _mesh->GetSubMesh(E);
std::vector<int> aVec(SMDSEntity_Last, 0);
double aLen = SMESH_Algo::EdgeLength(E);
fullLen += aLen;
int nb1d = nbs;
tooManyElems = ( aLen/hugeNb > mparams.maxh );
if(nb1d==0 && !tooManyElems) {
nb1d = (int)( aLen/mparams.maxh + 1 );
}
if ( tooManyElems ) // avoid FPE
{
aVec[SMDSEntity_Node] = hugeNb;
aVec[ mparams.secondorder > 0 ? SMDSEntity_Quad_Edge : SMDSEntity_Edge] = hugeNb;
}
else
{
fullNbSeg += nb1d;
if( mparams.secondorder > 0 ) {
aVec[SMDSEntity_Node] = 2*nb1d - 1;
aVec[SMDSEntity_Quad_Edge] = nb1d;
}
else {
aVec[SMDSEntity_Node] = nb1d - 1;
aVec[SMDSEntity_Edge] = nb1d;
}
}
aResMap.insert(std::make_pair(sm,aVec));
EdgesMap.Bind(E,nb1d);
}
// ----------------
// evaluate 2D
// ----------------
if ( _simpleHyp ) {
if ( double area = _simpleHyp->GetMaxElementArea() ) {
// face area
mparams.maxh = sqrt(2. * area/sqrt(3.0));
mparams.grading = 0.4; // moderate size growth
}
else {
// length from edges
mparams.maxh = fullLen/fullNbSeg;
mparams.grading = 0.2; // slow size growth
}
mparams.maxh = min( mparams.maxh, occgeo.boundingbox.Diam()/2 );
}
for (TopExp_Explorer exp(_shape, TopAbs_FACE); exp.More(); exp.Next())
{
TopoDS_Face F = TopoDS::Face( exp.Current() );
SMESH_subMesh *sm = _mesh->GetSubMesh(F);
GProp_GProps G;
BRepGProp::SurfaceProperties(F,G);
double anArea = G.Mass();
tooManyElems = tooManyElems || ( anArea/hugeNb > mparams.maxh*mparams.maxh );
int nb1d = 0;
if ( !tooManyElems )
for (TopExp_Explorer exp1(F,TopAbs_EDGE); exp1.More(); exp1.Next())
nb1d += EdgesMap.Find(exp1.Current());
int nbFaces = tooManyElems ? hugeNb : int( 4*anArea / mparams.maxh*mparams.maxh*sqrt(3.));
int nbNodes = tooManyElems ? hugeNb : (( nbFaces*3 - (nb1d-1)*2 ) / 6 + 1 );
std::vector<int> aVec(SMDSEntity_Last, 0);
if( mparams.secondorder > 0 ) {
int nb1d_in = (nbFaces*3 - nb1d) / 2;
aVec[SMDSEntity_Node] = nbNodes + nb1d_in;
aVec[SMDSEntity_Quad_Triangle] = nbFaces;
}
else {
aVec[SMDSEntity_Node] = nbNodes;
aVec[SMDSEntity_Triangle] = nbFaces;
}
aResMap.insert(std::make_pair(sm,aVec));
}
// ----------------
// evaluate 3D
// ----------------
if(_isVolume) {
// pass 3D simple parameters to NETGEN
const NETGENPlugin_SimpleHypothesis_3D* simple3d =
dynamic_cast< const NETGENPlugin_SimpleHypothesis_3D* > ( _simpleHyp );
if ( simple3d ) {
if ( double vol = simple3d->GetMaxElementVolume() ) {
// max volume
mparams.maxh = pow( 72, 1/6. ) * pow( vol, 1/3. );
mparams.maxh = min( mparams.maxh, occgeo.boundingbox.Diam()/2 );
}
else {
// using previous length from faces
}
mparams.grading = 0.4;
}
GProp_GProps G;
BRepGProp::VolumeProperties(_shape,G);
double aVolume = G.Mass();
double tetrVol = 0.1179*mparams.maxh*mparams.maxh*mparams.maxh;
tooManyElems = tooManyElems || ( aVolume/hugeNb > tetrVol );
int nbVols = tooManyElems ? hugeNb : int(aVolume/tetrVol);
int nb1d_in = int(( nbVols*6 - fullNbSeg ) / 6 );
std::vector<int> aVec(SMDSEntity_Last, 0 );
if ( tooManyElems ) // avoid FPE
{
aVec[SMDSEntity_Node] = hugeNb;
aVec[ mparams.secondorder > 0 ? SMDSEntity_Quad_Tetra : SMDSEntity_Tetra] = hugeNb;
}
else
{
if( mparams.secondorder > 0 ) {
aVec[SMDSEntity_Node] = nb1d_in/3 + 1 + nb1d_in;
aVec[SMDSEntity_Quad_Tetra] = nbVols;
}
else {
aVec[SMDSEntity_Node] = nb1d_in/3 + 1;
aVec[SMDSEntity_Tetra] = nbVols;
}
}
SMESH_subMesh *sm = _mesh->GetSubMesh(_shape);
aResMap.insert(std::make_pair(sm,aVec));
}
return true;
} }

View File

@ -61,6 +61,8 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Mesher
bool Compute(); bool Compute();
bool Evaluate(MapShapeNbElems& aResMap);
static void PrepareOCCgeometry(netgen::OCCGeometry& occgeom, static void PrepareOCCgeometry(netgen::OCCGeometry& occgeom,
const TopoDS_Shape& shape, const TopoDS_Shape& shape,
SMESH_Mesh& mesh, SMESH_Mesh& mesh,

View File

@ -129,3 +129,21 @@ bool NETGENPlugin_NETGEN_2D::Compute(SMESH_Mesh& aMesh,
mesher.SetParameters(dynamic_cast<const NETGENPlugin_SimpleHypothesis_2D*>(_hypothesis)); mesher.SetParameters(dynamic_cast<const NETGENPlugin_SimpleHypothesis_2D*>(_hypothesis));
return mesher.Compute(); return mesher.Compute();
} }
//=============================================================================
/*!
*
*/
//=============================================================================
bool NETGENPlugin_NETGEN_2D::Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap)
{
NETGENPlugin_Mesher mesher(&aMesh, aShape, false);
mesher.SetParameters(dynamic_cast<const NETGENPlugin_Hypothesis*>(_hypothesis));
mesher.SetParameters(dynamic_cast<const NETGENPlugin_SimpleHypothesis_2D*>(_hypothesis));
return mesher.Evaluate(aResMap);
}

View File

@ -52,6 +52,9 @@ public:
virtual bool Compute(SMESH_Mesh& aMesh, virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape); const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap);
protected: protected:
const SMESHDS_Hypothesis* _hypothesis; const SMESHDS_Hypothesis* _hypothesis;
}; };

View File

@ -132,3 +132,20 @@ bool NETGENPlugin_NETGEN_2D3D::Compute(SMESH_Mesh& aMesh,
mesher.SetParameters(dynamic_cast<const NETGENPlugin_SimpleHypothesis_2D*>(_hypothesis)); mesher.SetParameters(dynamic_cast<const NETGENPlugin_SimpleHypothesis_2D*>(_hypothesis));
return mesher.Compute(); return mesher.Compute();
} }
//=============================================================================
/*!
*
*/
//=============================================================================
bool NETGENPlugin_NETGEN_2D3D::Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap)
{
NETGENPlugin_Mesher mesher(&aMesh, aShape, true);
mesher.SetParameters(dynamic_cast<const NETGENPlugin_Hypothesis*>(_hypothesis));
mesher.SetParameters(dynamic_cast<const NETGENPlugin_SimpleHypothesis_2D*>(_hypothesis));
return mesher.Evaluate(aResMap);
}

View File

@ -52,6 +52,10 @@ public:
virtual bool Compute(SMESH_Mesh& aMesh, virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape); const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap);
protected: protected:
const SMESHDS_Hypothesis* _hypothesis; const SMESHDS_Hypothesis* _hypothesis;
}; };

View File

@ -39,6 +39,7 @@
#include "StdMeshers_LengthFromEdges.hxx" #include "StdMeshers_LengthFromEdges.hxx"
#include "StdMeshers_QuadranglePreference.hxx" #include "StdMeshers_QuadranglePreference.hxx"
#include <Precision.hxx>
#include <Standard_ErrorHandler.hxx> #include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx> #include <Standard_Failure.hxx>
@ -46,6 +47,7 @@
#include <list> #include <list>
#include <vector> #include <vector>
#include <limits>
/* /*
Netgen include files Netgen include files
@ -226,8 +228,13 @@ static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
// Add the segment // Add the segment
Segment seg; Segment seg;
#ifdef NETGEN_NEW
seg.pnums[0] = ngMesh.GetNP(); // ng node id
seg.pnums[1] = seg.pnums[0] + 1; // ng node id
#else
seg.p1 = ngMesh.GetNP(); // ng node id seg.p1 = ngMesh.GetNP(); // ng node id
seg.p2 = seg.p1 + 1; // ng node id seg.p2 = seg.p1 + 1; // ng node id
#endif
seg.edgenr = ngMesh.GetNSeg() + 1;// segment id seg.edgenr = ngMesh.GetNSeg() + 1;// segment id
seg.si = faceID; // = geom.fmap.FindIndex (face); seg.si = faceID; // = geom.fmap.FindIndex (face);
@ -269,7 +276,11 @@ static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
// << "\tp1 edge: " << seg.epgeominfo[ 1 ].edgenr << endl; // << "\tp1 edge: " << seg.epgeominfo[ 1 ].edgenr << endl;
} }
Segment& seg = ngMesh.LineSegment( ngMesh.GetNSeg() ); Segment& seg = ngMesh.LineSegment( ngMesh.GetNSeg() );
#ifdef NETGEN_NEW
seg.pnums[1] = firstPointID;
#else
seg.p2 = firstPointID; seg.p2 = firstPointID;
#endif
} }
ngMesh.CalcSurfacesOfNode(); ngMesh.CalcSurfacesOfNode();
@ -364,7 +375,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
// Generate surface mesh // Generate surface mesh
// ------------------------- // -------------------------
char *optstr; char *optstr = 0;
int startWith = MESHCONST_MESHSURFACE; int startWith = MESHCONST_MESHSURFACE;
int endWith = MESHCONST_OPTSURFACE; int endWith = MESHCONST_OPTSURFACE;
int err = 1; int err = 1;
@ -404,7 +415,11 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
for ( int i = nbInputNodes + 1; i <= nbNodes; ++i ) for ( int i = nbInputNodes + 1; i <= nbNodes; ++i )
{ {
const MeshPoint& ngPoint = ngMesh->Point(i); const MeshPoint& ngPoint = ngMesh->Point(i);
#ifdef NETGEN_NEW
SMDS_MeshNode * node = meshDS->AddNode(ngPoint(0), ngPoint(1), ngPoint(2));
#else
SMDS_MeshNode * node = meshDS->AddNode(ngPoint.X(), ngPoint.Y(), ngPoint.Z()); SMDS_MeshNode * node = meshDS->AddNode(ngPoint.X(), ngPoint.Y(), ngPoint.Z());
#endif
nodeVec[ i-1 ] = node; nodeVec[ i-1 ] = node;
} }
@ -442,3 +457,89 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
return !err; return !err;
} }
//=============================================================================
/*!
*
*/
//=============================================================================
bool NETGENPlugin_NETGEN_2D_ONLY::Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap)
{
TopoDS_Face F = TopoDS::Face(aShape);
if(F.IsNull())
return false;
// collect info from edges
int nb0d = 0, nb1d = 0;
bool IsQuadratic = false;
bool IsFirst = true;
double fullLen = 0.0;
TopTools_MapOfShape tmpMap;
for (TopExp_Explorer exp(F, 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);
if( anIt==aResMap.end() ) {
SMESH_subMesh *sm = aMesh.GetSubMesh(F);
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;
nb0d += aVec[SMDSEntity_Node];
nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
double aLen = SMESH_Algo::EdgeLength(E);
fullLen += aLen;
if(IsFirst) {
IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]);
IsFirst = false;
}
}
tmpMap.Clear();
// compute edge length
double ELen = 0;
if (_hypLengthFromEdges || !_hypLengthFromEdges && !_hypMaxElementArea) {
if ( nb1d > 0 )
ELen = fullLen / nb1d;
}
if ( _hypMaxElementArea ) {
double maxArea = _hypMaxElementArea->GetMaxArea();
ELen = sqrt(2. * maxArea/sqrt(3.0));
}
GProp_GProps G;
BRepGProp::SurfaceProperties(F,G);
double anArea = G.Mass();
const int hugeNb = numeric_limits<int>::max()/10;
if ( anArea / hugeNb > ELen*ELen )
{
SMESH_subMesh *sm = aMesh.GetSubMesh(F);
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated.\nToo small element length",this));
return false;
}
int nbFaces = (int) ( anArea / ( ELen*ELen*sqrt(3.) / 4 ) );
int nbNodes = (int) ( ( nbFaces*3 - (nb1d-1)*2 ) / 6 + 1 );
std::vector<int> aVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i]=0;
if( IsQuadratic ) {
aVec[SMDSEntity_Node] = nbNodes;
aVec[SMDSEntity_Quad_Triangle] = nbFaces;
}
else {
aVec[SMDSEntity_Node] = nbNodes;
aVec[SMDSEntity_Triangle] = nbFaces;
}
SMESH_subMesh *sm = aMesh.GetSubMesh(F);
aResMap.insert(std::make_pair(sm,aVec));
return true;
}

View File

@ -70,6 +70,9 @@ public:
virtual bool Compute(SMESH_Mesh& aMesh, virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape); const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap);
/*static TError AddSegmentsToMesh(netgen::Mesh& ngMesh, /*static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
OCCGeometry& geom, OCCGeometry& geom,
const TSideVector& wires, const TSideVector& wires,

View File

@ -25,7 +25,6 @@
// Created : lundi 27 Janvier 2003 // Created : lundi 27 Janvier 2003
// Author : Nadir BOUHAMOU (CEA) // Author : Nadir BOUHAMOU (CEA)
// Project : SALOME // Project : SALOME
// $Header$
//============================================================================= //=============================================================================
// //
#include "NETGENPlugin_NETGEN_3D.hxx" #include "NETGENPlugin_NETGEN_3D.hxx"
@ -40,9 +39,12 @@
#include "SMESH_Gen.hxx" #include "SMESH_Gen.hxx"
#include "SMESH_Mesh.hxx" #include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx" #include "SMESH_MesherHelper.hxx"
#include "SMESH_MeshEditor.hxx"
#include "StdMeshers_QuadToTriaAdaptor.hxx" #include "StdMeshers_QuadToTriaAdaptor.hxx"
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <GProp_GProps.hxx>
#include <BRepGProp.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
@ -64,6 +66,7 @@ namespace nglib {
#include <nglib.h> #include <nglib.h>
} }
using namespace nglib; using namespace nglib;
using namespace std;
//============================================================================= //=============================================================================
/*! /*!
@ -173,7 +176,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
SMESH_MesherHelper* myTool = &helper; SMESH_MesherHelper* myTool = &helper;
bool _quadraticMesh = myTool->IsQuadraticSubMesh(aShape); bool _quadraticMesh = myTool->IsQuadraticSubMesh(aShape);
typedef map< const SMDS_MeshNode*, int> TNodeToIDMap; typedef map< const SMDS_MeshNode*, int, TIDCompare > TNodeToIDMap;
TNodeToIDMap nodeToNetgenID; TNodeToIDMap nodeToNetgenID;
list< const SMDS_MeshElement* > triangles; list< const SMDS_MeshElement* > triangles;
list< bool > isReversed; // orientation of triangles list< bool > isReversed; // orientation of triangles
@ -214,13 +217,13 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
//return error( COMPERR_BAD_INPUT_MESH, //return error( COMPERR_BAD_INPUT_MESH,
// SMESH_Comment("Not triangle element ")<<elem->GetID()); // SMESH_Comment("Not triangle element ")<<elem->GetID());
// using adaptor // using adaptor
std::list<const SMDS_FaceOfNodes*> faces = Adaptor.GetTriangles(elem); const list<const SMDS_FaceOfNodes*>* faces = Adaptor.GetTriangles(elem);
if(faces.size()==0) { if(faces==0) {
return error( COMPERR_BAD_INPUT_MESH, return error( COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID()); SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID());
} }
std::list<const SMDS_FaceOfNodes*>::iterator itf = faces.begin(); list<const SMDS_FaceOfNodes*>::const_iterator itf = faces->begin();
for(; itf!=faces.end(); itf++ ) { for(; itf!=faces->end(); itf++ ) {
triangles.push_back( (*itf) ); triangles.push_back( (*itf) );
isReversed.push_back( isRev ); isReversed.push_back( isRev );
// put triange's nodes to nodeToNetgenID map // put triange's nodes to nodeToNetgenID map
@ -440,7 +443,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
MESSAGE("NETGENPlugin_NETGEN_3D::Compute with maxElmentsize = " << _maxElementVolume); MESSAGE("NETGENPlugin_NETGEN_3D::Compute with maxElmentsize = " << _maxElementVolume);
const int invalid_ID = -1; const int invalid_ID = -1;
bool _quadraticMesh = false; bool _quadraticMesh = false;
typedef map< const SMDS_MeshNode*, int> TNodeToIDMap; typedef map< const SMDS_MeshNode*, int, TIDCompare > TNodeToIDMap;
TNodeToIDMap nodeToNetgenID; TNodeToIDMap nodeToNetgenID;
list< const SMDS_MeshElement* > triangles; list< const SMDS_MeshElement* > triangles;
SMESHDS_Mesh* MeshDS = aHelper->GetMeshDS(); SMESHDS_Mesh* MeshDS = aHelper->GetMeshDS();
@ -456,10 +459,14 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
StdMeshers_QuadToTriaAdaptor Adaptor; StdMeshers_QuadToTriaAdaptor Adaptor;
Adaptor.Compute(aMesh); Adaptor.Compute(aMesh);
SMDS_FaceIteratorPtr iteratorFace = MeshDS->facesIterator(); SMDS_FaceIteratorPtr fIt = MeshDS->facesIterator();
while(iteratorFace->more()) { TIDSortedElemSet sortedFaces; // 0020279: control the "random" use when using mesh algorithms
while( fIt->more()) sortedFaces.insert( fIt->next() );
TIDSortedElemSet::iterator itFace = sortedFaces.begin(), fEnd = sortedFaces.end();
for ( ; itFace != fEnd; ++itFace ) {
// check element // check element
const SMDS_MeshElement* elem = iteratorFace->next(); const SMDS_MeshElement* elem = *itFace;
if ( !elem ) if ( !elem )
return error( COMPERR_BAD_INPUT_MESH, "Null element encounters"); return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 )); bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
@ -467,13 +474,13 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
//return error( COMPERR_BAD_INPUT_MESH, //return error( COMPERR_BAD_INPUT_MESH,
// SMESH_Comment("Not triangle element ")<<elem->GetID()); // SMESH_Comment("Not triangle element ")<<elem->GetID());
// using adaptor // using adaptor
std::list<const SMDS_FaceOfNodes*> faces = Adaptor.GetTriangles(elem); const list<const SMDS_FaceOfNodes*>* faces = Adaptor.GetTriangles(elem);
if(faces.size()==0) { if(faces==0) {
return error( COMPERR_BAD_INPUT_MESH, return error( COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID()); SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID());
} }
std::list<const SMDS_FaceOfNodes*>::iterator itf = faces.begin(); list<const SMDS_FaceOfNodes*>::const_iterator itf = faces->begin();
for(; itf!=faces.end(); itf++ ) { for(; itf!=faces->end(); itf++ ) {
triangles.push_back( (*itf) ); triangles.push_back( (*itf) );
// put triange's nodes to nodeToNetgenID map // put triange's nodes to nodeToNetgenID map
SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator(); SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator();
@ -632,3 +639,92 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
return (status == NG_OK); return (status == NG_OK);
} }
//=============================================================================
/*!
*
*/
//=============================================================================
bool NETGENPlugin_NETGEN_3D::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);
if( anIt==aResMap.end() ) {
SMESH_ComputeErrorPtr& smError = aSubMesh->GetComputeError();
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,
"Submesh can not be evaluated",this));
return false;
}
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_face = sqrt(2.* ( fullArea/(nbtri+nbqua*2) ) / sqrt(3.0) );
double ELen_vol = pow( 72, 1/6. ) * pow( _maxElementVolume, 1/3. );
double ELen = Min(ELen_vol,ELen_face*2);
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=SMDSEntity_Node; 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;
}

View File

@ -54,6 +54,10 @@ public:
virtual bool Compute(SMESH_Mesh& aMesh, virtual bool Compute(SMESH_Mesh& aMesh,
SMESH_MesherHelper* aHelper); SMESH_MesherHelper* aHelper);
virtual bool Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap);
protected: protected:
double _maxElementVolume; double _maxElementVolume;