Merge from V6_main 28/02/2013
This commit is contained in:
parent
2b9909cbae
commit
7fb1d4d449
@ -20,21 +20,20 @@
|
||||
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} -I${NETGEN_INCLUDES_DIR} -I${NETGENHOME}/share/netgen/include)
|
||||
SET(NETGEN_INCLUDES ${NETGEN_INCLUDES} -DNO_PARALLEL_THREADS -DOCCGEOMETRY)
|
||||
|
||||
FIND_LIBRARY(NETGEN_LIB_nglib nglib PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
|
||||
|
||||
IF(NETGEN_LIB_nglib)
|
||||
SET(NETGEN_NEW ON)
|
||||
SET(NETGEN_INCLUDES ${NETGEN_INCLUDES} -I${NETGENHOME}/share/netgen/include -DNETGEN_NEW)
|
||||
ELSE(NETGEN_LIB_nglib)
|
||||
SET(NETGEN_NEW OFF)
|
||||
ENDIF(NETGEN_LIB_nglib)
|
||||
# temporary, check to be added later
|
||||
SET(NETGEN_V5 OFF)
|
||||
|
||||
IF(NETGEN_NEW)
|
||||
SET(NETGEN_LIBS)
|
||||
IF(WINDOWS)
|
||||
IF(NETGEN_V5)
|
||||
SET(NETGEN_INCLUDES ${NETGEN_INCLUDES} -DNETGEN_V5)
|
||||
ENDIF(NETGEN_V5)
|
||||
|
||||
SET(NETGEN_LIBS)
|
||||
IF(WINDOWS)
|
||||
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)
|
||||
@ -53,30 +52,5 @@ IF(NETGEN_NEW)
|
||||
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_mesh})
|
||||
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_occ})
|
||||
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_stl})
|
||||
ENDIF(WINDOWS)
|
||||
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_nglib})
|
||||
ELSE(NETGEN_NEW)
|
||||
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})
|
||||
ENDIF(NETGEN_NEW)
|
||||
|
||||
SET(CMAKE_BUILD 1)
|
||||
ENDIF(WINDOWS)
|
||||
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_nglib})
|
||||
|
@ -24,233 +24,223 @@ AC_DEFUN([CHECK_NETGEN],[
|
||||
|
||||
AC_REQUIRE([AC_PROG_CXX])dnl
|
||||
AC_REQUIRE([AC_PROG_CXXCPP])dnl
|
||||
AC_REQUIRE([CHECK_CAS])dnl
|
||||
|
||||
AC_CHECKING(for Netgen 4.5 and higher Libraries)
|
||||
AC_CHECKING([for Netgen])
|
||||
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
|
||||
AC_ARG_WITH(netgen,
|
||||
[ --with-netgen=DIR root directory path of NETGEN installation],
|
||||
NETGEN_HOME=$withval,NETGEN_HOME="")
|
||||
AC_ARG_WITH([netgen],
|
||||
[AC_HELP_STRING([--with-netgen=DIR], [root directory path to NETGEN library installation])],
|
||||
[NETGEN_HOME=$withval],[NETGEN_HOME=yes])
|
||||
|
||||
NETGEN_INCLUDES=""
|
||||
NETGEN_LIBS_DIR=""
|
||||
NETGEN_LIBS=""
|
||||
NETGEN_NEW=no
|
||||
NETGEN_V5=no
|
||||
|
||||
AC_SUBST(NETGEN_INCLUDES)
|
||||
AC_SUBST(NETGEN_LIBS)
|
||||
|
||||
Netgen_ok=no
|
||||
|
||||
if test "x$NETGEN_HOME" == "x" ; then
|
||||
if test "x$NETGEN_HOME" = "x" -o "x$NETGEN_HOME" = "xyes" -o "x$NETGEN_HOME" = "xauto" ; then
|
||||
# auto-detection
|
||||
|
||||
# no --with-netgen option used
|
||||
if test "x$NETGENHOME" != "x" ; then
|
||||
|
||||
# NETGENHOME environment variable defined
|
||||
NETGEN_HOME=$NETGENHOME
|
||||
|
||||
fi
|
||||
#
|
||||
if test "x$NETGENHOME" != "x" ; then
|
||||
# - by environment variable NETGENHOME
|
||||
NETGEN_HOME=$NETGENHOME
|
||||
else
|
||||
# - by searching NETGEN executables
|
||||
AC_PATH_PROG([TEMP], [ng_stl])
|
||||
if test "x$TEMP" != "x" ; then
|
||||
NETGEN_BIN_DIR=`dirname $TEMP`
|
||||
NETGEN_HOME=`dirname $NETGEN_BIN_DIR`
|
||||
else
|
||||
NETGEN_HOME=""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo NETGEN_HOME=$NETGEN_HOME
|
||||
|
||||
if test "x$NETGEN_HOME" != "x"; then
|
||||
|
||||
if test -f ${NETGEN_HOME}/lib/libnglib.so ; then
|
||||
NETGEN_NEW=yes
|
||||
fi
|
||||
|
||||
echo ----------------------------------------------------------
|
||||
echo ----------------------------------------------------------
|
||||
echo You are about to choose to use somehow the
|
||||
echo Netgen Library to generate Tetrahedric mesh.
|
||||
echo ----------------------------------------------------------
|
||||
echo ----------------------------------------------------------
|
||||
echo
|
||||
echo You are strongly advised to consult the file
|
||||
echo NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers, particularly
|
||||
echo about assumptions made on the installation of the Netgen
|
||||
echo application and libraries.
|
||||
echo ----------------------------------------------------------
|
||||
echo ----------------------------------------------------------
|
||||
|
||||
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
|
||||
if test -f ${NETGEN_HOME}/lib/LINUX/libcsg.a ; then
|
||||
NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX"
|
||||
else
|
||||
# check ${NETGEN_HOME}/lib/LINUX64 directory for libraries
|
||||
if test -f ${NETGEN_HOME}/lib/LINUX64/libcsg.a ; then
|
||||
NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX64"
|
||||
else
|
||||
NETGEN_LIBS_DIR="${NETGEN_HOME}/lib"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "NETGEN_LIBS_DIR = $NETGEN_LIBS_DIR"
|
||||
NETGEN_INCLUDES="-I${NETGEN_HOME}/include -I${NETGEN_HOME}/share/netgen/include"
|
||||
NETGEN_LIBS="-L${NETGEN_HOME}/lib -lnglib"
|
||||
|
||||
dnl check Netgen headers availability
|
||||
|
||||
CPPFLAGS_old="$CPPFLAGS"
|
||||
CXXFLAGS_old="$CXXFLAGS"
|
||||
CPPFLAGS="$CAS_CPPFLAGS $NETGEN_INCLUDES $CPPFLAGS"
|
||||
CXXFLAGS="$CAS_CPPFLAGS $NETGEN_INCLUDES $CXXFLAGS"
|
||||
CXXFLAGS="$CAS_CXXFLAGS $NETGEN_INCLUDES $CXXFLAGS"
|
||||
|
||||
AC_MSG_CHECKING(for Netgen header file)
|
||||
AC_MSG_CHECKING([for Netgen header file])
|
||||
|
||||
AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no)
|
||||
if test "x$Netgen_ok" == "xyes"; then
|
||||
AC_CHECK_HEADER([nglib.h], [Netgen_ok=yes], [Netgen_ok=no])
|
||||
|
||||
if test "$NETGEN_NEW" = "no" ; then
|
||||
dnl check Netgen libraries
|
||||
|
||||
AC_MSG_CHECKING(for Netgen libraries)
|
||||
LIBS_old="$LIBS"
|
||||
LIBS="$NETGEN_LIBS $CAS_LDPATH -lTKernel -lTKMath -lTKG3d -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo -lTKGeomBase $LIBS"
|
||||
|
||||
LIBS_old="$LIBS"
|
||||
LIBS="-L. -lNETGEN $CAS_LDPATH -lTKernel -lTKMath -lTKG3d -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo $LIBS"
|
||||
if test "x$Netgen_ok" = "xyes"; then
|
||||
|
||||
AC_TRY_COMPILE(#include <iostream>
|
||||
#include <fstream>
|
||||
namespace nglib {
|
||||
#include "nglib.h"
|
||||
}
|
||||
#define OCCGEOMETRY
|
||||
#include <occgeom.hpp>
|
||||
,nglib::Ng_Init();
|
||||
netgen::OCCGeometry occgeo;
|
||||
nglib::Ng_Exit();,Netgen_ok=yes;ar x "$NETGEN_LIBS_DIR/libnginterface.a";
|
||||
ar x "$NETGEN_LIBS_DIR/libocc.a";
|
||||
ar x "$NETGEN_LIBS_DIR/libcsg.a";
|
||||
ar x "$NETGEN_LIBS_DIR/libgprim.a";
|
||||
ar x "$NETGEN_LIBS_DIR/libmesh.a";
|
||||
ar x "$NETGEN_LIBS_DIR/libopti.a";
|
||||
ar x "$NETGEN_LIBS_DIR/libgen.a";
|
||||
ar x "$NETGEN_LIBS_DIR/libla.a";
|
||||
ar x "$NETGEN_LIBS_DIR/libstlgeom.a";
|
||||
ar x "$NETGEN_LIBS_DIR/libgeom2d.a";
|
||||
$CXX -shared 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 -o libNETGEN.so;
|
||||
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)
|
||||
AC_MSG_CHECKING([for Netgen libraries])
|
||||
|
||||
AC_CACHE_VAL(salome_cv_netgen_lib,[
|
||||
AC_TRY_LINK([
|
||||
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"
|
||||
|
||||
fi
|
||||
|
||||
dnl check if Netgen of v5 or v4
|
||||
|
||||
if test "$Netgen_ok" = "yes" ; then
|
||||
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
AC_MSG_CHECKING([Netgen version])
|
||||
|
||||
AC_CACHE_VAL([salome_cv_netgen_v5_lib],
|
||||
[AC_TRY_LINK(
|
||||
[
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#define OCCGEOMETRY
|
||||
namespace nglib {
|
||||
#include "nglib.h"
|
||||
}
|
||||
#include <occgeom.hpp>
|
||||
],[
|
||||
],
|
||||
[
|
||||
nglib::Ng_Init();
|
||||
netgen::Mesh* ngMesh;
|
||||
ngMesh->CalcLocalH(1.0);
|
||||
nglib::Ng_Exit();
|
||||
],
|
||||
[eval "salome_cv_netgen_v5_lib=yes"],
|
||||
[eval "salome_cv_netgen_v5_lib=no"])
|
||||
])
|
||||
|
||||
if test "x$salome_cv_netgen_v5_lib" = "xyes" ; then
|
||||
NETGEN_V5=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl check OCCT support in Netgen
|
||||
|
||||
if test "$Netgen_ok" = "yes" ; then
|
||||
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
AC_MSG_CHECKING([for OCCT support in Netgen library])
|
||||
|
||||
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
|
||||
|
||||
dnl check SALOME patch in Netgen
|
||||
|
||||
if test "$Netgen_ok" = "yes" ; then
|
||||
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
AC_MSG_CHECKING([for SALOME patch in Netgen library])
|
||||
|
||||
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_lib=yes";rm -rf libNETGEN.so],
|
||||
[eval "salome_cv_netgen_lib=no";rm -rf libNETGEN.so])
|
||||
])
|
||||
Netgen_ok="$salome_cv_netgen_lib"
|
||||
],
|
||||
[eval "salome_cv_netgen_salome_patch_lib=yes"],
|
||||
[eval "salome_cv_netgen_salome_patch_lib=no"])
|
||||
])
|
||||
|
||||
else
|
||||
|
||||
LIBS_old="$LIBS"
|
||||
LIBS="-L${NETGEN_LIBS_DIR} -lnglib $CAS_LDPATH -lTKernel -lTKMath -lTKG3d -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo -lTKGeomBase $LIBS"
|
||||
|
||||
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. Read NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers for details.)
|
||||
fi
|
||||
|
||||
NETGEN_LIBS="-L${NETGEN_LIBS_DIR} -lnglib"
|
||||
|
||||
fi
|
||||
|
||||
LIBS="$LIBS_old"
|
||||
Netgen_ok="$salome_cv_netgen_salome_patch_lib"
|
||||
|
||||
fi
|
||||
|
||||
LIBS="$LIBS_old"
|
||||
CPPFLAGS="$CPPFLAGS_old"
|
||||
CXXFLAGS="$CXXFLAGS_old"
|
||||
|
||||
if test "x$Netgen_ok" == xno ; then
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(Netgen libraries not found or not properly installed)
|
||||
fi
|
||||
|
||||
if test "x$Netgen_ok" = xyes ; then
|
||||
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
if test "x$NETGEN_V5" = "xyes" ; then
|
||||
AC_MSG_RESULT([Netgen is of version 5.0 or newer])
|
||||
NETGEN_INCLUDES="$NETGEN_INCLUDES -DNETGEN_V5"
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_RESULT([Netgen is of version 4.9.13 or older])
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
AC_MSG_ERROR(Netgen libraries not found. Please define NETGENHOME or use --with-netgen option)
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Netgen is not properly installed. Read NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers for more details.])
|
||||
|
||||
fi
|
||||
|
||||
AC_SUBST(NETGEN_INCLUDES)
|
||||
AC_SUBST(NETGEN_LIBS_DIR)
|
||||
AC_SUBST(NETGEN_LIBS)
|
||||
AM_CONDITIONAL(NETGEN_NEW, [test x"$NETGEN_NEW" = x"yes"])
|
||||
|
||||
AC_LANG_RESTORE
|
||||
|
||||
])dnl
|
||||
|
@ -21,7 +21,7 @@
|
||||
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
|
||||
python $KERNEL_ROOT_DIR/salome_adm/cmake_files/deprecated/am2cmake.py --netgenplugin
|
||||
status=$?
|
||||
cd ${CURRENT_DIR}
|
||||
exit $status
|
||||
|
@ -17,4 +17,4 @@
|
||||
@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
@REM
|
||||
|
||||
%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --netgenplugin
|
||||
%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\deprecated\am2cmake.py --netgenplugin
|
||||
|
@ -450,7 +450,6 @@ AC_OUTPUT([ \
|
||||
doc/salome/gui/NETGENPLUGIN/static/header_py.html \
|
||||
src/Makefile \
|
||||
src/GUI/Makefile \
|
||||
src/NETGEN/Makefile \
|
||||
src/NETGENPlugin/Makefile \
|
||||
resources/Makefile \
|
||||
idl/Makefile \
|
||||
|
@ -79,9 +79,7 @@ enum {
|
||||
LSZ_BTNS = 0,
|
||||
LSZ_VERTEX_BTN,
|
||||
LSZ_EDGE_BTN,
|
||||
#ifdef NETGEN_NEW
|
||||
LSZ_FACE_BTN,
|
||||
#endif
|
||||
LSZ_SEPARATOR2,
|
||||
LSZ_REMOVE_BTN
|
||||
};
|
||||
@ -241,10 +239,8 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
|
||||
localSizeLayout->addWidget(addVertexButton, LSZ_VERTEX_BTN, 1, 1, 1);
|
||||
QPushButton* addEdgeButton = new QPushButton(tr("NETGEN_LSZ_EDGE"), localSizeGroup);
|
||||
localSizeLayout->addWidget(addEdgeButton, LSZ_EDGE_BTN, 1, 1, 1);
|
||||
#ifdef NETGEN_NEW
|
||||
QPushButton* addFaceButton = new QPushButton(tr("NETGEN_LSZ_FACE"), localSizeGroup);
|
||||
localSizeLayout->addWidget(addFaceButton, LSZ_FACE_BTN, 1, 1, 1);
|
||||
#endif
|
||||
|
||||
QFrame *line2 = new QFrame(localSizeGroup);
|
||||
line2->setFrameShape(QFrame::HLine);
|
||||
@ -256,9 +252,7 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
|
||||
|
||||
connect( addVertexButton, SIGNAL(clicked()), this, SLOT(onAddLocalSizeOnVertex()));
|
||||
connect( addEdgeButton, SIGNAL(clicked()), this, SLOT(onAddLocalSizeOnEdge()));
|
||||
#ifdef NETGEN_NEW
|
||||
connect( addFaceButton, SIGNAL(clicked()), this, SLOT(onAddLocalSizeOnFace()));
|
||||
#endif
|
||||
connect( removeButton, SIGNAL(clicked()), this, SLOT(onRemoveLocalSizeOnShape()));
|
||||
connect( myLocalSizeTable, SIGNAL(cellChanged(int, int)), this, SLOT(onSetLocalSize(int, int)));
|
||||
|
||||
|
@ -25,18 +25,10 @@
|
||||
#
|
||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||
|
||||
SUBDIRS =
|
||||
if CMAKE_BUILD
|
||||
else
|
||||
if NETGEN_NEW
|
||||
else
|
||||
SUBDIRS += NETGEN
|
||||
endif
|
||||
endif
|
||||
SUBDIRS += NETGENPlugin
|
||||
SUBDIRS = NETGENPlugin
|
||||
|
||||
if NETGENPLUGIN_ENABLE_GUI
|
||||
SUBDIRS += GUI
|
||||
endif
|
||||
|
||||
DIST_SUBDIRS = NETGEN NETGENPlugin GUI
|
||||
DIST_SUBDIRS = NETGENPlugin GUI
|
||||
|
@ -1,78 +0,0 @@
|
||||
# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
|
||||
# -* Makefile *-
|
||||
# Author : Edward AGAPOV (OCC)
|
||||
# Modified by : Alexander BORODIN (OCN) - autotools usage
|
||||
# Module : NETGENPLUGIN
|
||||
# Date : 10/01/2004
|
||||
#
|
||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||
|
||||
# build .so of NETGEN itself
|
||||
|
||||
lib_LTLIBRARIES = libNETGEN.la
|
||||
|
||||
LIB_OBJ_O = \
|
||||
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
|
||||
|
||||
NETGEN_LIBS_DIR=@NETGEN_LIBS_DIR@
|
||||
|
||||
$(LIB_OBJ_O):
|
||||
ar x $(NETGEN_LIBS_DIR)/libnginterface.a
|
||||
ar x $(NETGEN_LIBS_DIR)/libocc.a
|
||||
ar x $(NETGEN_LIBS_DIR)/libcsg.a
|
||||
ar x $(NETGEN_LIBS_DIR)/libgprim.a
|
||||
ar x $(NETGEN_LIBS_DIR)/libmesh.a
|
||||
ar x $(NETGEN_LIBS_DIR)/libopti.a
|
||||
ar x $(NETGEN_LIBS_DIR)/libgen.a
|
||||
ar x $(NETGEN_LIBS_DIR)/libla.a
|
||||
ar x $(NETGEN_LIBS_DIR)/libstlgeom.a
|
||||
ar x $(NETGEN_LIBS_DIR)/libgeom2d.a
|
||||
rm -rf 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
|
||||
|
||||
#LIB_OBJ_LO = $(LIB_OBJ_O:%.o=%.lo)
|
||||
#%.lo: %.o; @ln -s $< $@
|
||||
|
||||
nodist_libNETGEN_la_SOURCES =
|
||||
|
||||
libNETGEN_la_LDFLAGS = $(LIB_OBJ_O) \
|
||||
$(CAS_LDPATH) -lTKernel -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKMesh -lTKSTL $(FCLIBS) $(STDLIB)
|
||||
|
||||
libNETGEN_la_DEPENDENCIES = $(LIB_OBJ_O)
|
||||
|
||||
EXTRA_DIST += \
|
||||
ReadMeForNgUsers \
|
||||
netgen43ForSalome.patch \
|
||||
netgen45ForSalome.patch \
|
||||
netgen45lib64.patch
|
@ -1,137 +1,48 @@
|
||||
# ------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------
|
||||
# Notes for Netgen >= 4.9
|
||||
# Notes for Netgen >= 4.9.13
|
||||
# ------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
Netgen can be find at http://www.hpfem.jku.at/netgen/
|
||||
Netgen home page: http://sourceforge.net/apps/mediawiki/netgen-mesher.
|
||||
|
||||
1. How to build Netgen for Netgen Plugin
|
||||
------------------------------
|
||||
1. Minimal requirements
|
||||
|
||||
1.1. Download Netgen archive (here netgen-4.9.12.tar.gz) and unpack it
|
||||
Minimal version of Netgen required for SALOME is 4.9.13.
|
||||
|
||||
1.2. Configure the netgen compilation. The "good" options are
|
||||
../netgen-4.9.12/configure \
|
||||
--prefix=THE_INSTALLATION_PATH \
|
||||
--with-occ=${CASROOT} \
|
||||
CXXFLAGS="-I${TOGL_HOME}/include" \
|
||||
LDFLAGS="-L${TOGL_HOME}/lib/Togl1.7"
|
||||
2. How to build Netgen for SALOME NETGEN Plugin
|
||||
-----------------------------------------
|
||||
|
||||
1.3. Compile the netgen product
|
||||
make then make install
|
||||
2.1. Download Netgen archive (here netgen-4.9.13.tar.gz) and unpack it
|
||||
|
||||
1.4. Patch the installation directory to copy include files
|
||||
2.2. Patch the Netgen distribution for SALOME
|
||||
|
||||
$ cd netgen45
|
||||
$ patch -p1 < patch_directory/netgen49ForSalome.patch
|
||||
|
||||
Note that patch corresponds to the version of Netgen you use.
|
||||
For example, netgen49ForSalome.patch mentioned above is a patch
|
||||
file for Netgen 4.9.13. The patch for Netgen can be found in
|
||||
NETGENPLUGIN_SRC/src/NETGEN directory.
|
||||
|
||||
2.3. Configure the netgen compilation. For example
|
||||
|
||||
$ cd netgen-4.9.13
|
||||
$ ./configure --prefix=THE_INSTALLATION_PATH \
|
||||
--with-occ=${CASROOT} \
|
||||
--with-tcl=${TCLHOME}/lib --with-tk=${TCLHOME}/lib \
|
||||
--with-tclinclude=${TCLHOME}/include
|
||||
|
||||
Note that Netgen depends on some products like Open CASCADE
|
||||
Technology and Tcl/Tk. These products should be specified
|
||||
to the configure script via options.
|
||||
|
||||
2.4. Compile the netgen product
|
||||
$ make
|
||||
$ make install
|
||||
|
||||
2.5. Patch the installation directory by copying 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/
|
||||
(CVS access) is used in the SMESH Module of Salome3 distribution.
|
||||
|
||||
1. How to build Netgen for Salome
|
||||
------------------------------
|
||||
|
||||
1.1. Download Netgen 4.5 from the NETGEN home site (see above).
|
||||
|
||||
1.2. Unpack the downloaded Netgen 4.5 archive
|
||||
(hereafter we assume that this is netgen45 directory)
|
||||
|
||||
1.3. Patch the netgen 4.5 distribution for SALOME:
|
||||
|
||||
$ cd netgen45
|
||||
$ patch -p1 < patch_directory/netgen45ForSalome.patch
|
||||
|
||||
1.4. For 64-bit platform you also need to apply another patch:
|
||||
|
||||
$ cd netgen45
|
||||
$ patch -p1 < patch_directory/netgen45lib64.patch
|
||||
|
||||
1.5. Set CASROOT environment variable to OCCT installation path,
|
||||
since Netgen 4.5 requires Open CASCADE Technology:
|
||||
|
||||
$ setenv CASROOT <occt_installation_path>
|
||||
|
||||
1.6. Compile and install netgen 4.5. To do this, simply run
|
||||
makeForSalome.sh script (it is created from the patch):
|
||||
|
||||
$ sh makeForSalome.sh
|
||||
|
||||
|
||||
2. Additional information for maintainers
|
||||
--------------------------------------
|
||||
|
||||
The file check_NETGEN.m4 assumes that Netgen is installed in
|
||||
the directory <netgen_installation_path> as follow:
|
||||
|
||||
prompt> ls <netgen_installation_path>
|
||||
|
||||
include/ lib/
|
||||
|
||||
prompt> ls <netgen_installation_path>/include
|
||||
|
||||
adfront2.hpp explicitcurve2d.hpp hpref_quad.hpp myadt.hpp spbita2d.hpp
|
||||
adfront3.hpp extrusion.hpp hpref_segm.hpp mydefs.hpp specials.hpp
|
||||
adtree.hpp findip.hpp hpref_tet.hpp mystdlib.h specpoin.hpp
|
||||
algprim.hpp findip2.hpp hpref_trig.hpp mystring.hpp spline.hpp
|
||||
array.hpp flags.hpp hprefinement.hpp ngexception.hpp spline2d.hpp
|
||||
autoptr.hpp gencyl.hpp identify.hpp nglib.h spline3d.hpp
|
||||
basemat.hpp geom2d.hpp improve2.hpp occgeom.hpp splinegeometry.hpp
|
||||
bisect.hpp geom2dmesh.hpp improve3.hpp occmeshsurf.hpp splinegeometry2.hpp
|
||||
bitarray.hpp geom3d.hpp linalg.hpp opti.hpp stack.hpp
|
||||
boundarylayer.hpp geometry2d.hpp localh.hpp optmem.hpp stlgeom.hpp
|
||||
brick.hpp geomfuncs.hpp manifold.hpp parthreads.hpp stlline.hpp
|
||||
classifyhpel.hpp geoml.hpp meshclass.hpp polyhedra.hpp stltool.hpp
|
||||
clusters.hpp geomobjects.hpp meshfunc.hpp polynomial.hpp stltopology.hpp
|
||||
csg.hpp geomops.hpp meshing.hpp profiler.hpp surface.hpp
|
||||
csgeom.hpp geomsearch.hpp meshing2.hpp revolution.hpp symbolta.hpp
|
||||
csgparser.hpp geomtest3d.hpp meshing3.hpp ruler2.hpp table.hpp
|
||||
curve2d.hpp global.hpp meshstlsurface.hpp ruler3.hpp template.hpp
|
||||
curvedelems.hpp gprim.hpp meshsurf.hpp seti.hpp topology.hpp
|
||||
curvedelems_new.hpp hashtabl.hpp meshtool.hpp singularref.hpp transform3d.hpp
|
||||
densemat.hpp hpref_hex.hpp meshtype.hpp solid.hpp triapprox.hpp
|
||||
dynamicmem.hpp hpref_prism.hpp moveablemem.hpp sort.hpp vector.hpp
|
||||
edgeflw.hpp hpref_pyramid.hpp msghandler.hpp sparsmat.hpp
|
||||
|
||||
prompt> ls <netgen_installation_path>/lib
|
||||
|
||||
libcsg.a libgeom2d.a libla.a libnginterface.a libopti.a
|
||||
libgen.a libgprim.a libmesh.a libocc.a libstlgeom.a
|
||||
|
||||
The library files can be also installed in the LINUX or LINUX64
|
||||
subfolder of the lib directory.
|
||||
|
||||
All the libraries *.a should be compiled without the option -DOPENGL.
|
||||
netgen45 is assumed to be the directory downloaded from the above web
|
||||
location archive of Netgen. The library
|
||||
<netgen_installation_path>/lib/libnginterface.a should contain the objects
|
||||
nglib.o (from netgen45/libsrc/interface/nglib.cpp) and ngnewdelete.o
|
||||
(from netgen45/ngtcltk/ngnewdelete.cpp).
|
||||
|
||||
To have that kind of distribution from the version in the above web location you
|
||||
need not to compile Netgen as suggested in the netgen45/README.INSTALL file.
|
||||
Simply modify the Makefiles to remove -DOPENGL from compiler flags
|
||||
list and to add OCC include dir and flags to compiler flags, add the objects
|
||||
nglib.o and ngnewdelete.o to the library libnginterface.a and
|
||||
recompile the libraries only.
|
||||
All this job is done by applying the patch and running the script makeForSalome.sh.
|
||||
|
||||
The suggested patch alters some Netgen sources to compile them.
|
||||
|
||||
Michael SAZONOV
|
||||
m-sazonov@opencascade.com
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------
|
||||
|
@ -1,221 +0,0 @@
|
||||
diff -N -r -u netgen43/libsrc/include/spline2d.hpp /tmp/netgen43/libsrc/include/spline2d.hpp
|
||||
--- netgen43/libsrc/include/spline2d.hpp 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ /tmp/netgen43/libsrc/include/spline2d.hpp 2003-12-10 16:28:12.000000000 +0100
|
||||
@@ -0,0 +1 @@
|
||||
+#include "../geom2d/spline2d.hpp"
|
||||
diff -N -r -u netgen43/libsrc/include/splinegeometry2.hpp /tmp/netgen43/libsrc/include/splinegeometry2.hpp
|
||||
--- netgen43/libsrc/include/splinegeometry2.hpp 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ /tmp/netgen43/libsrc/include/splinegeometry2.hpp 2003-12-10 16:28:23.000000000 +0100
|
||||
@@ -0,0 +1 @@
|
||||
+#include "../geom2d/splinegeometry2.hpp"
|
||||
diff -N -r -u netgen43/libsrc/interface/Makefile /tmp/netgen43/libsrc/interface/Makefile
|
||||
--- netgen43/libsrc/interface/Makefile 2003-05-07 16:01:43.000000000 +0200
|
||||
+++ /tmp/netgen43/libsrc/interface/Makefile 2003-12-10 15:59:47.000000000 +0100
|
||||
@@ -1,4 +1,4 @@
|
||||
-src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp readuser.cpp importsolution.cpp
|
||||
+src = writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp readuser.cpp importsolution.cpp nglib.cpp ngnewdelete.cpp
|
||||
#
|
||||
lib = nginterface
|
||||
libpath = libsrc/interface
|
||||
diff -N -r -u netgen43/libsrc/interface/nglib.cpp /tmp/netgen43/libsrc/interface/nglib.cpp
|
||||
--- netgen43/libsrc/interface/nglib.cpp 2003-05-07 16:01:43.000000000 +0200
|
||||
+++ /tmp/netgen43/libsrc/interface/nglib.cpp 2003-12-10 16:32:54.000000000 +0100
|
||||
@@ -23,6 +23,20 @@
|
||||
|
||||
#include "nglib.h"
|
||||
|
||||
+namespace netgen
|
||||
+{
|
||||
+ char geomfilename [100];
|
||||
+
|
||||
+ //Destination for messages, errors, ...
|
||||
+ void Ng_PrintDest(const char * s)
|
||||
+ {
|
||||
+ (*mycout) << s << flush;
|
||||
+ }
|
||||
+
|
||||
+#include <spline2d.hpp>
|
||||
+#include <splinegeometry2.hpp>
|
||||
+}
|
||||
+
|
||||
using namespace netgen;
|
||||
|
||||
// constants and types:
|
||||
@@ -171,8 +185,6 @@
|
||||
// CSG Geometry
|
||||
|
||||
// FlexLexer * lexer;
|
||||
-char geomfilename [100];
|
||||
-
|
||||
|
||||
// 2D Meshing Functions:
|
||||
|
||||
@@ -362,7 +374,18 @@
|
||||
cout << "e(" << readedges.Get(i) << "," << readedges.Get(i+1) << ")" << endl;
|
||||
}
|
||||
*/
|
||||
- geo->AddEdges(readedges);
|
||||
+
|
||||
+ ARRAY< Point<3> > readedges1;
|
||||
+
|
||||
+ for (i = 1; i <= readedges.Size(); i++)
|
||||
+ {
|
||||
+ Point3d readedgesData = readedges.Get(i);
|
||||
+ Point <3> readedges1Data = Point<3>(readedgesData.X(),readedgesData.Y(),readedgesData.Z());
|
||||
+
|
||||
+ readedges1.Append(readedges1Data);
|
||||
+ }
|
||||
+
|
||||
+ geo->AddEdges(readedges1);
|
||||
}
|
||||
|
||||
if (geo->GetStatus() == STLTopology::STL_GOOD || geo->GetStatus() == STLTopology::STL_WARNING) return NG_OK;
|
||||
@@ -472,7 +495,14 @@
|
||||
n = Vec3d(nv[0],nv[1],nv[2]);
|
||||
}
|
||||
|
||||
- readtrias.Append(STLReadTriangle(apts,n));
|
||||
+ Point<3> apts1[3];
|
||||
+ apts1[0] = Point<3>(p1[0],p1[1],p1[2]);
|
||||
+ apts1[1] = Point<3>(p2[0],p2[1],p2[2]);
|
||||
+ apts1[2] = Point<3>(p3[0],p3[1],p3[2]);
|
||||
+
|
||||
+ Vec<3> n1 = Vec<3>(n.X(),n.Y(),n.Z());
|
||||
+
|
||||
+ readtrias.Append(STLReadTriangle(apts1,n1));
|
||||
}
|
||||
|
||||
// add (optional) edges:
|
||||
@@ -487,30 +517,29 @@
|
||||
|
||||
// compatibility functions:
|
||||
|
||||
-void MyError (const char * ch)
|
||||
+void netgen::MyError (const char * ch)
|
||||
{
|
||||
cerr << ch;
|
||||
}
|
||||
|
||||
-//Destination for messages, errors, ...
|
||||
-void Ng_PrintDest(const char * s)
|
||||
-{
|
||||
- (*mycout) << s << flush;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-double GetTime ()
|
||||
+double netgen::GetTime ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
-void ResetTime ()
|
||||
+void netgen::ResetTime ()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
-void MyBeep (int i)
|
||||
+void netgen::MyBeep (int i)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
+void MeshFromSpline2D (SplineGeometry2d & geometry,
|
||||
+ Mesh *& mesh,
|
||||
+ MeshingParameters & mp)
|
||||
+{
|
||||
+ MeshFromSpline2D (geometry, mesh, mp);
|
||||
+}
|
||||
diff -N -r -u netgen43/libsrc/makefile.mach.LINUX /tmp/netgen43/libsrc/makefile.mach.LINUX
|
||||
--- netgen43/libsrc/makefile.mach.LINUX 2003-05-07 16:01:43.000000000 +0200
|
||||
+++ /tmp/netgen43/libsrc/makefile.mach.LINUX 2003-12-10 15:12:18.000000000 +0100
|
||||
@@ -14,7 +14,8 @@
|
||||
#
|
||||
CFLAGS2 =
|
||||
# pg stands for profiling - also in linkflags2
|
||||
-CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX -DOPENGL
|
||||
+#CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX -DOPENGL
|
||||
+CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX
|
||||
# -fomit-frame-pointer
|
||||
# -ffast-math
|
||||
#
|
||||
diff -N -r -u netgen43/libsrc/meshing/improve2.cpp /tmp/netgen43/libsrc/meshing/improve2.cpp
|
||||
--- netgen43/libsrc/meshing/improve2.cpp 2003-05-07 16:01:43.000000000 +0200
|
||||
+++ /tmp/netgen43/libsrc/meshing/improve2.cpp 2003-12-10 15:42:00.000000000 +0100
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "meshing.hpp"
|
||||
#include <opti.hpp>
|
||||
|
||||
-#include <visual.hpp>
|
||||
+/*#include <visual.hpp>*/
|
||||
|
||||
|
||||
namespace netgen
|
||||
diff -N -r -u netgen43/libsrc/meshing/meshing2.cpp /tmp/netgen43/libsrc/meshing/meshing2.cpp
|
||||
--- netgen43/libsrc/meshing/meshing2.cpp 2003-05-07 16:01:43.000000000 +0200
|
||||
+++ /tmp/netgen43/libsrc/meshing/meshing2.cpp 2003-12-10 15:34:35.000000000 +0100
|
||||
@@ -1785,7 +1785,7 @@
|
||||
|
||||
|
||||
#else
|
||||
-void glrender (int wait)
|
||||
+void netgen::glrender (int wait)
|
||||
{
|
||||
;
|
||||
}
|
||||
diff -N -r -u netgen43/libsrc/visualization/stlmeshing.cpp /tmp/netgen43/libsrc/visualization/stlmeshing.cpp
|
||||
--- netgen43/libsrc/visualization/stlmeshing.cpp 2003-05-07 16:01:43.000000000 +0200
|
||||
+++ /tmp/netgen43/libsrc/visualization/stlmeshing.cpp 2003-12-10 15:52:53.000000000 +0100
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <stlgeom.hpp>
|
||||
|
||||
#include <meshing.hpp>
|
||||
-#include <visual.hpp>
|
||||
+/*#include <visual.hpp>*/
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
diff -N -r -u netgen43/Makefile /tmp/netgen43/Makefile
|
||||
--- netgen43/Makefile 2003-05-07 16:01:43.000000000 +0200
|
||||
+++ /tmp/netgen43/Makefile 2003-12-10 15:11:41.000000000 +0100
|
||||
@@ -35,7 +35,8 @@
|
||||
.SUFFIXES: .cpp .o
|
||||
#
|
||||
#
|
||||
-CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL
|
||||
+#CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL
|
||||
+CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include
|
||||
LINKFLAGS1 = -lGL -lGLU -lX11 -lXext -lXmu
|
||||
#
|
||||
CPLUSPLUSFLAGS = $(CPLUSPLUSFLAGS1) $(CPLUSPLUSFLAGS2) $(CPLUSPLUSFLAGS3)
|
||||
diff -N -r -u netgen43/makeForSalome.sh /tmp/netgen43/makeForSalome.sh
|
||||
--- netgen43/makeForSalome.sh 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ /tmp/netgen43/makeForSalome.sh 2004-01-05 12:33:59.000000000 +0100
|
||||
@@ -0,0 +1,26 @@
|
||||
+#! /bin/sh
|
||||
+cp ngtcltk/ngnewdelete.* libsrc/interface/
|
||||
+
|
||||
+MACHINE=LINUX
|
||||
+export MACHINE
|
||||
+make -C libsrc/csg
|
||||
+make -C libsrc/general
|
||||
+make -C libsrc/geom2d
|
||||
+make -C libsrc/gprim
|
||||
+make -C libsrc/interface
|
||||
+make -C libsrc/linalg
|
||||
+make -C libsrc/meshing
|
||||
+make -C libsrc/opti
|
||||
+make -C libsrc/stlgeom
|
||||
+
|
||||
+if [ ! -d install ] ; then
|
||||
+ mkdir install
|
||||
+fi
|
||||
+
|
||||
+cp -r lib install/
|
||||
+
|
||||
+if [ ! -d install/include ] ; then
|
||||
+ mkdir install/include
|
||||
+fi
|
||||
+
|
||||
+cp libsrc/interface/nglib.h install/include
|
File diff suppressed because it is too large
Load Diff
@ -1,45 +0,0 @@
|
||||
diff -ur netgen-4.5.old/libsrc/makefile.inc netgen-4.5.new/libsrc/makefile.inc
|
||||
--- netgen-4.5/libsrc/makefile.inc 2006-04-27 13:12:54.000000000 +0400
|
||||
+++ netgen-4.5/libsrc/makefile.inc 2006-09-05 14:16:32.000000000 +0400
|
||||
@@ -14,7 +14,7 @@
|
||||
#
|
||||
include $(LIBSRC_DIR)/makefile.mach.$(MACHINE)
|
||||
#
|
||||
-CPLUSPLUSFLAGS1 = -c -fPIC -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \
|
||||
+CPLUSPLUSFLAGS1 = -c -m64 -D_OCC64 -fPIC -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \
|
||||
-DOCCGEOMETRY -DOCC52 -DHAVE_IOSTREAM -DHAVE_LIMITS_H
|
||||
#
|
||||
ARFLAGS = r
|
||||
diff -ur netgen-4.5.old/libsrc/makefile.mach.LINUX64 netgen-4.5.new/libsrc/makefile.mach.LINUX64
|
||||
--- netgen-4.5/libsrc/makefile.mach.LINUX64 2006-03-29 15:09:32.000000000 +0400
|
||||
+++ netgen-4.5/libsrc/makefile.mach.LINUX64 2006-09-07 15:48:39.000000000 +0400
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
#
|
||||
CFLAGS2 =
|
||||
-CPLUSPLUSFLAGS2 = -pg -march=nocona -O2 -DLINUX -DOPENGL \
|
||||
+CPLUSPLUSFLAGS2 = -pg -march=nocona -O2 -DLINUX \
|
||||
-ftemplate-depth-99 -finline-limit=100000 \
|
||||
-fforce-addr -funroll-loops \
|
||||
-DTRAFO -DNGSOLVE -DnoADDON -DnoLAPACK -DnoFAST \
|
||||
@@ -23,7 +23,7 @@
|
||||
#
|
||||
#
|
||||
|
||||
-LINKFLAGS2 = -pg -L/usr/openwin/lib64 -L/usr/X11R6/lib64 -L/usr/lib/GL3.5 -L/usr/lib64
|
||||
+LINKFLAGS2 = -fPIC -pg -L/usr/openwin/lib64 -L/usr/X11R6/lib64 -L/usr/lib/GL3.5 -L/usr/lib64
|
||||
|
||||
|
||||
SYSLIB2 = -lstdc++
|
||||
diff -ur netgen-4.5.old/Makefile netgen-4.5.new/Makefile
|
||||
--- netgen-4.5/Makefile 2006-03-29 15:09:12.000000000 +0400
|
||||
+++ netgen-4.5/Makefile 2006-09-07 15:46:07.000000000 +0400
|
||||
@@ -72,7 +72,7 @@
|
||||
#
|
||||
#CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL
|
||||
|
||||
-CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) -I./ngsolve/include -Ilibsrc/interface -DOPENGL -I$(METISINC)
|
||||
+CPLUSPLUSFLAGS1 = -c -m64 -D_OCC64 -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) -I./ngsolve/include -Ilibsrc/interface -I$(METISINC)
|
||||
|
||||
LINKFLAGS1 = -lGL -lGLU -lX11 -lXext -lXmu
|
||||
#
|
897
src/NETGEN/netgen50ForSalome.patch
Normal file
897
src/NETGEN/netgen50ForSalome.patch
Normal file
@ -0,0 +1,897 @@
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/meshing/meshtype.cpp netgen-5.0.0.patched/libsrc/meshing/meshtype.cpp
|
||||
--- netgen-5.0.0.orig/libsrc/meshing/meshtype.cpp 2012-11-09 19:15:04.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/meshing/meshtype.cpp 2013-02-21 17:46:13.000000000 +0400
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <mystdlib.h>
|
||||
+#include <float.h> // to get DBL_MIN defined
|
||||
|
||||
#include "meshing.hpp"
|
||||
|
||||
@@ -666,7 +667,8 @@
|
||||
|
||||
double det = trans.Det();
|
||||
|
||||
- if (det <= 0)
|
||||
+ // if (det <= 0)
|
||||
+ if (det <= DBL_MIN) // avoid FPE
|
||||
err += 1e12;
|
||||
else
|
||||
err += frob * frob / det;
|
||||
@@ -722,7 +724,8 @@
|
||||
|
||||
double det = trans(0,0)*trans(1,1)-trans(1,0)*trans(0,1);
|
||||
|
||||
- if (det <= 0)
|
||||
+ // if (det <= 0)
|
||||
+ if (det <= DBL_MIN) // avoid FPE
|
||||
{
|
||||
dd = 0;
|
||||
return 1e12;
|
||||
@@ -806,7 +809,8 @@
|
||||
= dtrans(0,0) * trans(1,1) - trans(0,1) * dtrans(1,0)
|
||||
+ trans(0,0) * dtrans(1,1) - dtrans(0,1) * trans(1,0);
|
||||
|
||||
- if (det <= 0)
|
||||
+ // if (det <= 0)
|
||||
+ if (det <= DBL_MIN) // avoid FPE
|
||||
err += 1e12;
|
||||
else
|
||||
{
|
||||
@@ -856,7 +860,8 @@
|
||||
frob /= 2;
|
||||
|
||||
double det = trans.Det();
|
||||
- if (det <= 0)
|
||||
+ //if (det <= 0)
|
||||
+ if (det <= DBL_MIN) // avoid FPE
|
||||
err += 1e12;
|
||||
else
|
||||
err += frob * frob / det;
|
||||
@@ -1864,7 +1869,8 @@
|
||||
case PYRAMID:
|
||||
{
|
||||
double noz = 1-p(2);
|
||||
- if (noz == 0.0) noz = 1e-10;
|
||||
+ //if (noz == 0.0) noz = 1e-10;
|
||||
+ if (noz <= DBL_MIN) noz = 1e-10; // avoid FPE
|
||||
|
||||
double xi = p(0) / noz;
|
||||
double eta = p(1) / noz;
|
||||
@@ -2030,7 +2036,8 @@
|
||||
|
||||
double det = -trans.Det();
|
||||
|
||||
- if (det <= 0)
|
||||
+ //if (det <= 0)
|
||||
+ if (det <= DBL_MIN) // avoid FPE
|
||||
err += 1e12;
|
||||
else
|
||||
err += frob * frob * frob / det;
|
||||
@@ -2102,7 +2109,8 @@
|
||||
ddet *= -1;
|
||||
|
||||
|
||||
- if (det <= 0)
|
||||
+ //if (det <= 0)
|
||||
+ if (det <= DBL_MIN) // avoid FPE
|
||||
err += 1e12;
|
||||
else
|
||||
{
|
||||
@@ -2184,7 +2192,7 @@
|
||||
|
||||
det *= -1;
|
||||
|
||||
- if (det <= 0)
|
||||
+ if (det <= DBL_MIN)
|
||||
err += 1e12;
|
||||
else
|
||||
{
|
||||
@@ -2513,10 +2521,10 @@
|
||||
|
||||
MeshingParameters :: MeshingParameters ()
|
||||
{
|
||||
- optimize3d = "cmdmustm";
|
||||
+ optimize3d = (char*)"cmdmustm"; // optimize3d = "cmdmustm";
|
||||
//optimize3d = "cmdmstm";
|
||||
optsteps3d = 3;
|
||||
- optimize2d = "smsmsmSmSmSm";
|
||||
+ optimize2d = (char*)"smsmsmSmSmSm"; // optimize2d = "smsmsmSmSmSm";
|
||||
optsteps2d = 3;
|
||||
opterrpow = 2;
|
||||
blockfill = 1;
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/meshing/meshtype.hpp netgen-5.0.0.patched/libsrc/meshing/meshtype.hpp
|
||||
--- netgen-5.0.0.orig/libsrc/meshing/meshtype.hpp 2012-11-09 19:15:04.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/meshing/meshtype.hpp 2013-02-21 17:46:13.000000000 +0400
|
||||
@@ -15,6 +15,7 @@
|
||||
Classes for NETGEN
|
||||
*/
|
||||
|
||||
+class Mesh; // added due to compilation errors on some platforms
|
||||
|
||||
|
||||
enum ELEMENT_TYPE {
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/meshing/smoothing2.cpp netgen-5.0.0.patched/libsrc/meshing/smoothing2.cpp
|
||||
--- netgen-5.0.0.orig/libsrc/meshing/smoothing2.cpp 2012-11-09 19:15:04.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/meshing/smoothing2.cpp 2013-02-25 11:20:05.000000000 +0400
|
||||
@@ -200,7 +200,8 @@
|
||||
vgrad = 0;
|
||||
badness = 0;
|
||||
|
||||
- ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
|
||||
+ //normal already computed: ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
|
||||
+ n = ld.normal;
|
||||
pp1 = ld.sp1 + x(0) * ld.t1 + x(1) * ld.t2;
|
||||
|
||||
// meshthis -> ProjectPoint (surfi, pp1);
|
||||
@@ -258,7 +259,8 @@
|
||||
vgrad = 0;
|
||||
badness = 0;
|
||||
|
||||
- ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
|
||||
+ //normal already computed: ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
|
||||
+ n = ld.normal;
|
||||
|
||||
pp1 = ld.sp1 + x(0) * ld.t1 + x(1) * ld.t2;
|
||||
|
||||
@@ -417,7 +419,8 @@
|
||||
vgrad = 0;
|
||||
badness = 0;
|
||||
|
||||
- ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
|
||||
+ //normal already computed: ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
|
||||
+ n = ld.normal;
|
||||
|
||||
pp1 = ld.sp1 + x(0) * ld.t1 + x(1) * ld.t2;
|
||||
|
||||
@@ -489,7 +492,8 @@
|
||||
vgrad = 0;
|
||||
badness = 0;
|
||||
|
||||
- ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
|
||||
+ //normal already computed: ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
|
||||
+ n = ld.normal;
|
||||
|
||||
// pp1 = sp1;
|
||||
// pp1.Add2 (x.Get(1), t1, x.Get(2), t2);
|
||||
@@ -916,7 +920,7 @@
|
||||
{
|
||||
mesh[pi] = Point<3> (origp);
|
||||
}
|
||||
-
|
||||
+ break; // exit as <fact> is not used anymore
|
||||
}
|
||||
}
|
||||
}
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/occ/Partition_Inter3d.cxx netgen-5.0.0.patched/libsrc/occ/Partition_Inter3d.cxx
|
||||
--- netgen-5.0.0.orig/libsrc/occ/Partition_Inter3d.cxx 2012-11-09 19:15:02.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/occ/Partition_Inter3d.cxx 2013-02-25 13:51:48.000000000 +0400
|
||||
@@ -243,9 +243,11 @@
|
||||
Standard_Integer i, nbExt = anExtPS.NbExt();
|
||||
Extrema_POnSurf aPOnSurf;
|
||||
for (i = 1; i <= nbExt; ++i )
|
||||
- if (anExtPS.Value( i ) <= TolE) // V6.3
|
||||
- // if (anExtPS.SquareDistance( i ) <= TolE) // V6.5
|
||||
- {
|
||||
+ // porting to OCCT6.5.1
|
||||
+ //if (anExtPS.Value( i ) <= TolE) // V6.3
|
||||
+ // if (anExtPS.SquareDistance( i ) <= TolE) // V6.5
|
||||
+ if (anExtPS.SquareDistance( i ) <= TolE * TolE)
|
||||
+ {
|
||||
aPOnSurf = anExtPS.Point( i );
|
||||
break;
|
||||
}
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/occ/Partition_Loop2d.cxx netgen-5.0.0.patched/libsrc/occ/Partition_Loop2d.cxx
|
||||
--- netgen-5.0.0.orig/libsrc/occ/Partition_Loop2d.cxx 2012-11-09 19:15:02.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/occ/Partition_Loop2d.cxx 2013-02-25 13:48:15.000000000 +0400
|
||||
@@ -210,7 +210,7 @@
|
||||
Cc->D1(uc, PC, CTg1);
|
||||
if (!isForward) CTg1.Reverse();
|
||||
|
||||
- Standard_Real anglemin = 3 * PI, tolAng = 1.e-8;
|
||||
+ Standard_Real anglemin = 3 * M_PI, tolAng = 1.e-8;
|
||||
|
||||
// select an edge whose first derivative is most left of CTg1
|
||||
// ie an angle between Tg1 and CTg1 is least
|
||||
@@ -234,7 +234,7 @@
|
||||
// -PI < angle < PI
|
||||
Standard_Real angle = Tg1.Angle(CTg1);
|
||||
|
||||
- if (PI - Abs(angle) <= tolAng)
|
||||
+ if (M_PI - Abs(angle) <= tolAng)
|
||||
{
|
||||
// an angle is too close to PI; assure that an angle sign really
|
||||
// reflects an edge position: +PI - an edge is worst,
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/occ/Partition_Spliter.cxx netgen-5.0.0.patched/libsrc/occ/Partition_Spliter.cxx
|
||||
--- netgen-5.0.0.orig/libsrc/occ/Partition_Spliter.cxx 2012-11-09 19:15:02.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/occ/Partition_Spliter.cxx 2013-02-25 13:55:10.000000000 +0400
|
||||
@@ -1169,8 +1169,10 @@
|
||||
for (; j<=nbj && ok; ++j) {
|
||||
if (Extrema.IsMin(j)) {
|
||||
hasMin = Standard_True;
|
||||
- ok = Extrema.Value(j) <= tol; // V6.3
|
||||
+ // porting to OCCT6.5.1
|
||||
+ //ok = Extrema.Value(j) <= tol; // V6.3
|
||||
// ok = Extrema.SquareDistance(j) <= tol; // V6.5
|
||||
+ ok = Extrema.SquareDistance(j) <= tol * tol;
|
||||
}
|
||||
}
|
||||
}
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/occ/occconstruction.cpp netgen-5.0.0.patched/libsrc/occ/occconstruction.cpp
|
||||
--- netgen-5.0.0.orig/libsrc/occ/occconstruction.cpp 2012-11-09 19:15:02.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/occ/occconstruction.cpp 2013-02-21 17:46:13.000000000 +0400
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <BRepAlgoAPI_Common.hxx>
|
||||
#include <BRepAlgoAPI_Fuse.hxx>
|
||||
#include <BRepAlgoAPI_Section.hxx>
|
||||
-#include <BRepOffsetAPI_Sewing.hxx>
|
||||
+//#include <BRepOffsetAPI_Sewing.hxx>
|
||||
//#include <BRepAlgo_Sewing.hxx>
|
||||
#include <BRepOffsetAPI_MakeOffsetShape.hxx>
|
||||
#include <ShapeFix_Shape.hxx>
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/occ/occgenmesh.cpp netgen-5.0.0.patched/libsrc/occ/occgenmesh.cpp
|
||||
--- netgen-5.0.0.orig/libsrc/occ/occgenmesh.cpp 2012-11-09 19:15:02.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/occ/occgenmesh.cpp 2013-02-21 17:46:13.000000000 +0400
|
||||
@@ -57,6 +57,8 @@
|
||||
|
||||
|
||||
|
||||
+
|
||||
+ static // useless out of this file
|
||||
double ComputeH (double kappa)
|
||||
{
|
||||
double hret;
|
||||
@@ -74,8 +76,7 @@
|
||||
}
|
||||
|
||||
|
||||
-
|
||||
-
|
||||
+ static // useless out of this file
|
||||
void RestrictHTriangle (gp_Pnt2d & par0, gp_Pnt2d & par1, gp_Pnt2d & par2,
|
||||
BRepLProp_SLProps * prop, Mesh & mesh, int depth, double h = 0)
|
||||
{
|
||||
@@ -171,8 +172,8 @@
|
||||
if(h < 1e-4*maxside)
|
||||
return;
|
||||
|
||||
-
|
||||
- if (h > 30) return;
|
||||
+ // commented to restrict H on a large sphere for example
|
||||
+ //if (h > 30) return;
|
||||
}
|
||||
|
||||
if (h < maxside && depth < 10)
|
||||
@@ -231,6 +232,7 @@
|
||||
|
||||
|
||||
|
||||
+ static // useless out of this file
|
||||
void DivideEdge (TopoDS_Edge & edge, Array<MeshPoint> & ps,
|
||||
Array<double> & params, Mesh & mesh)
|
||||
{
|
||||
@@ -250,8 +252,8 @@
|
||||
hvalue[0] = 0;
|
||||
pnt = c->Value(s0);
|
||||
|
||||
- double olddist = 0;
|
||||
- double dist = 0;
|
||||
+ //double olddist = 0; -- useless variables
|
||||
+ //double dist = 0;
|
||||
|
||||
int tmpVal = (int)(DIVIDEEDGESECTIONS);
|
||||
|
||||
@@ -259,15 +261,19 @@
|
||||
{
|
||||
oldpnt = pnt;
|
||||
pnt = c->Value(s0+(i/double(DIVIDEEDGESECTIONS))*(s1-s0));
|
||||
+ // -- no more than 1 segment per <edge length>/DIVIDEEDGESECTIONS
|
||||
hvalue[i] = hvalue[i-1] +
|
||||
- 1.0/mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z()))*
|
||||
- pnt.Distance(oldpnt);
|
||||
+ // 1.0/mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z()))*
|
||||
+ // pnt.Distance(oldpnt);
|
||||
+ min( 1.0,
|
||||
+ 1.0/mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z()))*
|
||||
+ pnt.Distance(oldpnt));
|
||||
|
||||
//(*testout) << "mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z())) " << mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z()))
|
||||
// << " pnt.Distance(oldpnt) " << pnt.Distance(oldpnt) << endl;
|
||||
|
||||
- olddist = dist;
|
||||
- dist = pnt.Distance(oldpnt);
|
||||
+ //olddist = dist; -- useless variables
|
||||
+ //dist = pnt.Distance(oldpnt);
|
||||
}
|
||||
|
||||
// nsubedges = int(ceil(hvalue[DIVIDEEDGESECTIONS]));
|
||||
@@ -282,7 +288,10 @@
|
||||
{
|
||||
if (hvalue[i1]/hvalue[DIVIDEEDGESECTIONS]*nsubedges >= i)
|
||||
{
|
||||
- params[i] = s0+(i1/double(DIVIDEEDGESECTIONS))*(s1-s0);
|
||||
+ // -- for nsubedges comparable to DIVIDEEDGESECTIONS
|
||||
+ //params[i] = s0+(i1/double(DIVIDEEDGESECTIONS))*(s1-s0);
|
||||
+ double d1 = i1 - (hvalue[i1] - i*hvalue[DIVIDEEDGESECTIONS]/nsubedges)/(hvalue[i1]-hvalue[i1-1]);
|
||||
+ params[i] = s0+(d1/double(DIVIDEEDGESECTIONS))*(s1-s0);
|
||||
pnt = c->Value(params[i]);
|
||||
ps[i-1] = MeshPoint (Point3d(pnt.X(), pnt.Y(), pnt.Z()));
|
||||
i++;
|
||||
@@ -326,6 +335,7 @@
|
||||
(*testout) << "nedges = " << nedges << endl;
|
||||
|
||||
double eps = 1e-6 * geom.GetBoundingBox().Diam();
|
||||
+ const double eps2 = eps * eps; // -- small optimization
|
||||
|
||||
for (int i = 1; i <= nvertices; i++)
|
||||
{
|
||||
@@ -335,7 +345,8 @@
|
||||
bool exists = 0;
|
||||
if (merge_solids)
|
||||
for (PointIndex pi = 1; pi <= mesh.GetNP(); pi++)
|
||||
- if ( Dist2 (mesh[pi], Point<3>(mp)) < eps*eps)
|
||||
+ //if ( Dist2 (mesh[pi], Point<3>(mp)) < eps*eps)
|
||||
+ if ( Dist2 (mesh[pi], Point<3>(mp)) < eps2 ) // -- small optimization
|
||||
{
|
||||
exists = 1;
|
||||
break;
|
||||
@@ -365,6 +376,7 @@
|
||||
{
|
||||
TopoDS_Face face = TopoDS::Face(exp1.Current());
|
||||
int facenr = geom.fmap.FindIndex(face);
|
||||
+ if ( facenr < 1 ) continue; // -- to support SALOME sub-meshes
|
||||
|
||||
if (face2solid[0][facenr-1] == 0)
|
||||
face2solid[0][facenr-1] = solidnr;
|
||||
@@ -384,6 +396,7 @@
|
||||
int facenr = 0;
|
||||
int edgenr = 0;
|
||||
|
||||
+ edgenr = mesh.GetNSeg(); // to support SALOME sub-meshes
|
||||
|
||||
(*testout) << "faces = " << geom.fmap.Extent() << endl;
|
||||
int curr = 0;
|
||||
@@ -445,6 +458,7 @@
|
||||
//(*testout) << "ignoring degenerated edge" << endl;
|
||||
continue;
|
||||
}
|
||||
+ if ( geom.emap.FindIndex(edge) < 1 ) continue; // to support SALOME sub-meshes
|
||||
|
||||
if (geom.vmap.FindIndex(TopExp::FirstVertex (edge)) ==
|
||||
geom.vmap.FindIndex(TopExp::LastVertex (edge)))
|
||||
@@ -482,15 +496,64 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- Point<3> fp = occ2ng (BRep_Tool::Pnt (TopExp::FirstVertex (edge)));
|
||||
- Point<3> lp = occ2ng (BRep_Tool::Pnt (TopExp::LastVertex (edge)));
|
||||
+ TopoDS_Iterator vIt( edge, false );
|
||||
+ TopoDS_Vertex v1 = TopoDS::Vertex( vIt.Value() ); vIt.Next();
|
||||
+ TopoDS_Vertex v2 = TopoDS::Vertex( vIt.Value() );
|
||||
+ if ( v1.Orientation() == TopAbs_REVERSED )
|
||||
+ std::swap( v1, v2 );
|
||||
+ const bool isClosedEdge = v1.IsSame( v2 );
|
||||
+
|
||||
+ Point<3> fp = occ2ng (BRep_Tool::Pnt (v1));
|
||||
+ Point<3> lp = occ2ng (BRep_Tool::Pnt (v2));
|
||||
+ double tol2 = std::min( eps*eps, 1e-6 * Dist2( fp, lp ));
|
||||
+ if ( isClosedEdge )
|
||||
+ tol2 = BRep_Tool::Tolerance( v1 ) * BRep_Tool::Tolerance( v1 );
|
||||
|
||||
pnums[0] = -1;
|
||||
pnums.Last() = -1;
|
||||
for (PointIndex pi = 1; pi < first_ep; pi++)
|
||||
{
|
||||
- if (Dist2 (mesh[pi], fp) < eps*eps) pnums[0] = pi;
|
||||
- if (Dist2 (mesh[pi], lp) < eps*eps) pnums.Last() = pi;
|
||||
+ if (Dist2 (mesh[pi], fp) < tol2) pnums[0] = pi;
|
||||
+ if (Dist2 (mesh[pi], lp) < tol2) pnums.Last() = pi;
|
||||
+ }
|
||||
+ if (( isClosedEdge && pnums[0] != pnums.Last() ) ||
|
||||
+ ( !isClosedEdge && pnums[0] == pnums.Last() ))
|
||||
+ pnums[0] = pnums.Last() = -1;
|
||||
+ if ( pnums[0] == -1 || pnums.Last() == -1 )
|
||||
+ {
|
||||
+ // take into account a possible large gap between a vertex and an edge curve
|
||||
+ // end and a large vertex tolerance covering the whole edge
|
||||
+ if ( pnums[0] == -1 )
|
||||
+ {
|
||||
+ double tol = BRep_Tool::Tolerance( v1 );
|
||||
+ for (PointIndex pi = 1; pi < first_ep; pi++)
|
||||
+ if (pi != pnums.Last() && Dist2 (mesh[pi], fp) < 2*tol*tol)
|
||||
+ pnums[0] = pi;
|
||||
+
|
||||
+ if ( pnums[0] == -1 )
|
||||
+ pnums[0] = first_ep-1- nvertices + geom.vmap.FindIndex ( v1 );
|
||||
+ }
|
||||
+ if ( isClosedEdge )
|
||||
+ {
|
||||
+ pnums.Last() = pnums[0];
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if ( pnums.Last() == -1 )
|
||||
+ {
|
||||
+ double tol = BRep_Tool::Tolerance( v2 );
|
||||
+ for (PointIndex pi = 1; pi < first_ep; pi++)
|
||||
+ if (pi != pnums[0] && Dist2 (mesh[pi], lp) < 2*tol*tol)
|
||||
+ pnums.Last() = pi;
|
||||
+
|
||||
+ if ( pnums.Last() == -1 )
|
||||
+ pnums.Last() = first_ep-1-nvertices + geom.vmap.FindIndex ( v2 );
|
||||
+ }
|
||||
+
|
||||
+ if ( Dist2( fp, mesh[PointIndex(pnums[0])]) >
|
||||
+ Dist2( lp, mesh[PointIndex(pnums.Last())]))
|
||||
+ std::swap( pnums[0], pnums.Last() );
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1458,3 +1521,4 @@
|
||||
}
|
||||
|
||||
#endif
|
||||
+
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/occ/occgeom.cpp netgen-5.0.0.patched/libsrc/occ/occgeom.cpp
|
||||
--- netgen-5.0.0.orig/libsrc/occ/occgeom.cpp 2012-11-09 19:15:02.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/occ/occgeom.cpp 2013-02-21 17:46:13.000000000 +0400
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "ShapeAnalysis_CheckSmallFace.hxx"
|
||||
#include "ShapeAnalysis_DataMapOfShapeListOfReal.hxx"
|
||||
#include "ShapeAnalysis_Surface.hxx"
|
||||
+#include <BRepTopAdaptor_FClass2d.hxx> // -- to optimize Project() and FastProject()
|
||||
+#include <TopAbs_State.hxx>
|
||||
#include "BRepAlgoAPI_Fuse.hxx"
|
||||
#include "BRepCheck_Analyzer.hxx"
|
||||
#include "BRepLib.hxx"
|
||||
@@ -16,10 +18,17 @@
|
||||
#include "ShapeFix_FixSmallFace.hxx"
|
||||
#include "Partition_Spliter.hxx"
|
||||
|
||||
-
|
||||
namespace netgen
|
||||
{
|
||||
- void OCCGeometry :: PrintNrShapes ()
|
||||
+ // free data used to optimize Project() and FastProject()
|
||||
+ OCCGeometry::~OCCGeometry()
|
||||
+ {
|
||||
+ NCollection_DataMap<int,BRepTopAdaptor_FClass2d*>::Iterator it(fclsmap);
|
||||
+ for (; it.More(); it.Next())
|
||||
+ delete it.Value();
|
||||
+ }
|
||||
+
|
||||
+ void OCCGeometry :: PrintNrShapes ()
|
||||
{
|
||||
TopExp_Explorer e;
|
||||
int count = 0;
|
||||
@@ -951,25 +960,58 @@
|
||||
}
|
||||
|
||||
|
||||
+ // returns a projector and a classifier for the given surface
|
||||
+ void OCCGeometry::GetFaceTools(int surfi, Handle(ShapeAnalysis_Surface)& proj,
|
||||
+ BRepTopAdaptor_FClass2d*& cls) const
|
||||
+ {
|
||||
+ //MSV: organize caching projector in the map
|
||||
+ if (fprjmap.IsBound(surfi))
|
||||
+ {
|
||||
+ proj = fprjmap.Find(surfi);
|
||||
+ cls = fclsmap.Find(surfi);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ const TopoDS_Face& aFace = TopoDS::Face(fmap(surfi));
|
||||
+ Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
|
||||
+ proj = new ShapeAnalysis_Surface(aSurf);
|
||||
+ fprjmap.Bind(surfi, proj);
|
||||
+ cls = new BRepTopAdaptor_FClass2d(aFace,Precision::Confusion());
|
||||
+ fclsmap.Bind(surfi, cls);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
-
|
||||
- void OCCGeometry :: Project (int surfi, Point<3> & p) const
|
||||
+ // void OCCGeometry :: Project (int surfi, Point<3> & p) const
|
||||
+ bool OCCGeometry :: Project (int surfi, Point<3> & p, double& u, double& v) const
|
||||
{
|
||||
static int cnt = 0;
|
||||
if (++cnt % 1000 == 0) cout << "Project cnt = " << cnt << endl;
|
||||
|
||||
gp_Pnt pnt(p(0), p(1), p(2));
|
||||
|
||||
- double u,v;
|
||||
- Handle( Geom_Surface ) thesurf = BRep_Tool::Surface(TopoDS::Face(fmap(surfi)));
|
||||
- Handle( ShapeAnalysis_Surface ) su = new ShapeAnalysis_Surface( thesurf );
|
||||
- gp_Pnt2d suval = su->ValueOfUV ( pnt, BRep_Tool::Tolerance( TopoDS::Face(fmap(surfi)) ) );
|
||||
- suval.Coord( u, v);
|
||||
- pnt = thesurf->Value( u, v );
|
||||
-
|
||||
-
|
||||
+ // -- Optimization: use cached projector and classifier
|
||||
+ // double u,v;
|
||||
+ // Handle( Geom_Surface ) thesurf = BRep_Tool::Surface(TopoDS::Face(fmap(surfi)));
|
||||
+ // Handle( ShapeAnalysis_Surface ) su = new ShapeAnalysis_Surface( thesurf );
|
||||
+ // gp_Pnt2d suval = su->ValueOfUV ( pnt, BRep_Tool::Tolerance( TopoDS::Face(fmap(surfi)) ) );
|
||||
+ // suval.Coord( u, v);
|
||||
+ // pnt = thesurf->Value( u, v );
|
||||
+
|
||||
+ Handle(ShapeAnalysis_Surface) proj;
|
||||
+ BRepTopAdaptor_FClass2d *cls;
|
||||
+ GetFaceTools(surfi, proj, cls);
|
||||
+
|
||||
+ gp_Pnt2d p2d = proj->ValueOfUV(pnt, Precision::Confusion());
|
||||
+ if (cls->Perform(p2d) == TopAbs_OUT)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ pnt = proj->Value(p2d);
|
||||
+ p2d.Coord(u, v);
|
||||
+
|
||||
p = Point<3> (pnt.X(), pnt.Y(), pnt.Z());
|
||||
|
||||
+ return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -979,54 +1021,69 @@
|
||||
{
|
||||
gp_Pnt p(ap(0), ap(1), ap(2));
|
||||
|
||||
- Handle(Geom_Surface) surface = BRep_Tool::Surface(TopoDS::Face(fmap(surfi)));
|
||||
-
|
||||
- gp_Pnt x = surface->Value (u,v);
|
||||
-
|
||||
- if (p.SquareDistance(x) <= sqr(PROJECTION_TOLERANCE)) return true;
|
||||
-
|
||||
- gp_Vec du, dv;
|
||||
-
|
||||
- surface->D1(u,v,x,du,dv);
|
||||
-
|
||||
- int count = 0;
|
||||
-
|
||||
- gp_Pnt xold;
|
||||
- gp_Vec n;
|
||||
- double det, lambda, mu;
|
||||
-
|
||||
- do {
|
||||
- count++;
|
||||
-
|
||||
- n = du^dv;
|
||||
-
|
||||
- det = Det3 (n.X(), du.X(), dv.X(),
|
||||
- n.Y(), du.Y(), dv.Y(),
|
||||
- n.Z(), du.Z(), dv.Z());
|
||||
-
|
||||
- if (det < 1e-15) return false;
|
||||
-
|
||||
- lambda = Det3 (n.X(), p.X()-x.X(), dv.X(),
|
||||
- n.Y(), p.Y()-x.Y(), dv.Y(),
|
||||
- n.Z(), p.Z()-x.Z(), dv.Z())/det;
|
||||
-
|
||||
- mu = Det3 (n.X(), du.X(), p.X()-x.X(),
|
||||
- n.Y(), du.Y(), p.Y()-x.Y(),
|
||||
- n.Z(), du.Z(), p.Z()-x.Z())/det;
|
||||
-
|
||||
- u += lambda;
|
||||
- v += mu;
|
||||
-
|
||||
- xold = x;
|
||||
- surface->D1(u,v,x,du,dv);
|
||||
-
|
||||
- } while (xold.SquareDistance(x) > sqr(PROJECTION_TOLERANCE) && count < 50);
|
||||
-
|
||||
- // (*testout) << "FastProject count: " << count << endl;
|
||||
-
|
||||
- if (count == 50) return false;
|
||||
-
|
||||
- ap = Point<3> (x.X(), x.Y(), x.Z());
|
||||
+ // -- Optimization: use cached projector and classifier
|
||||
+ // Handle(Geom_Surface) surface = BRep_Tool::Surface(TopoDS::Face(fmap(surfi)));
|
||||
+ //
|
||||
+ // gp_Pnt x = surface->Value (u,v);
|
||||
+ //
|
||||
+ // if (p.SquareDistance(x) <= sqr(PROJECTION_TOLERANCE)) return true;
|
||||
+ //
|
||||
+ // gp_Vec du, dv;
|
||||
+ //
|
||||
+ // surface->D1(u,v,x,du,dv);
|
||||
+ //
|
||||
+ // int count = 0;
|
||||
+ //
|
||||
+ // gp_Pnt xold;
|
||||
+ // gp_Vec n;
|
||||
+ // double det, lambda, mu;
|
||||
+ //
|
||||
+ // do {
|
||||
+ // count++;
|
||||
+ //
|
||||
+ // n = du^dv;
|
||||
+ //
|
||||
+ // det = Det3 (n.X(), du.X(), dv.X(),
|
||||
+ // n.Y(), du.Y(), dv.Y(),
|
||||
+ // n.Z(), du.Z(), dv.Z());
|
||||
+ //
|
||||
+ // if (det < 1e-15) return false;
|
||||
+ //
|
||||
+ // lambda = Det3 (n.X(), p.X()-x.X(), dv.X(),
|
||||
+ // n.Y(), p.Y()-x.Y(), dv.Y(),
|
||||
+ // n.Z(), p.Z()-x.Z(), dv.Z())/det;
|
||||
+ //
|
||||
+ // mu = Det3 (n.X(), du.X(), p.X()-x.X(),
|
||||
+ // n.Y(), du.Y(), p.Y()-x.Y(),
|
||||
+ // n.Z(), du.Z(), p.Z()-x.Z())/det;
|
||||
+ //
|
||||
+ // u += lambda;
|
||||
+ // v += mu;
|
||||
+ //
|
||||
+ // xold = x;
|
||||
+ // surface->D1(u,v,x,du,dv);
|
||||
+ //
|
||||
+ // } while (xold.SquareDistance(x) > sqr(PROJECTION_TOLERANCE) && count < 50);
|
||||
+ //
|
||||
+ // // (*testout) << "FastProject count: " << count << endl;
|
||||
+ //
|
||||
+ // if (count == 50) return false;
|
||||
+ //
|
||||
+ // ap = Point<3> (x.X(), x.Y(), x.Z());
|
||||
+ Handle(ShapeAnalysis_Surface) proj;
|
||||
+ BRepTopAdaptor_FClass2d *cls;
|
||||
+ GetFaceTools(surfi, proj, cls);
|
||||
+
|
||||
+ gp_Pnt2d p2d = proj->NextValueOfUV(gp_Pnt2d(u,v), p, Precision::Confusion());
|
||||
+ if (cls->Perform(p2d) == TopAbs_OUT)
|
||||
+ {
|
||||
+ //cout << "Projection fails" << endl;
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ p = proj->Value(p2d);
|
||||
+ p2d.Coord(u, v);
|
||||
+ ap = Point<3> (p.X(), p.Y(), p.Z());
|
||||
|
||||
return true;
|
||||
}
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/occ/occgeom.hpp netgen-5.0.0.patched/libsrc/occ/occgeom.hpp
|
||||
--- netgen-5.0.0.orig/libsrc/occ/occgeom.hpp 2012-11-09 19:15:02.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/occ/occgeom.hpp 2013-02-21 17:46:13.000000000 +0400
|
||||
@@ -15,8 +15,8 @@
|
||||
#include "Geom_Curve.hxx"
|
||||
#include "Geom2d_Curve.hxx"
|
||||
#include "Geom_Surface.hxx"
|
||||
-#include "GeomAPI_ProjectPointOnSurf.hxx"
|
||||
-#include "GeomAPI_ProjectPointOnCurve.hxx"
|
||||
+// #include "GeomAPI_ProjectPointOnSurf.hxx"
|
||||
+// #include "GeomAPI_ProjectPointOnCurve.hxx"
|
||||
#include "BRepTools.hxx"
|
||||
#include "TopExp.hxx"
|
||||
#include "BRepBuilderAPI_MakeVertex.hxx"
|
||||
@@ -42,8 +42,8 @@
|
||||
#include "Geom_Curve.hxx"
|
||||
#include "Geom2d_Curve.hxx"
|
||||
#include "Geom_Surface.hxx"
|
||||
-#include "GeomAPI_ProjectPointOnSurf.hxx"
|
||||
-#include "GeomAPI_ProjectPointOnCurve.hxx"
|
||||
+// #include "GeomAPI_ProjectPointOnSurf.hxx"
|
||||
+// #include "GeomAPI_ProjectPointOnCurve.hxx"
|
||||
#include "TopoDS_Wire.hxx"
|
||||
#include "BRepTools_WireExplorer.hxx"
|
||||
#include "BRepTools.hxx"
|
||||
@@ -68,7 +68,7 @@
|
||||
#include "IGESToBRep_Reader.hxx"
|
||||
#include "Interface_Static.hxx"
|
||||
#include "GeomAPI_ExtremaCurveCurve.hxx"
|
||||
-#include "Standard_ErrorHandler.hxx"
|
||||
+//#include "Standard_ErrorHandler.hxx"
|
||||
#include "Standard_Failure.hxx"
|
||||
#include "ShapeUpgrade_ShellSewing.hxx"
|
||||
#include "ShapeFix_Shape.hxx"
|
||||
@@ -80,6 +80,10 @@
|
||||
#include "ShapeAnalysis.hxx"
|
||||
#include "ShapeBuild_ReShape.hxx"
|
||||
|
||||
+// -- Optimization: to use cached projector and classifier
|
||||
+#include <NCollection_DataMap.hxx>
|
||||
+class Handle_ShapeAnalysis_Surface;
|
||||
+class BRepTopAdaptor_FClass2d;
|
||||
|
||||
// Philippose - 29/01/2009
|
||||
// OpenCascade XDE Support
|
||||
@@ -192,6 +196,9 @@
|
||||
class OCCGeometry : public NetgenGeometry
|
||||
{
|
||||
Point<3> center;
|
||||
+ // -- Optimization: to use cached projector and classifier
|
||||
+ mutable NCollection_DataMap<int,Handle_ShapeAnalysis_Surface> fprjmap;
|
||||
+ mutable NCollection_DataMap<int,BRepTopAdaptor_FClass2d*> fclsmap;
|
||||
|
||||
public:
|
||||
TopoDS_Shape shape;
|
||||
@@ -247,6 +254,8 @@
|
||||
virtual void Save (string filename) const;
|
||||
|
||||
|
||||
+ ~OCCGeometry(); // -- to free cached projector and classifier
|
||||
+
|
||||
void BuildFMap();
|
||||
|
||||
Box<3> GetBoundingBox()
|
||||
@@ -266,9 +275,14 @@
|
||||
Point<3> Center()
|
||||
{ return center;}
|
||||
|
||||
- void Project (int surfi, Point<3> & p) const;
|
||||
+ // void Project (int surfi, Point<3> & p) const; -- optimization
|
||||
+ bool Project (int surfi, Point<3> & p, double& u, double& v) const;
|
||||
bool FastProject (int surfi, Point<3> & ap, double& u, double& v) const;
|
||||
|
||||
+ // -- Optimization: to use cached projector and classifier
|
||||
+ void GetFaceTools(int surfi, Handle(ShapeAnalysis_Surface)& proj,
|
||||
+ BRepTopAdaptor_FClass2d*& cls) const;
|
||||
+
|
||||
OCCSurface GetSurface (int surfi)
|
||||
{
|
||||
cout << "OCCGeometry::GetSurface using PLANESPACE" << endl;
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/occ/occmeshsurf.cpp netgen-5.0.0.patched/libsrc/occ/occmeshsurf.cpp
|
||||
--- netgen-5.0.0.orig/libsrc/occ/occmeshsurf.cpp 2012-11-09 19:15:02.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/occ/occmeshsurf.cpp 2013-02-25 13:27:49.000000000 +0400
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <meshing.hpp>
|
||||
#include <GeomLProp_SLProps.hxx>
|
||||
#include <ShapeAnalysis_Surface.hxx>
|
||||
+#include <GeomAPI_ProjectPointOnCurve.hxx> // -- moved here from occgeom.hpp
|
||||
|
||||
|
||||
namespace netgen
|
||||
@@ -434,23 +435,33 @@
|
||||
|
||||
void MeshOptimize2dOCCSurfaces :: ProjectPoint (INDEX surfind, Point<3> & p) const
|
||||
{
|
||||
- geometry.Project (surfind, p);
|
||||
+ // geometry.Project (surfind, p); -- signature of Project() changed for optimization
|
||||
+ double u, v;
|
||||
+ geometry.Project (surfind, p, u, v);
|
||||
}
|
||||
|
||||
|
||||
int MeshOptimize2dOCCSurfaces :: ProjectPointGI (INDEX surfind, Point<3> & p, PointGeomInfo & gi) const
|
||||
{
|
||||
- double u = gi.u;
|
||||
- double v = gi.v;
|
||||
+ //double u = gi.u;
|
||||
+ //double v = gi.v;
|
||||
|
||||
Point<3> hp = p;
|
||||
- if (geometry.FastProject (surfind, hp, u, v))
|
||||
- {
|
||||
- p = hp;
|
||||
- return 1;
|
||||
- }
|
||||
- ProjectPoint (surfind, p);
|
||||
- return CalcPointGeomInfo (surfind, gi, p);
|
||||
+ // -- u and v are computed by FastProject() and Project(), no need to call CalcPointGeomInfo()
|
||||
+ // if (geometry.FastProject (surfind, hp, u, v))
|
||||
+ // {
|
||||
+ // p = hp;
|
||||
+ // return 1;
|
||||
+ // }
|
||||
+ // ProjectPoint (surfind, p);
|
||||
+ // return CalcPointGeomInfo (surfind, gi, p);
|
||||
+ bool ok;
|
||||
+ if (gi.trignum > 0)
|
||||
+ ok = geometry.FastProject (surfind, hp, gi.u, gi.v);
|
||||
+ else
|
||||
+ ok = geometry.Project (surfind, hp, gi.u, gi.v);
|
||||
+ p = hp;
|
||||
+ return ok;
|
||||
}
|
||||
|
||||
|
||||
@@ -680,7 +691,8 @@
|
||||
if (!geometry.FastProject (surfi, hnewp, u, v))
|
||||
{
|
||||
// cout << "Fast projection to surface fails! Using OCC projection" << endl;
|
||||
- geometry.Project (surfi, hnewp);
|
||||
+ // geometry.Project (surfi, hnewp); -- Project() changed for optimization
|
||||
+ geometry.Project (surfi, hnewp, u, v);
|
||||
}
|
||||
|
||||
newgi.trignum = 1;
|
||||
@@ -689,7 +701,7 @@
|
||||
}
|
||||
|
||||
newp = hnewp;
|
||||
- }
|
||||
+ }//; -- to compile with -Wall -pedantic
|
||||
|
||||
|
||||
void OCCRefinementSurfaces ::
|
||||
@@ -708,14 +720,18 @@
|
||||
hnewp = Point<3> (pnt.X(), pnt.Y(), pnt.Z());
|
||||
newp = hnewp;
|
||||
newgi = ap1;
|
||||
- };
|
||||
+ }
|
||||
|
||||
|
||||
void OCCRefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi) const
|
||||
{
|
||||
if (surfi > 0)
|
||||
- geometry.Project (surfi, p);
|
||||
- };
|
||||
+ // geometry.Project (surfi, p); -- Project() changed for optimization
|
||||
+ {
|
||||
+ double u, v;
|
||||
+ geometry.Project (surfi, p, u, v);
|
||||
+ }
|
||||
+ }//; -- to compile with -Wall -pedantic
|
||||
|
||||
void OCCRefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi) const
|
||||
{
|
||||
@@ -723,9 +739,10 @@
|
||||
if (!geometry.FastProject (surfi, p, gi.u, gi.v))
|
||||
{
|
||||
cout << "Fast projection to surface fails! Using OCC projection" << endl;
|
||||
- geometry.Project (surfi, p);
|
||||
+ double u, v;
|
||||
+ geometry.Project (surfi, p, u, v);
|
||||
}
|
||||
- };
|
||||
+ }
|
||||
|
||||
|
||||
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/occ/utilities.h netgen-5.0.0.patched/libsrc/occ/utilities.h
|
||||
--- netgen-5.0.0.orig/libsrc/occ/utilities.h 2012-11-09 19:15:02.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/occ/utilities.h 2013-02-21 17:47:08.000000000 +0400
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
+#include <iomanip>
|
||||
#include <cstdlib>
|
||||
// #include "SALOME_Log.hxx"
|
||||
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/libsrc/stlgeom/stlgeommesh.cpp netgen-5.0.0.patched/libsrc/stlgeom/stlgeommesh.cpp
|
||||
--- netgen-5.0.0.orig/libsrc/stlgeom/stlgeommesh.cpp 2012-11-09 19:15:04.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/libsrc/stlgeom/stlgeommesh.cpp 2013-02-21 17:52:07.000000000 +0400
|
||||
@@ -1435,7 +1435,8 @@
|
||||
/*
|
||||
if (!optstring || strlen(optstring) == 0)
|
||||
{
|
||||
- mparam.optimize2d = "smcm";
|
||||
+ //mparam.optimize2d = (char*)"smcm";
|
||||
+ mparam.optimize2d = (char*)"smcm";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1453,7 +1454,7 @@
|
||||
mesh -> LoadLocalMeshSize (mparam.meshsizefilename);
|
||||
mesh -> CalcLocalHFromSurfaceCurvature (mparam.grading,
|
||||
stlparam.resthsurfmeshcurvfac);
|
||||
- mparam.optimize2d = "cmsmSm";
|
||||
+ mparam.optimize2d = "(char*)cmsmSm";
|
||||
STLSurfaceOptimization (*stlgeometry, *mesh, mparam);
|
||||
#ifdef STAT_STREAM
|
||||
(*statout) << GetTime() << " & ";
|
||||
@@ -1560,7 +1561,8 @@
|
||||
/*
|
||||
if (!optstring || strlen(optstring) == 0)
|
||||
{
|
||||
- mparam.optimize3d = "cmdmstm";
|
||||
+ //mparam.optimize3d = "cmdmstm";
|
||||
+ mparam.optimize3d = (char*)"cmdmstm";
|
||||
}
|
||||
else
|
||||
{
|
||||
diff -Naur --exclude=CVS netgen-5.0.0.orig/nglib/nglib.h netgen-5.0.0.patched/nglib/nglib.h
|
||||
--- netgen-5.0.0.orig/nglib/nglib.h 2012-11-09 19:15:00.000000000 +0400
|
||||
+++ netgen-5.0.0.patched/nglib/nglib.h 2013-02-21 17:47:08.000000000 +0400
|
||||
@@ -24,7 +24,7 @@
|
||||
// Philippose - 14.02.2009
|
||||
// Modifications for creating a DLL in Windows
|
||||
#ifdef WIN32
|
||||
- #ifdef NGLIB_EXPORTS || nglib_EXPORTS
|
||||
+ #if defined NGLIB_EXPORTS || defined nglib_EXPORTS
|
||||
#define DLL_HEADER __declspec(dllexport)
|
||||
#else
|
||||
#define DLL_HEADER __declspec(dllimport)
|
@ -87,11 +87,7 @@ libNETGENEngine_la_CPPFLAGS = \
|
||||
$(BOOST_CPPFLAGS) \
|
||||
-I$(top_builddir)/idl
|
||||
|
||||
if ! NETGEN_NEW
|
||||
libNETGENEngine_la_LDFLAGS = ../NETGEN/libNETGEN.la
|
||||
else
|
||||
libNETGENEngine_la_LDFLAGS = $(NETGEN_LIBS)
|
||||
endif
|
||||
|
||||
libNETGENEngine_la_LDFLAGS += \
|
||||
../../idl/libSalomeIDLNETGENPLUGIN.la \
|
||||
|
@ -70,7 +70,11 @@
|
||||
#include <meshing.hpp>
|
||||
//#include <ngexception.hpp>
|
||||
namespace netgen {
|
||||
#ifdef NETGEN_V5
|
||||
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, MeshingParameters&, int, int);
|
||||
#else
|
||||
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*);
|
||||
#endif
|
||||
//extern void OCCSetLocalMeshSize(OCCGeometry & geom, Mesh & mesh);
|
||||
extern MeshingParameters mparam;
|
||||
extern volatile multithreadt multithread;
|
||||
@ -88,11 +92,7 @@ using namespace std;
|
||||
#define nodeVec_ACCESS(index) ((SMDS_MeshNode*) nodeVec[index])
|
||||
#endif
|
||||
|
||||
#ifdef NETGEN_NEW
|
||||
#define NGPOINT_COORDS(p) p(0),p(1),p(2)
|
||||
#else
|
||||
#define NGPOINT_COORDS(p) p.X(),p.Y(),p.Z()
|
||||
#endif
|
||||
|
||||
// dump elements added to ng mesh
|
||||
//#define DUMP_SEGMENTS
|
||||
@ -522,12 +522,10 @@ void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo,
|
||||
}
|
||||
occgeo.facemeshstatus.SetSize (occgeo.fmap.Extent());
|
||||
occgeo.facemeshstatus = 0;
|
||||
#ifdef NETGEN_NEW
|
||||
occgeo.face_maxh_modified.SetSize(occgeo.fmap.Extent());
|
||||
occgeo.face_maxh_modified = 0;
|
||||
occgeo.face_maxh.SetSize(occgeo.fmap.Extent());
|
||||
occgeo.face_maxh = netgen::mparam.maxh;
|
||||
#endif
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
@ -832,8 +830,8 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom,
|
||||
TopoDS_Shape solid = occgeom.somap( solidID1 );
|
||||
TopAbs_Orientation faceOriInSolid = helper.GetSubShapeOri( solid, geomFace );
|
||||
if ( faceOriInSolid >= 0 )
|
||||
reverse = SMESH_Algo::IsReversedSubMesh
|
||||
( TopoDS::Face( geomFace.Oriented( faceOriInSolid )), helper.GetMeshDS() );
|
||||
reverse =
|
||||
helper.IsReversedSubMesh( TopoDS::Face( geomFace.Oriented( faceOriInSolid )));
|
||||
}
|
||||
|
||||
// Add surface elements
|
||||
@ -1544,6 +1542,7 @@ NETGENPlugin_Mesher::AddSegmentsToMesh(netgen::Mesh& ngMesh,
|
||||
int edgeID = 1, posID = -2;
|
||||
bool isInternalWire = false;
|
||||
double vertexNormPar = 0;
|
||||
const int prevNbNGSeg = ngMesh.GetNSeg();
|
||||
for ( int i = 0; i < nbSegments; ++i ) // loop on segments
|
||||
{
|
||||
// Add the first point of a segment
|
||||
@ -1626,26 +1625,12 @@ NETGENPlugin_Mesher::AddSegmentsToMesh(netgen::Mesh& ngMesh,
|
||||
|
||||
RestrictLocalSize( ngMesh, 0.5*(np1+np2), avgH );
|
||||
}
|
||||
#ifdef DUMP_SEGMENTS
|
||||
cout << "Segment: " << seg.edgenr << endl
|
||||
<< "\tp1: " << seg[0] << endl
|
||||
<< "\tp2: " << seg[1] << endl
|
||||
<< "\tp0 param: " << seg.epgeominfo[ 0 ].dist << endl
|
||||
<< "\tp0 uv: " << seg.epgeominfo[ 0 ].u <<", "<< seg.epgeominfo[ 0 ].v << endl
|
||||
<< "\tp0 edge: " << seg.epgeominfo[ 0 ].edgenr << endl
|
||||
<< "\tp1 param: " << seg.epgeominfo[ 1 ].dist << endl
|
||||
<< "\tp1 uv: " << seg.epgeominfo[ 1 ].u <<", "<< seg.epgeominfo[ 1 ].v << endl
|
||||
<< "\tp1 edge: " << seg.epgeominfo[ 1 ].edgenr << endl;
|
||||
#endif
|
||||
if ( isInternalWire )
|
||||
{
|
||||
swap (seg[0], seg[1]);
|
||||
swap( seg.epgeominfo[0], seg.epgeominfo[1] );
|
||||
seg.edgenr = ngMesh.GetNSeg() + 1; // segment id
|
||||
ngMesh.AddSegment (seg);
|
||||
#ifdef DUMP_SEGMENTS
|
||||
cout << "Segment: " << seg.edgenr << endl << "\tis REVRESE of the previous one" << endl;
|
||||
#endif
|
||||
}
|
||||
} // loop on segments on a wire
|
||||
|
||||
@ -1668,6 +1653,32 @@ NETGENPlugin_Mesher::AddSegmentsToMesh(netgen::Mesh& ngMesh,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DUMP_SEGMENTS
|
||||
cout << "BEGIN WIRE " << iW << endl;
|
||||
for ( int i = prevNbNGSeg+1; i <= ngMesh.GetNSeg(); ++i )
|
||||
{
|
||||
netgen::Segment& seg = ngMesh.LineSegment( i );
|
||||
if ( i > 1 ) {
|
||||
netgen::Segment& prevSeg = ngMesh.LineSegment( i-1 );
|
||||
if ( seg[0] == prevSeg[1] && seg[1] == prevSeg[0] )
|
||||
{
|
||||
cout << "Segment: " << seg.edgenr << endl << "\tis REVRESE of the previous one" << endl;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
cout << "Segment: " << seg.edgenr << endl
|
||||
<< "\tp1: " << seg[0] << endl
|
||||
<< "\tp2: " << seg[1] << endl
|
||||
<< "\tp0 param: " << seg.epgeominfo[ 0 ].dist << endl
|
||||
<< "\tp0 uv: " << seg.epgeominfo[ 0 ].u <<", "<< seg.epgeominfo[ 0 ].v << endl
|
||||
<< "\tp0 edge: " << seg.epgeominfo[ 0 ].edgenr << endl
|
||||
<< "\tp1 param: " << seg.epgeominfo[ 1 ].dist << endl
|
||||
<< "\tp1 uv: " << seg.epgeominfo[ 1 ].u <<", "<< seg.epgeominfo[ 1 ].v << endl
|
||||
<< "\tp1 edge: " << seg.epgeominfo[ 1 ].edgenr << endl;
|
||||
}
|
||||
cout << "--END WIRE " << iW << endl;
|
||||
#endif
|
||||
|
||||
} // loop on WIREs of a FACE
|
||||
|
||||
// add a segment instead of an internal vertex
|
||||
@ -1752,11 +1763,7 @@ int NETGENPlugin_Mesher::FillSMesh(const netgen::OCCGeometry& occgeo,
|
||||
{
|
||||
const netgen::Segment& seg = ngMesh.LineSegment(i);
|
||||
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 };
|
||||
#endif
|
||||
int nbp = 0;
|
||||
double param2 = 0;
|
||||
for (int j=0; j < 3; ++j)
|
||||
@ -2105,19 +2112,23 @@ bool NETGENPlugin_Mesher::Compute()
|
||||
if ( _simpleHyp || ( mparams.minh == 0.0 && _fineness != NETGENPlugin_Hypothesis::UserDefined))
|
||||
mparams.minh = GetDefaultMinSize( _shape, mparams.maxh );
|
||||
|
||||
#ifdef NETGEN_NEW
|
||||
// Local size on faces
|
||||
occgeo.face_maxh = mparams.maxh;
|
||||
#endif
|
||||
|
||||
// Let netgen create ngMesh and calculate element size on not meshed shapes
|
||||
#ifndef NETGEN_V5
|
||||
char *optstr = 0;
|
||||
#endif
|
||||
int startWith = netgen::MESHCONST_ANALYSE;
|
||||
int endWith = netgen::MESHCONST_ANALYSE;
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS;
|
||||
#ifdef NETGEN_V5
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, mparams, startWith, endWith);
|
||||
#else
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
|
||||
#endif
|
||||
#ifdef WITH_SMESH_CANCEL_COMPUTE
|
||||
if(netgen::multithread.terminate)
|
||||
return false;
|
||||
@ -2192,10 +2203,8 @@ bool NETGENPlugin_Mesher::Compute()
|
||||
internals.getInternalEdges( intOccgeo.fmap, intOccgeo.emap, intOccgeo.vmap, meshedSM );
|
||||
intOccgeo.boundingbox = occgeo.boundingbox;
|
||||
intOccgeo.shape = occgeo.shape;
|
||||
#ifdef NETGEN_NEW
|
||||
intOccgeo.face_maxh.SetSize(intOccgeo.fmap.Extent());
|
||||
intOccgeo.face_maxh = netgen::mparam.maxh;
|
||||
#endif
|
||||
netgen::Mesh *tmpNgMesh = NULL;
|
||||
try
|
||||
{
|
||||
@ -2204,7 +2213,11 @@ bool NETGENPlugin_Mesher::Compute()
|
||||
//OCCSetLocalMeshSize(intOccgeo, *ngMesh); it deletes ngMesh->localH
|
||||
|
||||
// let netgen create a temporary mesh
|
||||
#ifdef NETGEN_V5
|
||||
netgen::OCCGenerateMesh(intOccgeo, tmpNgMesh, mparams, startWith, endWith);
|
||||
#else
|
||||
netgen::OCCGenerateMesh(intOccgeo, tmpNgMesh, startWith, endWith, optstr);
|
||||
#endif
|
||||
#ifdef WITH_SMESH_CANCEL_COMPUTE
|
||||
if(netgen::multithread.terminate)
|
||||
return false;
|
||||
@ -2214,7 +2227,11 @@ bool NETGENPlugin_Mesher::Compute()
|
||||
|
||||
// compute mesh on internal edges
|
||||
startWith = endWith = netgen::MESHCONST_MESHEDGES;
|
||||
#ifdef NETGEN_V5
|
||||
err = netgen::OCCGenerateMesh(intOccgeo, tmpNgMesh, mparams, startWith, endWith);
|
||||
#else
|
||||
err = netgen::OCCGenerateMesh(intOccgeo, tmpNgMesh, startWith, endWith, optstr);
|
||||
#endif
|
||||
comment << text(err);
|
||||
}
|
||||
catch (Standard_Failure& ex)
|
||||
@ -2247,7 +2264,11 @@ bool NETGENPlugin_Mesher::Compute()
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS;
|
||||
#ifdef NETGEN_V5
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, mparams, startWith, endWith);
|
||||
#else
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
|
||||
#endif
|
||||
#ifdef WITH_SMESH_CANCEL_COMPUTE
|
||||
if(netgen::multithread.terminate)
|
||||
return false;
|
||||
@ -2351,7 +2372,11 @@ bool NETGENPlugin_Mesher::Compute()
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS;
|
||||
#ifdef NETGEN_V5
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, mparams, startWith, endWith);
|
||||
#else
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
|
||||
#endif
|
||||
#ifdef WITH_SMESH_CANCEL_COMPUTE
|
||||
if(netgen::multithread.terminate)
|
||||
return false;
|
||||
@ -2422,7 +2447,11 @@ bool NETGENPlugin_Mesher::Compute()
|
||||
}
|
||||
ngMesh->SetGlobalH (mparams.maxh);
|
||||
mparams.grading = 0.4;
|
||||
#ifdef NETGEN_V5
|
||||
ngMesh->CalcLocalH(mparams.grading);
|
||||
#else
|
||||
ngMesh->CalcLocalH();
|
||||
#endif
|
||||
}
|
||||
// Care of vertices internal in solids and internal faces (issue 0020676)
|
||||
if ( internals.hasInternalVertexInSolid() || internals.hasInternalFaces() )
|
||||
@ -2441,7 +2470,11 @@ bool NETGENPlugin_Mesher::Compute()
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS;
|
||||
#ifdef NETGEN_V5
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, mparams, startWith, endWith);
|
||||
#else
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
|
||||
#endif
|
||||
#ifdef WITH_SMESH_CANCEL_COMPUTE
|
||||
if(netgen::multithread.terminate)
|
||||
return false;
|
||||
@ -2468,7 +2501,11 @@ bool NETGENPlugin_Mesher::Compute()
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS;
|
||||
#ifdef NETGEN_V5
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, mparams, startWith, endWith);
|
||||
#else
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
|
||||
#endif
|
||||
#ifdef WITH_SMESH_CANCEL_COMPUTE
|
||||
if(netgen::multithread.terminate)
|
||||
return false;
|
||||
@ -2639,10 +2676,16 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
|
||||
// let netgen create ngMesh and calculate element size on not meshed shapes
|
||||
NETGENPlugin_NetgenLibWrapper ngLib;
|
||||
netgen::Mesh *ngMesh = NULL;
|
||||
#ifndef NETGEN_V5
|
||||
char *optstr = 0;
|
||||
#endif
|
||||
int startWith = netgen::MESHCONST_ANALYSE;
|
||||
int endWith = netgen::MESHCONST_MESHEDGES;
|
||||
#ifdef NETGEN_V5
|
||||
int err = netgen::OCCGenerateMesh(occgeo, ngMesh, mparams, startWith, endWith);
|
||||
#else
|
||||
int err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
|
||||
#endif
|
||||
#ifdef WITH_SMESH_CANCEL_COMPUTE
|
||||
if(netgen::multithread.terminate)
|
||||
return false;
|
||||
@ -3034,7 +3077,11 @@ void NETGENPlugin_ngMeshInfo::transferLocalH( netgen::Mesh* fromMesh,
|
||||
{
|
||||
if ( !fromMesh->LocalHFunctionGenerated() ) return;
|
||||
if ( !toMesh->LocalHFunctionGenerated() )
|
||||
#ifdef NETGEN_V5
|
||||
toMesh->CalcLocalH(netgen::mparam.grading);
|
||||
#else
|
||||
toMesh->CalcLocalH();
|
||||
#endif
|
||||
|
||||
const size_t size = sizeof( netgen::LocalH );
|
||||
_copyOfLocalH = new char[ size ];
|
||||
|
@ -63,7 +63,11 @@ namespace nglib {
|
||||
#include <meshing.hpp>
|
||||
//#include <meshtype.hpp>
|
||||
namespace netgen {
|
||||
#ifdef NETGEN_V5
|
||||
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, MeshingParameters&, int, int);
|
||||
#else
|
||||
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*);
|
||||
#endif
|
||||
extern MeshingParameters mparam;
|
||||
}
|
||||
|
||||
@ -251,9 +255,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
|
||||
netgen::mparam.quad = _hypQuadranglePreference ? 1 : 0;
|
||||
netgen::mparam.grading = 0.7; // very coarse mesh by default
|
||||
}
|
||||
#ifdef NETGEN_NEW
|
||||
occgeo.face_maxh = netgen::mparam.maxh;
|
||||
#endif
|
||||
|
||||
// -------------------------
|
||||
// Make input netgen mesh
|
||||
@ -276,7 +278,9 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
|
||||
// Generate surface mesh
|
||||
// -------------------------
|
||||
|
||||
#ifndef NETGEN_V5
|
||||
char *optstr = 0;
|
||||
#endif
|
||||
int startWith = MESHCONST_MESHSURFACE;
|
||||
int endWith = MESHCONST_OPTSURFACE;
|
||||
int err = 1;
|
||||
@ -285,7 +289,11 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
|
||||
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
||||
OCC_CATCH_SIGNALS;
|
||||
#endif
|
||||
#ifdef NETGEN_V5
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, netgen::mparam, startWith, endWith);
|
||||
#else
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
|
||||
#endif
|
||||
#ifdef WITH_SMESH_CANCEL_COMPUTE
|
||||
if(netgen::multithread.terminate)
|
||||
return false;
|
||||
@ -322,11 +330,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
|
||||
for ( int ngID = nbInputNodes + 1; ngID <= nbNodes; ++ngID )
|
||||
{
|
||||
const MeshPoint& ngPoint = ngMesh->Point( ngID );
|
||||
#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());
|
||||
#endif
|
||||
nodeVec[ ngID ] = node;
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,11 @@ namespace nglib {
|
||||
#include <nglib.h>
|
||||
}
|
||||
namespace netgen {
|
||||
#ifdef NETGEN_V5
|
||||
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, MeshingParameters&, int, int);
|
||||
#else
|
||||
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*);
|
||||
#endif
|
||||
extern MeshingParameters mparam;
|
||||
extern volatile multithreadt multithread;
|
||||
}
|
||||
@ -247,7 +251,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
|
||||
helper.NbAncestors(aShapeFace, aMesh, aShape.ShapeType()) > 1 )
|
||||
// IsReversedSubMesh() can work wrong on strongly curved faces,
|
||||
// so we use it as less as possible
|
||||
isRev = SMESH_Algo::IsReversedSubMesh( TopoDS::Face(aShapeFace), meshDS );
|
||||
isRev = helper.IsReversedSubMesh( TopoDS::Face( aShapeFace ));
|
||||
|
||||
const SMESHDS_SubMesh * aSubMeshDSFace = proxyMesh->GetSubMesh( aShapeFace );
|
||||
if ( !aSubMeshDSFace ) continue;
|
||||
@ -345,7 +349,9 @@ bool NETGENPlugin_NETGEN_3D::compute(SMESH_Mesh& aMesh,
|
||||
netgen::Mesh* ngMesh = (netgen::Mesh*)Netgen_mesh;
|
||||
int Netgen_NbOfNodes = Ng_GetNP(Netgen_mesh);
|
||||
|
||||
#ifndef NETGEN_V5
|
||||
char *optstr = 0;
|
||||
#endif
|
||||
int startWith = netgen::MESHCONST_MESHVOLUME;
|
||||
int endWith = netgen::MESHCONST_OPTVOLUME;
|
||||
int err = 1;
|
||||
@ -385,8 +391,13 @@ bool NETGENPlugin_NETGEN_3D::compute(SMESH_Mesh& aMesh,
|
||||
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
||||
OCC_CATCH_SIGNALS;
|
||||
#endif
|
||||
#ifdef NETGEN_V5
|
||||
ngMesh->CalcLocalH(netgen::mparam.grading);
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, netgen::mparam, startWith, endWith);
|
||||
#else
|
||||
ngMesh->CalcLocalH();
|
||||
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
|
||||
#endif
|
||||
#ifdef WITH_SMESH_CANCEL_COMPUTE
|
||||
if(netgen::multithread.terminate)
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user