Compare commits

...

69 Commits

Author SHA1 Message Date
vsr
b5affa1f00 Patch from Erwan ADAM : Windows compatibility 2010-06-04 09:00:53 +00:00
vsr
df20adf4f9 Patch from Erwan ADAM : fix bugs in DumpPython for NETGEN plugin when local size feature is used 2010-06-04 06:46:25 +00:00
vsr
b5ae22d7e5 Patch from Erwan ADAM 2010-05-31 07:17:13 +00:00
dmv
4c55702cb4 0020864: EDF 1409 SMESH: Suppression of algorithms causes Salome to crash
Additional minor changes: fix problems with Object browser icons
2010-05-18 11:11:46 +00:00
adam
a02233c245 Local sizes implementation 2010-05-17 07:32:12 +00:00
eap
4576a39f36 0020682: EDF 1222 SMESH: 3D mesh from a skin mesh and with volumic cells
* Restore the lost fix:

       if(faces==0)
-        return error( COMPERR_BAD_INPUT_MESH,
-                      SMESH_Comment("No triangles in adaptor for element ")<<elem->GetID());
+        continue; // Issue 0020682. There already can be 3d mesh
2010-04-28 09:19:46 +00:00
eap
ba906fcdb5 0020850: EDF 1330 NETGENPLUGIN: Netgen cannot mesh a face partitionned with 3 edges
* take into account that same internal vertex can be twice in a face
2010-04-28 07:35:15 +00:00
adam
066c4c8dca *** empty log message *** 2010-04-22 12:37:25 +00:00
vsr
3cfbb746f0 Update copyright notes (for 2010) 2010-04-22 06:24:16 +00:00
inv
72e4c18271 Changing version to 5.1.4 2010-04-19 10:47:04 +00:00
san
a0117b464f Issue 0020580: improved validation in integer and double spin boxes, possibility to adjust input field precision through preferences 2010-04-06 06:54:28 +00:00
eap
090ca6925e 0020676: EDF 1212 GEOM: Partition operation creates vertices which causes mesh computation to fail with netgen
* Care of nodes on vertices that can be shared between wires
2010-03-30 08:02:25 +00:00
eap
06f9c6fa68 Fix regression on reversed submeshes
-            Netgen_triangle[ isRev ? 3-iN : iN ] = ngID;
+            Netgen_triangle[ isRev ? 2-iN : iN ] = ngID;
2010-03-29 07:36:37 +00:00
eap
290c3c5460 Provide correct error description in case of intersecting triangles 2010-03-26 13:59:27 +00:00
eap
d7b7afc447 -#define DUMP_TRIANGLES_SCRIPT "/tmp/trias.py" //!< debug addIntVerticesInSolids()
+//#define DUMP_TRIANGLES_SCRIPT "/tmp/trias.py" //!< debug addIntVerticesInSolids()
2010-03-25 14:16:34 +00:00
eap
fa5b920e18 0020676: EDF 1212 GEOM: Partition operation creates vertices which causes mesh computation to fail with netgen
* Make NETGEN take into account internal vertices in faces and solids
* Simplify solution for internal faces
2010-03-25 14:15:39 +00:00
eap
1ebad126db 0020676: EDF 1212 GEOM: Partition operation creates vertices which causes mesh computation to fail with netgen
* Solve problem with internal edges and faces
2010-03-18 09:51:47 +00:00
eap
6dbabf8a00 0020776: EDF 1329 NETGENPLUGIN : Create Group from Geometry issue
* Prevent setting a wrong node on vertex in case if there are equal vertices in the shape
2010-03-12 11:56:06 +00:00
eap
1d3a5a5454 0020682: EDF 1222 SMESH: 3D mesh from a skin mesh and with volumic cells
* Redesign to solve pb with internal face (StudyFiss_bugNetgen3D.hdf)
2010-03-12 08:36:16 +00:00
eap
e6e3bb2b55 0020682: EDF 1222 SMESH: 3D mesh from a skin mesh and with volumic cells
* Pb with internal face (StudyFiss_bugNetgen3D.hdf)

+  static SMESH_ComputeErrorPtr readErrors(const std::vector< const SMDS_MeshNode* >& nodeVec);

which is used to show links that lead to "some edges multiple times in surface mesh" error
2010-03-12 08:34:55 +00:00
eap
4d1d960c7b 0020693: EDF 1288 SMESH: Problem to recompute a mesh with a sub-mesh and a conversion linear-quadratic
* Take into account all nodes on edge in case of mixed linear/quadratic mesh
2010-03-09 07:17:04 +00:00
adam
073ab799e6 *** empty log message *** 2010-03-02 15:52:36 +00:00
adam
688d92ed57 windows port. 2010-03-01 16:37:18 +00:00
adam
ce7e0dbb04 *** empty log message *** 2010-03-01 16:36:32 +00:00
eap
b6d4daa757 020700: EDF 1234 SMESH: Quadrangle preference and Netgen
-  if ( _hypMaxElementArea || _hypLengthFromEdges )
+  if ( _hypMaxElementArea || _hypLengthFromEdges || _hypQuadranglePreference)
     aStatus = HYP_OK;
2010-02-18 09:00:21 +00:00
ouv
290e356071 Additional fix for issue 0020692: Duplicate check_*.m4 between modules. 2010-02-11 16:44:17 +00:00
eap
6d27b01928 0020693: EDF 1288 SMESH: Problem to recompute a mesh with a sub-mesh and a conversion linear-quadratic
* Fix check if a face is triangle
2010-02-11 13:52:23 +00:00
eap
42b43269f4 0020676: EDF 1212 GEOM: Partition operation creates vertices which causes mesh computation to fail with netgen
* Redesign in order to precompute internal edges
2010-02-11 08:29:13 +00:00
eap
f8b902ad9a 0020676: EDF 1212 GEOM: Partition operation creates vertices which causes mesh computation to fail with netgen
* Fix for internal edges
2010-02-11 08:28:13 +00:00
eap
388d346ae9 0020682: EDF 1222 SMESH: 3D mesh from a skin mesh and with volumic cells
* Avoid creating nodes and tetras at place where volumic elements already exist
2010-02-09 11:21:29 +00:00
eap
7a9566f1d2 0019296: EDF 681 SMESH - Pre-evaluation of the number of elements before mesh
Let Netgen discretize edges to know nb of segments
2010-01-27 10:07:11 +00:00
eap
fc79403acc untabify 2010-01-26 07:16:30 +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
71 changed files with 3880 additions and 1241 deletions

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001
@ -45,7 +43,7 @@ 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

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPLUGIN_version.h
// Author : Vadim SANDLER
// Module : SALOME

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = unix

View File

@ -0,0 +1,82 @@
# Copyright (C) 2007-2010 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
#
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_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)
IF(NETGEN_NEW)
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)
FIND_LIBRARY(NETGEN_LIB_gprim gprim PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_interface interface 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_occ occ PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
FIND_LIBRARY(NETGEN_LIB_stl stl PATHS ${NETGENHOME}/lib ${NETGENHOME}/lib/LINUX)
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_interface})
SET(NETGEN_LIBS ${NETGEN_LIBS} ${NETGEN_LIB_la})
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)

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = config_files

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
dist_admlocalm4_DATA = \

View File

@ -1,4 +1,4 @@
dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@ -19,6 +19,7 @@ dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
AC_DEFUN([CHECK_NETGEN],[
AC_REQUIRE([AC_PROG_CXX])dnl
@ -35,6 +36,8 @@ AC_ARG_WITH(netgen,
NETGEN_INCLUDES=""
NETGEN_LIBS_DIR=""
NETGEN_LIBS=""
NETGEN_NEW=no
Netgen_ok=no
@ -52,29 +55,29 @@ fi
if test "x$NETGEN_HOME" != "x"; then
echo
echo
echo -------------------------------------------------
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 WARNING
echo ----------------------------------------------------------
echo ----------------------------------------------------------
echo You are strongly advised to consult the file
echo NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers, particularly about
echo assumptions made on the installation of the Netgen
echo NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers, particularly
echo about assumptions made on the installation of the Netgen
echo application and libraries.
echo Ask your system administrator for those details.
echo ----------------------------------------------------------
echo ----------------------------------------------------------
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"
@ -99,6 +102,8 @@ if test "x$NETGEN_HOME" != "x"; then
AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no)
if test "x$Netgen_ok" == "xyes"; then
if test "$NETGEN_NEW" = "no" ; then
AC_MSG_CHECKING(for Netgen libraries)
LDFLAGS_old="$LDFLAGS"
@ -127,22 +132,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,
Netgen_ok=no)
AC_CACHE_VAL(salome_netgen_lib,[
AC_TRY_LINK(
#include <iostream>
#include <fstream>
namespace nglib {
#include "nglib.h"
}
#define OCCGEOMETRY
#include <occgeom.hpp>
,nglib::Ng_Init();
netgen::OCCGeometry occgeo;
nglib::Ng_Exit();,
eval "salome_netgen_lib=yes";rm -rf libNETGEN.so,eval "salome_netgen_lib=no";rm -rf libNETGEN.so)
])
Netgen_ok="$salome_netgen_lib"
AC_CACHE_VAL(salome_cv_netgen_lib,[
AC_TRY_LINK([
#include <iostream>
#include <fstream>
namespace nglib {
#include "nglib.h"
}
#define OCCGEOMETRY
#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"
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"
fi
@ -160,6 +243,8 @@ 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

View File

@ -1,4 +1,4 @@
dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@ -19,6 +19,7 @@ dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
#------------------------------------------------------------
# Check availability of Salome NETGEN mesh plugin module
# distribution

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,15 @@
#
# 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
# Makefile. This file must be included, if needed, by the file

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# -* Makefile *-
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL

27
build_cmake Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
# Copyright (C) 2007-2010 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
#
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

20
build_cmake.bat Normal file
View File

@ -0,0 +1,20 @@
@REM Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
@REM
@REM This library is free software; you can redistribute it and/or
@REM modify it under the terms of the GNU Lesser General Public
@REM License as published by the Free Software Foundation; either
@REM version 2.1 of the License.
@REM
@REM This library is distributed in the hope that it will be useful,
@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@REM Lesser General Public License for more details.
@REM
@REM You should have received a copy of the GNU Lesser General Public
@REM License along with this library; if not, write to the Free Software
@REM Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@REM
@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
@REM
%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --netgenplugin

View File

@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
# Copyright (C) 2007-2010 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
@ -20,6 +20,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# Tool for updating list of .in file for the SALOME project
# and regenerating configure script
# Author : Marc Tajchman - CEA
@ -30,7 +31,6 @@
#
ORIG_DIR=`pwd`
CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
NETGENPLUGIN_WITH_GUI="yes"
########################################################################
# Test if the KERNEL_ROOT_DIR is set correctly
@ -46,27 +46,6 @@ fi
# echo "failed : KERNEL_SRC variable is not correct !"
# exit
#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
@ -96,40 +75,17 @@ cd ${CONF_DIR}
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
# custom macro embedded in the directory salome_adm/unix/config_files
# custom macro embedded in the directory adm_local/unix/config_files
# and KERNEL config_files directory.
# output:
# aclocal.m4
# autom4te.cache (directory)
echo "====================================================== aclocal"
echo "======================================================= aclocal"
if test ${NETGENPLUGIN_WITH_GUI} = yes; then
if test -d "${GUI_ROOT_DIR}"; then
aclocal -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
@ -150,10 +106,10 @@ fi
# version. The files are created in the directory specified with the
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
# output:
# salome_adm/unix/config_files/config.guess
# salome_adm/unix/config_files/config.sub
# salome_adm/unix/config_files/ltmain.sh
#echo "====================================================== libtoolize"
# adm_local/unix/config_files/config.guess
# adm_local/unix/config_files/config.sub
# adm_local/unix/config_files/ltmain.sh
echo "==================================================== libtoolize"
libtoolize --force --copy --automake || exit 1
@ -173,11 +129,11 @@ autoconf
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
# creates the Makefile.in files from the Makefile.am files.
# output:
# salome_adm/unix/config_files/compile
# salome_adm/unix/config_files/depcomp
# salome_adm/unix/config_files/install-sh
# salome_adm/unix/config_files/missing
# salome_adm/unix/config_files/py-compile
# adm_local/unix/config_files/compile
# adm_local/unix/config_files/depcomp
# adm_local/unix/config_files/install-sh
# adm_local/unix/config_files/missing
# adm_local/unix/config_files/py-compile
# Makefile.in (from Makefile.am)
echo "====================================================== automake"

View File

@ -1,8 +1,5 @@
#!/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
# Copyright (C) 2007-2010 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
@ -20,6 +17,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
rm -rf autom4te.cache aclocal.m4 configure make_config
find . -name "*~" -print -exec rm {} \;
find . -name "*.pyc" -print -exec rm {} \;

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# PLEASE DO NOT MODIFY configure.in FILE
# ALL CHANGES WILL BE DISCARDED BY THE NEXT
# build_configure COMMAND
@ -31,11 +29,11 @@
# Reorganization for usage of autotools
# Created from configure.in.base
#
AC_INIT([Salome2 Project NETGENPLUGIN module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeNETGENPLUGIN])
AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
AC_INIT([Salome2 Project NETGENPLUGIN module], [5.1.4], [webmaster.salome@opencascade.com], [SalomeNETGENPLUGIN])
AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AM_INIT_AUTOMAKE([-Wno-portability])
XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
AC_SUBST(XVERSION)
@ -80,6 +78,7 @@ echo
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_LOCAL_INSTALL
dnl
dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
@ -101,7 +100,7 @@ dnl Fix up the INSTALL macro if it s a relative path. We want the
dnl full-path to the binary instead.
case "$INSTALL" in
*install-sh*)
INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh
INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
;;
esac
@ -237,11 +236,34 @@ AC_SUBST_FILE(CORBA)
corba=make_$ORB
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 testing openGL
@ -265,26 +287,6 @@ if test "${NETGENPLUGIN_WITH_GUI}" = "yes"; then
echo
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
echo
@ -357,14 +359,17 @@ echo Summary
echo ---------------------------------------------
echo
AM_CONDITIONAL(CMAKE_BUILD, 0)
#AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
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"
fi
if test "${NETGENPLUGIN_WITH_GUI}" = "no"; then
variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok Netgen_ok"
if test "${gui_ok}" = "yes"; then
variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok gui_ok Geom_ok SMesh_ok Netgen_ok"
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 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
for var in $variables
@ -405,18 +410,17 @@ echo
# autoscan, the Makefile list is generated in the output file configure.scan.
# This could be helpfull to update de configuration.
AC_OUTPUT([ \
./salome_adm/unix/SALOMEconfig.h \
./adm_local/Makefile \
./adm_local/unix/Makefile \
./adm_local/unix/config_files/Makefile \
./bin/VERSION \
./bin/Makefile \
./NETGENPLUGIN_version.h \
./src/Makefile \
./src/GUI/Makefile \
./src/NETGEN/Makefile \
./src/NETGENPlugin/Makefile \
./resources/Makefile \
./idl/Makefile \
adm_local/Makefile \
adm_local/unix/Makefile \
adm_local/unix/config_files/Makefile \
bin/VERSION \
bin/Makefile \
NETGENPLUGIN_version.h \
src/Makefile \
src/GUI/Makefile \
src/NETGEN/Makefile \
src/NETGENPlugin/Makefile \
resources/Makefile \
idl/Makefile \
Makefile \
])

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# This Makefile is responsible of generating the client and server
# implementation of IDL interfaces for both C++ and python usage.
# The building process of the C++ files is in charge of each source
@ -46,7 +44,6 @@ libSalomeIDLNETGENPLUGIN_la_CPPFLAGS = \
$(SMESH_CXXFLAGS) \
@CORBA_CXXFLAGS@ \
@CORBA_INCLUDES@ \
-I$(top_builddir)/salome_adm/unix \
-I$(top_builddir)/idl
libSalomeIDLNETGENPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0
@ -71,8 +68,7 @@ IDLCXXFLAGS = \
-I$(top_builddir)/idl/salome \
-I$(KERNEL_ROOT_DIR)/idl/salome \
-I$(GEOM_ROOT_DIR)/idl/salome \
-I$(SMESH_ROOT_DIR)/idl/salome \
-I$(top_builddir)/salome_adm/unix
-I$(SMESH_ROOT_DIR)/idl/salome
IDLPYFLAGS = \
@IDLPYFLAGS@ \
-I$(KERNEL_ROOT_DIR)/idl/salome \
@ -108,7 +104,7 @@ mostlyclean-local:
@for dep in $^ dummy; do \
if [ $$dep != "dummy" ]; then \
echo Building dependencies for $$dep; \
$(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome -I$(top_builddir)/salome_adm/unix $$dep 2>/dev/null | \
$(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \
sed 's/\.o/\SK.cc/' >>$@; \
fi; \
done ;

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPlugin_Algorithm.idl
// Author : Julia DOROVSKIKH
// $Header$
@ -28,12 +29,14 @@
#include "SALOME_Exception.idl"
#include "SMESH_Hypothesis.idl"
#include "GEOM_Gen.idl"
/*!
* NETGENPlugin: interfaces to NETGEN related hypotheses and algorithms
*/
module NETGENPlugin
{
typedef sequence<string> string_array;
/*!
* NETGENPlugin_NETGEN_3D: interface of "Tetrahedron (Netgen)" algorithm
*/
@ -89,6 +92,12 @@ module NETGENPlugin
void SetNbSegPerRadius(in double value);
double GetNbSegPerRadius();
void SetLocalSizeOnShape(in GEOM::GEOM_Object GeomObj, in double localSize);
void SetLocalSizeOnEntry(in string entry, in double localSize);
double GetLocalSizeOnEntry(in string entry);
string_array GetLocalSizeEntries();
void UnsetLocalSizeOnEntry(in string entry);
};
/*!

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
<!--
Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2007-2010 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

View File

@ -1,5 +1,5 @@
<!--
Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2007-2010 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

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : Makefile.in
# Author : Michael Sazonov
# Modified by : Alexander BORODIN (OCN) - autotools usage
@ -51,6 +49,7 @@ nodist_libNETGENPluginGUI_la_SOURCES= \
# additionnal information to compil and link file
libNETGENPluginGUI_la_CPPFLAGS = \
$(NETGEN_INCLUDES) \
$(QT_INCLUDES) \
$(CAS_CPPFLAGS) \
$(PYTHON_INCLUDES) \
@ -63,12 +62,13 @@ libNETGENPluginGUI_la_CPPFLAGS = \
$(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \
-I$(srcdir)/../NETGENPlugin \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix
-I$(top_builddir)/idl
libNETGENPluginGUI_la_LDFLAGS = \
../NETGENPlugin/libNETGENEngine.la \
${SMESH_LDFLAGS} -lSMESH \
${QT_MT_LIBS} \
${GUI_LDFLAGS} -lSalomeApp -lqtx -lsuit -lSalomeObject -lLightApp \
${SMESH_LDFLAGS} -lSMESH -lGeomSelectionTools \
$(CAS_KERNEL)
# resources files

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin GUI: GUI for plugged-in mesher NETGENPlugin
// File : NETGENPluginGUI.cxx
// Author : Michael Zorin

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin GUI: GUI for plugged-in mesher NETGENPlugin
// File : NETGENPluginGUI.h
// Author : Alexander A. BORODIN
@ -26,7 +24,7 @@
// $Header:
//
#ifdef WIN32
#ifdef NETGENPLUGIN_GUI_EXPORTS
#if defined NETGENPLUGIN_GUI_EXPORTS || defined NETGENPluginGUI_EXPORTS
#define NETGENPLUGIN_GUI_EXPORT __declspec( dllexport )
#else
#define NETGENPLUGIN_GUI_EXPORT __declspec( dllimport )

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin GUI: GUI for plugged-in mesher NETGENPlugin
// File : NETGENPluginGUI_HypothesisCreator.cxx
// Author : Michael Zorin
@ -30,6 +31,8 @@
#include <SMESHGUI_Utils.h>
#include <SMESHGUI_HypothesesUtils.h>
#include <SMESHGUI.h>
#include <SMESHGUI_SpinBox.h>
#include <GeomSelectionTools.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
@ -37,8 +40,8 @@
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Tools.h>
#include <SalomeApp_DoubleSpinBox.h>
#include <LightApp_SelectionMgr.h>
#include <SALOME_ListIteratorOfListIO.hxx>
#include <QComboBox>
#include <QLabel>
@ -48,6 +51,9 @@
#include <QLineEdit>
#include <QCheckBox>
#include <QPixmap>
#include <QTableWidget>
#include <QHeaderView>
#include <QPushButton>
enum Fineness
{
@ -59,10 +65,35 @@
UserDefined
};
enum {
STD_TAB = 0,
LSZ_TAB
};
enum {
LSZ_ENTRY_COLUMN = 0,
LSZ_NAME_COLUMN,
LSZ_LOCALSIZE_COLUMN,
LSZ_NB_COLUMNS
};
enum {
LSZ_BTNS = 0,
LSZ_VERTEX_BTN,
LSZ_EDGE_BTN,
#ifdef NETGEN_NEW
LSZ_FACE_BTN,
#endif
LSZ_SEPARATOR2,
LSZ_REMOVE_BTN
};
NETGENPluginGUI_HypothesisCreator::NETGENPluginGUI_HypothesisCreator( const QString& theHypType )
: SMESHGUI_GenericHypothesisCreator( theHypType ),
myIs2D(false)
{
myGeomSelectionTools = NULL;
myLocalSizeMap.clear();
}
NETGENPluginGUI_HypothesisCreator::~NETGENPluginGUI_HypothesisCreator()
@ -92,8 +123,12 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
lay->setMargin( 5 );
lay->setSpacing( 0 );
QGroupBox* GroupC1 = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr );
lay->addWidget( GroupC1 );
QTabWidget* tab = new QTabWidget( fr );
tab->setTabShape( QTabWidget::Rounded );
tab->setTabPosition( QTabWidget::North );
lay->addWidget( tab );
QWidget* GroupC1 = new QWidget();
tab->insertTab( STD_TAB, GroupC1, tr( "SMESH_ARGUMENTS" ) );
QGridLayout* aGroupLayout = new QGridLayout( GroupC1 );
aGroupLayout->setSpacing( 6 );
@ -110,11 +145,8 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
}
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_MAX_SIZE" ), GroupC1 ), row, 0 );
myMaxSize = new SalomeApp_DoubleSpinBox( GroupC1 );
myMaxSize->setDecimals( 7 );
myMaxSize->setMinimum( 1e-07 );
myMaxSize->setMaximum( 1e+06 );
myMaxSize->setSingleStep( 10 );
myMaxSize = new SMESHGUI_SpinBox( GroupC1 );
myMaxSize->RangeStepAndValidator( 1e-07, 1e+06, 10., "length_precision" );
aGroupLayout->addWidget( myMaxSize, row, 1 );
row++;
@ -132,26 +164,22 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
row++;
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_GROWTH_RATE" ), GroupC1 ), row, 0 );
myGrowthRate = new SalomeApp_DoubleSpinBox( GroupC1 );
myGrowthRate->setMinimum( 0.1 );
myGrowthRate->setMaximum( 10 );
myGrowthRate->setSingleStep( 0.1 );
myGrowthRate = new SMESHGUI_SpinBox( GroupC1 );
myGrowthRate->RangeStepAndValidator( .1, 10., .1, "parametric_precision" );
aGroupLayout->addWidget( myGrowthRate, row, 1 );
row++;
const double VALUE_MAX = 1.0e+6;
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_EDGE" ), GroupC1 ), row, 0 );
myNbSegPerEdge = new SalomeApp_DoubleSpinBox( GroupC1 );
myNbSegPerEdge->setMinimum( 0.2 );
myNbSegPerEdge->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
myNbSegPerEdge = new SMESHGUI_SpinBox( GroupC1 );
myNbSegPerEdge->RangeStepAndValidator( .2, VALUE_MAX, .1, "parametric_precision" );
aGroupLayout->addWidget( myNbSegPerEdge, row, 1 );
row++;
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_RADIUS" ), GroupC1 ), row, 0 );
myNbSegPerRadius = new SalomeApp_DoubleSpinBox( GroupC1 );
myNbSegPerRadius->setMinimum( 0.2 );
myNbSegPerRadius->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
myNbSegPerRadius = new SMESHGUI_SpinBox( GroupC1 );
myNbSegPerRadius->RangeStepAndValidator( .2, VALUE_MAX, .1, "parametric_precision" );
aGroupLayout->addWidget( myNbSegPerRadius, row, 1 );
row++;
@ -168,7 +196,49 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
row++;
connect( myFineness, SIGNAL( activated( int ) ), this, SLOT( onFinenessChanged() ) );
QWidget* localSizeGroup = new QWidget();
QGridLayout* localSizeLayout = new QGridLayout(localSizeGroup);
myLocalSizeTable = new QTableWidget(0, LSZ_NB_COLUMNS, localSizeGroup);
localSizeLayout->addWidget(myLocalSizeTable, 1, 0, 8, 1);
QStringList localSizeHeaders;
localSizeHeaders << tr( "LSZ_ENTRY_COLUMN" )<< tr( "LSZ_NAME_COLUMN" ) << tr( "LSZ_LOCALSIZE_COLUMN" );
myLocalSizeTable->setHorizontalHeaderLabels(localSizeHeaders);
myLocalSizeTable->horizontalHeader()->hideSection(LSZ_ENTRY_COLUMN);
myLocalSizeTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
myLocalSizeTable->resizeColumnToContents(LSZ_NAME_COLUMN);
myLocalSizeTable->resizeColumnToContents(LSZ_LOCALSIZE_COLUMN);
myLocalSizeTable->setAlternatingRowColors(true);
myLocalSizeTable->verticalHeader()->hide();
QPushButton* addVertexButton = new QPushButton(tr("NETGEN_LSZ_VERTEX"), localSizeGroup);
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);
line2->setFrameShadow(QFrame::Sunken);
localSizeLayout->addWidget(line2, LSZ_SEPARATOR2, 1, 1, 1);
QPushButton* removeButton = new QPushButton(tr("NETGEN_LSZ_REMOVE"), localSizeGroup);
localSizeLayout->addWidget(removeButton, LSZ_REMOVE_BTN, 1, 1, 1);
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)));
tab->insertTab(LSZ_TAB, localSizeGroup, tr("NETGEN_LOCAL_SIZE"));
return fr;
}
@ -211,6 +281,26 @@ void NETGENPluginGUI_HypothesisCreator::retrieveParams() const
myGrowthRate->setEnabled(isCustom);
myNbSegPerEdge->setEnabled(isCustom);
myNbSegPerRadius->setEnabled(isCustom);
NETGENPluginGUI_HypothesisCreator* that = (NETGENPluginGUI_HypothesisCreator*)this;
QMapIterator<QString, QString> i(myLocalSizeMap);
GeomSelectionTools* geomSelectionTools = that->getGeomSelectionTools();
while (i.hasNext()) {
i.next();
const QString entry = i.key();
std::string shapeName = geomSelectionTools->getNameFromEntry(entry.toStdString());
const QString localSize = i.value();
int row = myLocalSizeTable->rowCount();
myLocalSizeTable->setRowCount(row+1);
myLocalSizeTable->setItem(row, LSZ_ENTRY_COLUMN, new QTableWidgetItem(entry));
myLocalSizeTable->item(row, LSZ_ENTRY_COLUMN)->setFlags(0);
myLocalSizeTable->setItem(row, LSZ_NAME_COLUMN, new QTableWidgetItem(QString::fromStdString(shapeName)));
myLocalSizeTable->item(row, LSZ_NAME_COLUMN)->setFlags(0);
myLocalSizeTable->setItem(row, LSZ_LOCALSIZE_COLUMN, new QTableWidgetItem(localSize));
myLocalSizeTable->item(row, LSZ_LOCALSIZE_COLUMN)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEditable|Qt::ItemIsEnabled);
}
myLocalSizeTable->resizeColumnToContents(LSZ_NAME_COLUMN);
myLocalSizeTable->resizeColumnToContents(LSZ_LOCALSIZE_COLUMN);
}
QString NETGENPluginGUI_HypothesisCreator::storeParams() const
@ -260,10 +350,29 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromHypo( NetgenHypothesisData
if ( myIs2D )
{
NETGENPlugin::NETGENPlugin_Hypothesis_2D_var h_2d =
NETGENPlugin::NETGENPlugin_Hypothesis_2D::_narrow( initParamsHypothesis() );
NETGENPlugin::NETGENPlugin_Hypothesis_2D::_narrow( initParamsHypothesis() );
if ( !h_2d->_is_nil() )
h_data.myAllowQuadrangles = h_2d->GetQuadAllowed();
h_data.myAllowQuadrangles = h_2d->GetQuadAllowed();
}
NETGENPluginGUI_HypothesisCreator* that = (NETGENPluginGUI_HypothesisCreator*)this;
NETGENPlugin::string_array_var myEntries = h->GetLocalSizeEntries();
for ( int i=0 ; i<myEntries->length() ; i++ )
{
QString entry = myEntries[i].in();
double val = h->GetLocalSizeOnEntry(entry.toStdString().c_str());
std::ostringstream tmp;
tmp << val;
QString valstring = QString::fromStdString(tmp.str());
if (myLocalSizeMap.contains(entry))
{
if (myLocalSizeMap[entry] == "__TO_DELETE__")
{
continue;
}
}
that->myLocalSizeMap[entry] = valstring;
}
return true;
@ -289,9 +398,9 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi
if( fineness==UserDefined )
{
h->SetGrowthRate( h_data.myGrowthRate );
h->SetNbSegPerEdge( h_data.myNbSegPerEdge );
h->SetNbSegPerRadius( h_data.myNbSegPerRadius );
h->SetGrowthRate( h_data.myGrowthRate );
h->SetNbSegPerEdge( h_data.myNbSegPerEdge );
h->SetNbSegPerRadius( h_data.myNbSegPerRadius );
aVariablesList.append(h_data.myGrowthRateVar);
aVariablesList.append(h_data.myNbSegPerEdgeVar);
@ -300,21 +409,38 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi
if ( myIs2D )
{
NETGENPlugin::NETGENPlugin_Hypothesis_2D_var h_2d =
NETGENPlugin::NETGENPlugin_Hypothesis_2D::_narrow( h );
if ( !h_2d->_is_nil() )
h_2d->SetQuadAllowed( h_data.myAllowQuadrangles );
NETGENPlugin::NETGENPlugin_Hypothesis_2D_var h_2d =
NETGENPlugin::NETGENPlugin_Hypothesis_2D::_narrow( h );
if ( !h_2d->_is_nil() )
h_2d->SetQuadAllowed( h_data.myAllowQuadrangles );
}
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
if( fineness==UserDefined )
{
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
}
QMapIterator<QString,QString> i(myLocalSizeMap);
while (i.hasNext()) {
i.next();
const QString entry = i.key();
const QString localSize = i.value();
if (localSize == "__TO_DELETE__")
{
h->UnsetLocalSizeOnEntry(entry.toLatin1().constData());
}
else
{
std::istringstream tmp(localSize.toLatin1().constData());
double val;
tmp >> val;
h->SetLocalSizeOnEntry(entry.toLatin1().constData(), val);
}
}
}
catch(const SALOME::SALOME_Exception& ex)
{
@ -344,6 +470,15 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromWidgets( NetgenHypothesisD
if ( myIs2D )
h_data.myAllowQuadrangles = myAllowQuadrangles->isChecked();
NETGENPluginGUI_HypothesisCreator* that = (NETGENPluginGUI_HypothesisCreator*)this;
int nbRows = myLocalSizeTable->rowCount();
for(int row=0 ; row < nbRows ; row++)
{
QString entry = myLocalSizeTable->item(row, LSZ_ENTRY_COLUMN)->text();
QString localSize = myLocalSizeTable->item(row, LSZ_LOCALSIZE_COLUMN)->text().trimmed();
that->myLocalSizeMap[entry] = localSize;
}
return true;
}
@ -360,34 +495,34 @@ void NETGENPluginGUI_HypothesisCreator::onFinenessChanged()
double aGrowthRate, aNbSegPerEdge, aNbSegPerRadius;
switch ( myFineness->currentIndex() )
{
case VeryCoarse:
aGrowthRate = 0.7;
aNbSegPerEdge = 0.3;
aNbSegPerRadius = 1;
break;
case Coarse:
aGrowthRate = 0.5;
aNbSegPerEdge = 0.5;
aNbSegPerRadius = 1.5;
break;
case Fine:
aGrowthRate = 0.2;
aNbSegPerEdge = 2;
aNbSegPerRadius = 3;
break;
case VeryFine:
aGrowthRate = 0.1;
aNbSegPerEdge = 3;
aNbSegPerRadius = 5;
break;
case Moderate:
default:
aGrowthRate = 0.3;
aNbSegPerEdge = 1;
aNbSegPerRadius = 2;
break;
}
{
case VeryCoarse:
aGrowthRate = 0.7;
aNbSegPerEdge = 0.3;
aNbSegPerRadius = 1;
break;
case Coarse:
aGrowthRate = 0.5;
aNbSegPerEdge = 0.5;
aNbSegPerRadius = 1.5;
break;
case Fine:
aGrowthRate = 0.2;
aNbSegPerEdge = 2;
aNbSegPerRadius = 3;
break;
case VeryFine:
aGrowthRate = 0.1;
aNbSegPerEdge = 3;
aNbSegPerRadius = 5;
break;
case Moderate:
default:
aGrowthRate = 0.3;
aNbSegPerEdge = 1;
aNbSegPerRadius = 2;
break;
}
myGrowthRate->setValue( aGrowthRate );
myNbSegPerEdge->setValue( aNbSegPerEdge );
@ -395,6 +530,127 @@ void NETGENPluginGUI_HypothesisCreator::onFinenessChanged()
}
}
void NETGENPluginGUI_HypothesisCreator::onAddLocalSizeOnVertex()
{
addLocalSizeOnShape(TopAbs_VERTEX);
}
void NETGENPluginGUI_HypothesisCreator::onAddLocalSizeOnEdge()
{
addLocalSizeOnShape(TopAbs_EDGE);
}
void NETGENPluginGUI_HypothesisCreator::onAddLocalSizeOnFace()
{
addLocalSizeOnShape(TopAbs_FACE);
}
void NETGENPluginGUI_HypothesisCreator::addLocalSizeOnShape(TopAbs_ShapeEnum typeShapeAsked)
{
NETGENPlugin::NETGENPlugin_Hypothesis_var h = NETGENPlugin::NETGENPlugin_Hypothesis::_narrow(initParamsHypothesis());
GeomSelectionTools* geomSelectionTools = getGeomSelectionTools();
LightApp_SelectionMgr* mySel = geomSelectionTools->selectionMgr();
SALOME_ListIO ListSelectedObjects;
mySel->selectedObjects(ListSelectedObjects, NULL, false );
SALOME_ListIteratorOfListIO Object_It(ListSelectedObjects);
for (Object_It ; Object_It.More() ; Object_It.Next())
{
Handle(SALOME_InteractiveObject) anObject = Object_It.Value();
std::string entry, shapeName;
entry = geomSelectionTools->getEntryOfObject(anObject);
shapeName = anObject->getName();
TopAbs_ShapeEnum shapeType;
shapeType = geomSelectionTools->entryToShapeType(entry);
if (shapeType == TopAbs_SHAPE)
{
// E.A. if shapeType == TopAbs_SHAPE, it is NOT a TopoDS_Shape !!!
continue;
}
// --
if(shapeType != typeShapeAsked)
{
continue;
}
// --
myLocalSizeTable->setFocus();
QString shapeEntry;
shapeEntry = QString::fromStdString(entry);
if (myLocalSizeMap.contains(shapeEntry))
{
if (myLocalSizeMap[shapeEntry] != "__TO_DELETE__")
{
continue;
}
}
double phySize = h->GetMaxSize();
std::ostringstream oss;
oss << phySize;
QString localSize;
localSize = QString::fromStdString(oss.str());
// --
int row = myLocalSizeTable->rowCount() ;
myLocalSizeTable->setRowCount(row+1);
myLocalSizeTable->setItem(row, LSZ_ENTRY_COLUMN, new QTableWidgetItem(shapeEntry));
myLocalSizeTable->item(row, LSZ_ENTRY_COLUMN )->setFlags(0);
myLocalSizeTable->setItem(row, LSZ_NAME_COLUMN, new QTableWidgetItem(QString::fromStdString(shapeName)));
myLocalSizeTable->item(row, LSZ_NAME_COLUMN )->setFlags(0);
myLocalSizeTable->setItem(row, LSZ_LOCALSIZE_COLUMN, new QTableWidgetItem(localSize));
myLocalSizeTable->item(row, LSZ_LOCALSIZE_COLUMN )->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEditable|Qt::ItemIsEnabled);
myLocalSizeTable->resizeColumnToContents(LSZ_NAME_COLUMN);
myLocalSizeTable->resizeColumnToContents(LSZ_LOCALSIZE_COLUMN);
myLocalSizeTable->clearSelection();
myLocalSizeTable->scrollToItem( myLocalSizeTable->item( row, LSZ_LOCALSIZE_COLUMN ) );
// --
}
}
void NETGENPluginGUI_HypothesisCreator::onRemoveLocalSizeOnShape()
{
QList<int> selectedRows;
QList<QTableWidgetItem*> selected = myLocalSizeTable->selectedItems();
QTableWidgetItem* item;
int row;
foreach(item, selected) {
row = item->row();
if (!selectedRows.contains(row))
selectedRows.append( row );
}
qSort( selectedRows );
QListIterator<int> it( selectedRows );
it.toBack();
while (it.hasPrevious())
{
row = it.previous();
QString entry = myLocalSizeTable->item(row,LSZ_ENTRY_COLUMN)->text();
if (myLocalSizeMap.contains(entry))
{
myLocalSizeMap[entry] = "__TO_DELETE__";
}
myLocalSizeTable->removeRow(row );
}
myLocalSizeTable->resizeColumnToContents(LSZ_NAME_COLUMN);
myLocalSizeTable->resizeColumnToContents(LSZ_LOCALSIZE_COLUMN);
}
void NETGENPluginGUI_HypothesisCreator::onSetLocalSize(int row,int col)
{
if (col == LSZ_LOCALSIZE_COLUMN) {
QString entry = myLocalSizeTable->item(row, LSZ_ENTRY_COLUMN)->text();
QString localSize = myLocalSizeTable->item(row, LSZ_LOCALSIZE_COLUMN)->text().trimmed();
myLocalSizeMap[entry] = localSize;
myLocalSizeTable->resizeColumnToContents(LSZ_LOCALSIZE_COLUMN);
}
}
GeomSelectionTools* NETGENPluginGUI_HypothesisCreator::getGeomSelectionTools()
{
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
if (myGeomSelectionTools == NULL || myGeomSelectionTools->getMyStudy() != aStudy) {
myGeomSelectionTools = new GeomSelectionTools(aStudy);
}
return myGeomSelectionTools;
}
QString NETGENPluginGUI_HypothesisCreator::caption() const
{
return tr( QString( "NETGEN_%1_TITLE" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() );

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin GUI: GUI for plugged-in mesher NETGENPlugin
// File : NETGENPluginGUI_HypothesisCreator.h
// Author : Michael Zorin
@ -32,10 +33,14 @@
#include <SMESHGUI_Hypotheses.h>
class SalomeApp_DoubleSpinBox;
#include <TopAbs_ShapeEnum.hxx>
class SMESHGUI_SpinBox;
class GeomSelectionTools;
class QComboBox;
class QCheckBox;
class QLineEdit;
class QTableWidget;
typedef struct
{
@ -71,24 +76,35 @@ protected:
protected slots:
virtual void onFinenessChanged();
virtual void onAddLocalSizeOnVertex();
virtual void onAddLocalSizeOnEdge();
virtual void onAddLocalSizeOnFace();
virtual void onRemoveLocalSizeOnShape();
virtual void onSetLocalSize(int,int);
private:
bool readParamsFromHypo( NetgenHypothesisData& ) const;
bool readParamsFromWidgets( NetgenHypothesisData& ) const;
bool storeParamsToHypo( const NetgenHypothesisData& ) const;
GeomSelectionTools* getGeomSelectionTools();
void addLocalSizeOnShape(TopAbs_ShapeEnum);
private:
QLineEdit* myName;
SalomeApp_DoubleSpinBox* myMaxSize;
SMESHGUI_SpinBox* myMaxSize;
QCheckBox* mySecondOrder;
QCheckBox* myOptimize;
QComboBox* myFineness;
SalomeApp_DoubleSpinBox* myGrowthRate;
SalomeApp_DoubleSpinBox* myNbSegPerEdge;
SalomeApp_DoubleSpinBox* myNbSegPerRadius;
SMESHGUI_SpinBox* myGrowthRate;
SMESHGUI_SpinBox* myNbSegPerEdge;
SMESHGUI_SpinBox* myNbSegPerRadius;
QCheckBox* myAllowQuadrangles;
bool myIs2D;
QTableWidget* myLocalSizeTable;
GeomSelectionTools* myGeomSelectionTools;
QMap<QString, QString> myLocalSizeMap;
};
#endif

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPluginGUI_SimpleCreator.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
@ -151,7 +149,7 @@ QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
// * local length
myLengthRadioBut = new QRadioButton( tr( "SMESH_LOCAL_LENGTH_HYPOTHESIS" ), dimGroup );
myLength = new SMESHGUI_SpinBox( dimGroup );
myLength->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 0.1, 6 );
myLength->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 0.1, "length_precision" );
myLength->setValue( 1. );
dimLay->addWidget( myLengthRadioBut, dimRow, 0 );
dimLay->addWidget( myLength, dimRow, 1 );
@ -178,7 +176,7 @@ QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
// * max area
dimLay->addWidget( new QLabel( tr( "SMESH_MAX_ELEMENT_AREA_HYPOTHESIS" ), dimGroup), dimRow, 0);
myArea = new SMESHGUI_SpinBox( dimGroup );
myArea->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 0.1, 6 );
myArea->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 0.1, "area_precision" );
myArea->setValue( 1. );
dimLay->addWidget( myArea, dimRow, 1 );
dimRow++;
@ -205,7 +203,7 @@ QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
// * max volume
dimLay->addWidget(new QLabel( tr("SMESH_MAX_ELEMENT_VOLUME_HYPOTHESIS"), dimGroup), dimRow, 0);
myVolume = new SMESHGUI_SpinBox( dimGroup );
myVolume->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 0.1, 6 );
myVolume->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 0.1, "volume_precision" );
myVolume->setValue( 1. );
dimLay->addWidget( myVolume, dimRow, 1 );
dimRow++;
@ -225,20 +223,18 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
if ( isCreation() )
myName->setText( hypName() );
// set default real values
// Set default values
NETGENPlugin_SimpleHypothesis_2D_var h =
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 );
if ( double area = h->GetMaxElementArea() )
myArea->setValue( area );
if ( myVolume ) {
NETGENPlugin_SimpleHypothesis_3D_var h3d =
NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis( hasInitParamsHypothesis()) );
if ( double volume = (double) h3d->GetMaxElementVolume() )
myVolume->setValue( volume );
myArea->setValue( len * len );
if ( myVolume )
myVolume->setValue( len * len * len );
}
h = NETGENPlugin_SimpleHypothesis_2D::_narrow( hypothesis() );
@ -248,7 +244,7 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
SMESH::ListOfParameters_var aParameters = h->GetLastParameters();
// 1D
int nbSeg = (int) h->GetNumberOfSegments();
int nbSeg = isCreation() ? dfltNbSeg : (int) h->GetNumberOfSegments();
myNbSegRadioBut->setChecked( nbSeg );
myLengthRadioBut->setChecked( !nbSeg );
QString aPrm;
@ -331,7 +327,7 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
aVariablesList.append(myLength->text());
}
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
// 2D
if ( myArea->isEnabled() ) {
@ -345,7 +341,7 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
aVariablesList.append(QString());
}
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
// 3D
if ( myVolume ) {
@ -361,7 +357,7 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
valStr += "; lenFromFaces";
aVariablesList.append(QString());
}
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
}
}
catch(const SALOME::SALOME_Exception& ex)

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPluginGUI_SimpleCreator.h
// Author : Open CASCADE S.A.S.
//

View File

@ -1,6 +1,6 @@
<!DOCTYPE TS>
<!--
Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2007-2010 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
@ -45,13 +45,17 @@
<source>ICON_SMESH_TREE_ALGO_NETGEN_2D</source>
<translation>mesh_tree_algo_netgen_2d.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_ALGO_NETGEN_2D_ONLY</source>
<translation>mesh_tree_algo_netgen_2d.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_ALGO_NETGEN_2D3D</source>
<translation>mesh_tree_algo_netgen_2d3d.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_ALGO_NETGEN_3D</source>
<translation>mesh_tree_algo_tetra.png</translation>
<translation>mesh_tree_algo_netgen_2d3d.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_HYPO_NETGEN_Parameters</source>

View File

@ -1,6 +1,6 @@
<!DOCTYPE TS>
<!--
Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2007-2010 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
@ -133,5 +133,37 @@
<source>NG_LENGTH_FROM_FACES</source>
<translation>Length from faces</translation>
</message>
<message>
<source>NETGEN_LOCAL_SIZE</source>
<translation>Local sizes</translation>
</message>
<message>
<source>NETGEN_LSZ_VERTEX</source>
<translation>On Vertex</translation>
</message>
<message>
<source>NETGEN_LSZ_EDGE</source>
<translation>On Edge</translation>
</message>
<message>
<source>NETGEN_LSZ_FACE</source>
<translation>On Sub-Face</translation>
</message>
<message>
<source>NETGEN_LSZ_REMOVE</source>
<translation>Remove</translation>
</message>
<message>
<source>LSZ_ENTRY_COLUMN</source>
<translation>Entry</translation>
</message>
<message>
<source>LSZ_NAME_COLUMN</source>
<translation>Name</translation>
</message>
<message>
<source>LSZ_LOCALSIZE_COLUMN</source>
<translation>Value</translation>
</message>
</context>
</TS>

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : Makefile.in
# Author : Patrick GOLDBRONN (CEA)
# Modified by : Alexander BORODIN (OCN) - autotools usage
@ -27,7 +25,15 @@
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = NETGEN NETGENPlugin
SUBDIRS =
if CMAKE_BUILD
else
if NETGEN_NEW
else
SUBDIRS += NETGEN
endif
endif
SUBDIRS += NETGENPlugin
if NETGENPLUGIN_ENABLE_GUI
SUBDIRS += GUI

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# -* Makefile *-
# Author : Edward AGAPOV (OCC)
# Modified by : Alexander BORODIN (OCN) - autotools usage

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/
(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
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
--- netgen-4.5.old/libsrc/csg/meshsurf.cpp 2006-02-14 11:54:35.000000000 +0300
+++ netgen-4.5.new/libsrc/csg/meshsurf.cpp 2008-02-12 14:57:01.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 2009-08-07 08:41:22.000000000 +0000
@@ -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,
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.new/libsrc/csg/meshsurf.hpp 2008-02-12 14:57:01.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 2009-08-07 08:41:22.000000000 +0000
@@ -45,7 +45,7 @@
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;
///
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
--- netgen-4.5.old/libsrc/interface/Makefile 2005-08-09 18:14:59.000000000 +0400
+++ netgen-4.5.new/libsrc/interface/Makefile 2008-02-12 14:57:01.000000000 +0300
--- netgen-4.5.old/libsrc/interface/Makefile 2005-08-09 14:14:59.000000000 +0000
+++ netgen-4.5.new/libsrc/interface/Makefile 2009-08-07 08:41:22.000000000 +0000
@@ -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
@ -38,8 +69,8 @@ diff -Naur netgen-4.5.old/libsrc/interface/Makefile netgen-4.5.new/libsrc/interf
lib = nginterface
libpath = libsrc/interface
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.new/libsrc/interface/nglib.cpp 2008-02-12 14:57:01.000000000 +0300
--- netgen-4.5.old/libsrc/interface/nglib.cpp 2005-10-18 13:53:18.000000000 +0000
+++ netgen-4.5.new/libsrc/interface/nglib.cpp 2009-08-07 08:41:22.000000000 +0000
@@ -56,7 +56,8 @@
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
--- netgen-4.5.old/libsrc/makefile.inc 2005-09-02 17:17:51.000000000 +0400
+++ netgen-4.5.new/libsrc/makefile.inc 2008-02-12 14:59:55.000000000 +0300
--- netgen-4.5.old/libsrc/makefile.inc 2005-09-02 13:17:51.000000000 +0000
+++ netgen-4.5.new/libsrc/makefile.inc 2009-08-07 08:41:22.000000000 +0000
@@ -8,17 +8,14 @@
LIBSRC_DIR=$(CPP_DIR)/libsrc
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
#
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.new/libsrc/makefile.mach.LINUX 2008-02-12 14:57:01.000000000 +0300
--- netgen-4.5.old/libsrc/makefile.mach.LINUX 2004-10-11 19:49:26.000000000 +0000
+++ netgen-4.5.new/libsrc/makefile.mach.LINUX 2009-08-07 08:41:22.000000000 +0000
@@ -16,7 +16,7 @@
#
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 \
-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
--- netgen-4.5.old/libsrc/meshing/improve2.cpp 2006-01-11 19:08:19.000000000 +0300
+++ netgen-4.5.new/libsrc/meshing/improve2.cpp 2008-02-12 14:57:01.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 2009-08-07 08:41:22.000000000 +0000
@@ -4,7 +4,7 @@
#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
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.new/libsrc/meshing/improve2.hpp 2008-02-12 14:57:01.000000000 +0300
--- netgen-4.5.old/libsrc/meshing/improve2.hpp 2004-10-12 19:22:55.000000000 +0000
+++ netgen-4.5.new/libsrc/meshing/improve2.hpp 2009-08-07 08:41:22.000000000 +0000
@@ -32,17 +32,16 @@
///
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;
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
--- netgen-4.5.old/libsrc/meshing/smoothing2.cpp 2006-01-11 19:08:20.000000000 +0300
+++ netgen-4.5.new/libsrc/meshing/smoothing2.cpp 2008-02-12 14:57:01.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 2009-08-07 08:41:22.000000000 +0000
@@ -300,7 +300,7 @@
double Opti2SurfaceMinFunction ::
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)
{
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
--- netgen-4.5.old/libsrc/occ/occconstruction.cpp 2005-12-06 18:15:53.000000000 +0300
+++ netgen-4.5.new/libsrc/occ/occconstruction.cpp 2008-02-12 14:57:01.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 2009-08-07 08:41:22.000000000 +0000
@@ -28,8 +28,8 @@
#include <BRepAlgoAPI_Common.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>
namespace netgen
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.new/libsrc/occ/occgenmesh.cpp 2008-02-12 14:57:01.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 2009-08-07 08:41:22.000000000 +0000
@@ -28,7 +28,7 @@
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";
geom.facemeshstatus = 0;
@@ -751,7 +760,7 @@
@@ -751,7 +757,7 @@
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;
kappa *= mparam.curvaturesafety;
@@ -779,7 +788,7 @@
@@ -779,7 +785,7 @@
double nq = n*q;
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)
{
@@ -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;
@@ -886,51 +895,47 @@
@@ -886,51 +892,47 @@
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()));
@ -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;
*/
}
@@ -970,7 +975,7 @@
@@ -970,7 +972,7 @@
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;
mesh->SetLocalH (bb.PMin(), bb.PMax(), mparam.grading);
@@ -1075,7 +1080,6 @@
@@ -1075,7 +1077,6 @@
if (triangulation.IsNull()) continue;
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();
for (int j = 1; j <= ntriangles; j++)
@@ -1096,7 +1100,7 @@
@@ -1096,7 +1097,7 @@
maxside = max (maxside, p[1].Distance(p[2]));
//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
--- netgen-4.5.old/libsrc/occ/occgeom.cpp 2006-01-25 16:35:50.000000000 +0300
+++ netgen-4.5.new/libsrc/occ/occgeom.cpp 2008-02-12 14:57:01.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 2009-08-07 08:41:22.000000000 +0000
@@ -7,6 +7,8 @@
#include "ShapeAnalysis_ShapeContents.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;
}
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.new/libsrc/occ/occgeom.hpp 2008-02-12 14:57:01.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 2009-08-07 08:41:22.000000000 +0000
@@ -15,8 +15,6 @@
#include "Geom_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;
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.new/libsrc/occ/occmeshsurf.cpp 2008-02-12 14:57:01.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 2009-08-07 08:41:22.000000000 +0000
@@ -5,6 +5,8 @@
#include <occgeom.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
--- netgen-4.5.old/libsrc/occ/occmeshsurf.hpp 2005-06-09 18:51:10.000000000 +0400
+++ netgen-4.5.new/libsrc/occ/occmeshsurf.hpp 2008-02-12 14:57:01.000000000 +0300
--- netgen-4.5.old/libsrc/occ/occmeshsurf.hpp 2005-06-09 14:51:10.000000000 +0000
+++ netgen-4.5.new/libsrc/occ/occmeshsurf.hpp 2009-08-07 08:41:22.000000000 +0000
@@ -151,7 +151,7 @@
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
--- netgen-4.5.old/libsrc/stlgeom/meshstlsurface.cpp 2006-01-11 19:08:20.000000000 +0300
+++ netgen-4.5.new/libsrc/stlgeom/meshstlsurface.cpp 2008-02-12 14:57:01.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 2009-08-07 08:41:22.000000000 +0000
@@ -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();
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.new/libsrc/stlgeom/meshstlsurface.hpp 2008-02-12 14:57:01.000000000 +0300
--- netgen-4.5.old/libsrc/stlgeom/meshstlsurface.hpp 2004-09-30 13:13:56.000000000 +0000
+++ netgen-4.5.new/libsrc/stlgeom/meshstlsurface.hpp 2009-08-07 08:41:22.000000000 +0000
@@ -79,12 +79,10 @@
virtual void SelectSurfaceOfPoint (const Point3d & p,
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
--- netgen-4.5.old/makeForSalome.sh 1970-01-01 03:00:00.000000000 +0300
+++ netgen-4.5.new/makeForSalome.sh 2008-02-12 14:57:01.000000000 +0300
@@ -0,0 +1,31 @@
--- netgen-4.5.old/makeForSalome.sh 1970-01-01 00:00:00.000000000 +0000
+++ netgen-4.5.new/makeForSalome.sh 2009-08-07 08:41:22.000000000 +0000
@@ -0,0 +1,35 @@
+#! /bin/sh
+cp ngtcltk/ngnewdelete.* libsrc/interface/
+
+MACHINE=LINUX
+if test `uname -m` == "x86_64" ; then
+ MACHINE=LINUX64
+else
+ MACHINE=LINUX
+fi
+export MACHINE
+make -C libsrc/csg
+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/stlgeom/*.hpp libsrc/include/mystdlib.h \
+ 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,39 @@
#!/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/csg/*.hpp $dest_dir
cp -af $src_dir/libsrc/general/*.hpp $dest_dir
cp -af $src_dir/libsrc/geom2d/*.hpp $dest_dir
cp -af $src_dir/libsrc/gprim/*.hpp $dest_dir
cp -af $src_dir/libsrc/interface/*.hpp $dest_dir
cp -af $src_dir/libsrc/linalg/*.hpp $dest_dir
cp -af $src_dir/libsrc/meshing/*.hpp $dest_dir
cp -af $src_dir/libsrc/stlgeom/*.hpp $dest_dir
cp -af $src_dir/libsrc/visualization/*.hpp $dest_dir
cp -af $src_dir/libsrc/occ/*.hpp $dest_dir
cp -af $src_dir/libsrc/occ/*.hxx $dest_dir
cp -af $src_dir/libsrc/occ/*.ixx $dest_dir
cp -af $src_dir/libsrc/occ/*.jxx $dest_dir
cp -af $src_dir/libsrc/occ/*.h $dest_dir
cp -af $src_dir/libsrc/include/mystdlib.h $dest_dir
cp -af $src_dir/libsrc/include/mydefs.hpp $dest_dir
# cp -af $src_dir/libsrc/include/parallel.hpp $dest_dir
rm -f $dest_dir/ngexception.hpp
rm -f $dest_dir/paralleltop.hpp
rm -f $dest_dir/soldata.hpp

View File

@ -1,7 +1,4 @@
# 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
# Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# -* Makefile *-
# Author : Edward AGAPOV (OCC)
# Modified by : Alexander BORODIN (OCN) - autotools usage
@ -82,11 +80,19 @@ libNETGENEngine_la_CPPFLAGS = \
$(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \
$(BOOST_CPPFLAGS) \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix
-I$(top_builddir)/idl
libNETGENEngine_la_LDFLAGS = \
../NETGEN/libNETGEN.la \
if ! NETGEN_NEW
libNETGENEngine_la_LDFLAGS = ../NETGEN/libNETGEN.la
else
libNETGENEngine_la_LDFLAGS = $(NETGEN_LIBS)
endif
libNETGENEngine_la_LDFLAGS += \
../../idl/libSalomeIDLNETGENPLUGIN.la \
$(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \
$(KERNEL_LDFLAGS) -lSalomeGenericObj
$(CAS_LDPATH) -lTKernel -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKMesh -lTKSTL -lTKG3d -lTKTopAlgo -lTKG2d -lTKBool -lTKGeomAlgo -lTKOffset -lTKGeomBase -lTKBO \
-lTKMath -lTKFillet -lTKMeshVS -lTKPrim -lTKSTEPBase -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin \
$(GEOM_LDFLAGS) -lGEOMbasic \
$(MED_LDFLAGS) -lSalomeIDLMED \
$(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine -lStdMeshers -lSMESHDS -lSMDS -lSMESHControls \
$(KERNEL_LDFLAGS) -lSalomeGenericObj -lSalomeNS -lSALOMELocalTrace -lOpUtil

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//=============================================================================
// File : NETGENPlugin_Defs.hxx
// Author : Alexander A. BORODIN
@ -27,7 +28,7 @@
#define _NETGENPlugin_DEFS_HXX_
#ifdef WIN32
#ifdef NETGENPLUGIN_EXPORTS
#if defined NETGENPLUGIN_EXPORTS || defined NETGENEngine_EXPORTS
#define NETGENPLUGIN_EXPORT __declspec( dllexport )
#else
#define NETGENPLUGIN_EXPORT __declspec( dllimport )

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,13 +19,14 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis.cxx
// Author : Michael Sazonov (OCN)
// Date : 28/03/2006
// Project : SALOME
//
#include <NETGENPlugin_Hypothesis.hxx>
#include "NETGENPlugin_Hypothesis.hxx"
#include <utilities.h>
using namespace std;
@ -44,10 +45,12 @@ NETGENPlugin_Hypothesis::NETGENPlugin_Hypothesis (int hypId, int studyId,
_nbSegPerRadius(GetDefaultNbSegPerRadius()),
_fineness (GetDefaultFineness()),
_secondOrder (GetDefaultSecondOrder()),
_optimize (GetDefaultOptimize())
_optimize (GetDefaultOptimize()),
_localSize (GetDefaultLocalSize())
{
_name = "NETGEN_Parameters";
_param_algo_dim = 3;
_localSize.clear();
}
//=============================================================================
@ -183,6 +186,45 @@ void NETGENPlugin_Hypothesis::SetNbSegPerRadius(double theVal)
}
}
//=============================================================================
/*!
*
*/
//=============================================================================
void NETGENPlugin_Hypothesis::SetLocalSizeOnEntry(const std::string& entry, double localSize)
{
if(_localSize[entry] != localSize)
{
_localSize[entry] = localSize;
NotifySubMeshesHypothesisModification();
}
}
//=============================================================================
/*!
*
*/
//=============================================================================
double NETGENPlugin_Hypothesis::GetLocalSizeOnEntry(const std::string& entry)
{
TLocalSize::iterator it = _localSize.find( entry );
if ( it != _localSize.end() )
return it->second;
else
return -1.0;
}
//=============================================================================
/*!
*
*/
//=============================================================================
void NETGENPlugin_Hypothesis::UnsetLocalSizeOnEntry(const std::string& entry)
{
_localSize.erase(entry);
NotifySubMeshesHypothesisModification();
}
//=============================================================================
/*!
*
@ -197,6 +239,16 @@ ostream & NETGENPlugin_Hypothesis::SaveTo(ostream & save)
save << " " << (int)_secondOrder << " " << (int)_optimize;
TLocalSize::iterator it_sm = _localSize.begin();
if (it_sm != _localSize.end()) {
save << " " << "__LOCALSIZE_BEGIN__";
for ( ; it_sm != _localSize.end(); ++it_sm ) {
save << " " << it_sm->first
<< " " << it_sm->second << "%#"; // "%#" is a mark of value end
}
save << " " << "__LOCALSIZE_END__";
}
return save;
}
@ -255,6 +307,31 @@ istream & NETGENPlugin_Hypothesis::LoadFrom(istream & load)
_optimize = (bool) is;
else
load.clear(ios::badbit | load.rdstate());
std::string option_or_sm;
bool hasLocalSize = false;
isOK = (load >> option_or_sm);
if (isOK)
if (option_or_sm == "__LOCALSIZE_BEGIN__")
hasLocalSize = true;
std::string smEntry, smValue;
while (isOK && hasLocalSize) {
isOK = (load >> smEntry);
if (isOK) {
if (smEntry == "__LOCALSIZE_END__")
break;
isOK = (load >> smValue);
}
if (isOK) {
std::istringstream tmp(smValue);
double val;
tmp >> val;
_localSize[ smEntry ] = val;
}
}
return load;
}

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis.hxx
// Author : Michael Sazonov (OCN)
@ -33,6 +34,8 @@
#include "SMESH_Hypothesis.hxx"
#include "Utils_SALOME_Exception.hxx"
#include <map>
// Parameters for work of NETGEN
//
@ -77,6 +80,13 @@ public:
void SetNbSegPerRadius(double theVal);
double GetNbSegPerRadius() const { return _nbSegPerRadius; }
typedef std::map<std::string, double> TLocalSize;
static TLocalSize GetDefaultLocalSize() { return TLocalSize(); }
void SetLocalSizeOnEntry(const std::string& entry, double localSize);
double GetLocalSizeOnEntry(const std::string& entry);
const TLocalSize& GetLocalSizesAndEntries() const { return _localSize; }
void UnsetLocalSizeOnEntry(const std::string& entry);
// the default values (taken from NETGEN 4.5 sources)
static double GetDefaultMaxSize();
@ -115,6 +125,7 @@ private:
Fineness _fineness;
bool _secondOrder;
bool _optimize;
TLocalSize _localSize;
};
#endif

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_2D.cxx
// Author : Michael Sazonov (OCN)
@ -27,7 +28,7 @@
// $Header$
//=============================================================================
//
#include <NETGENPlugin_Hypothesis_2D.hxx>
#include "NETGENPlugin_Hypothesis_2D.hxx"
#include <utilities.h>
using namespace std;

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_2D.hxx
// Author : Michael Sazonov (OCN)

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_2D_i.cxx
// Author : Michael Sazonov (OCN)

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_2D_i.hxx
// Author : Michael Sazonov (OCN)

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_i.cxx
// Author : Michael Sazonov (OCN)
@ -30,6 +31,7 @@
#include "NETGENPlugin_Hypothesis_i.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_PythonDump.hxx"
#include "GEOM_Object.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
@ -271,6 +273,58 @@ CORBA::Double NETGENPlugin_Hypothesis_i::GetNbSegPerRadius()
return this->GetImpl()->GetNbSegPerRadius();
}
//=============================================================================
void NETGENPlugin_Hypothesis_i::SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize)
{
string entry;
entry = GeomObj->GetStudyEntry();
SetLocalSizeOnEntry(entry.c_str(), localSize);
}
//=============================================================================
void NETGENPlugin_Hypothesis_i::SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize)
{
bool valueChanged = false;
valueChanged = ( this->GetImpl()->GetLocalSizeOnEntry(entry) != localSize );
if ( valueChanged )
this->GetImpl()->SetLocalSizeOnEntry(entry, localSize);
if ( valueChanged )
SMESH::TPythonDump() << _this() << ".SetLocalSizeOnShape(" << entry << ", " << localSize << ")";
}
//=============================================================================
CORBA::Double NETGENPlugin_Hypothesis_i::GetLocalSizeOnEntry(const char* entry)
{
return this->GetImpl()->GetLocalSizeOnEntry(entry);
}
//=============================================================================
NETGENPlugin::string_array* NETGENPlugin_Hypothesis_i::GetLocalSizeEntries()
{
NETGENPlugin::string_array_var result = new NETGENPlugin::string_array();
const ::NETGENPlugin_Hypothesis::TLocalSize localSizes = this->GetImpl()->GetLocalSizesAndEntries();
result->length(localSizes.size());
::NETGENPlugin_Hypothesis::TLocalSize::const_iterator it = localSizes.begin();
for (int i=0 ; it != localSizes.end() ; i++, it++)
{
string entry = (*it).first;
result[i] = CORBA::string_dup(entry.c_str());
}
return result._retn();
}
//=============================================================================
void NETGENPlugin_Hypothesis_i::UnsetLocalSizeOnEntry(const char* entry)
{
this->GetImpl()->UnsetLocalSizeOnEntry(entry);
SMESH::TPythonDump() << _this() << ".UnsetLocalSizeOnEntry(" << entry << ")";
}
//=============================================================================
/*!
* NETGENPlugin_Hypothesis_i::GetImpl

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_i.hxx
// Author : Michael Sazonov (OCN)
@ -39,6 +40,7 @@
#include "NETGENPlugin_Hypothesis.hxx"
class SMESH_Gen;
//class GEOM_Object;
// NETGENPlugin parameters hypothesis
@ -75,6 +77,12 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_i:
void SetNbSegPerRadius(CORBA::Double theVal);
CORBA::Double GetNbSegPerRadius();
void SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize);
void SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize);
CORBA::Double GetLocalSizeOnEntry(const char* entry);
NETGENPlugin::string_array* GetLocalSizeEntries();
void UnsetLocalSizeOnEntry(const char* entry);
// Get implementation
::NETGENPlugin_Hypothesis* GetImpl();

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,34 +19,59 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Mesher.hxx
// Author : Michael Sazonov (OCN)
// Date : 31/03/2006
// Project : SALOME
// $Header$
//=============================================================================
//
#ifndef _NETGENPlugin_Mesher_HXX_
#define _NETGENPlugin_Mesher_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "StdMeshers_FaceSide.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMESH_Algo.hxx"
namespace nglib {
#include <nglib.h>
}
#include <map>
#include <vector>
#include <set>
class SMESH_Mesh;
class SMESH_Comment;
class SMESHDS_Mesh;
class TopoDS_Shape;
class TopTools_DataMapOfShapeShape;
class TopTools_IndexedMapOfShape;
class NETGENPlugin_Hypothesis;
class NETGENPlugin_SimpleHypothesis_2D;
class NETGENPlugin_Internals;
namespace netgen {
class OCCGeometry;
class Mesh;
}
//=============================================================================
/*!
* \brief Struct storing nb of entities in netgen mesh
*/
//=============================================================================
struct NETGENPlugin_ngMeshInfo
{
int _nbNodes, _nbSegments, _nbFaces, _nbVolumes;
NETGENPlugin_ngMeshInfo( netgen::Mesh* ngMesh=0);
};
//=============================================================================
/*!
* \brief This class calls the NETGEN mesher of OCC geometry
*/
//=============================================================================
class NETGENPLUGIN_EXPORT NETGENPlugin_Mesher
{
@ -56,27 +81,50 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Mesher
NETGENPlugin_Mesher (SMESH_Mesh* mesh, const TopoDS_Shape& aShape,
const bool isVolume);
void SetParameters(const NETGENPlugin_Hypothesis* hyp);
void SetParameters(const NETGENPlugin_Hypothesis* hyp);
void SetParameters(const NETGENPlugin_SimpleHypothesis_2D* hyp);
bool Compute();
bool Evaluate(MapShapeNbElems& aResMap);
static void PrepareOCCgeometry(netgen::OCCGeometry& occgeom,
const TopoDS_Shape& shape,
SMESH_Mesh& mesh,
std::list< SMESH_subMesh* > * meshedSM=0);
std::list< SMESH_subMesh* > * meshedSM=0,
NETGENPlugin_Internals* internalShapes=0);
static void RemoveTmpFiles();
static int FillSMesh(const netgen::OCCGeometry& occgeom,
const netgen::Mesh& ngMesh,
const NETGENPlugin_ngMeshInfo& initState,
SMESH_Mesh& sMesh,
std::vector<const SMDS_MeshNode*>& nodeVec,
SMESH_Comment& comment);
protected:
bool fillNgMesh(netgen::OCCGeometry& occgeom,
bool fillNgMesh(const netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
std::vector<SMDS_MeshNode*>& nodeVec,
std::vector<const SMDS_MeshNode*>& nodeVec,
const std::list< SMESH_subMesh* > & meshedSM);
static void fixIntFaces(const netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
NETGENPlugin_Internals& internalShapes);
static void addIntVerticesInFaces(const netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
std::vector<const SMDS_MeshNode*>& nodeVec,
NETGENPlugin_Internals& internalShapes);
static void addIntVerticesInSolids(const netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
std::vector<const SMDS_MeshNode*>& nodeVec,
NETGENPlugin_Internals& internalShapes);
void defaultParameters();
static void RemoveTmpFiles();
static SMESH_ComputeErrorPtr readErrors(const std::vector< const SMDS_MeshNode* >& nodeVec);
private:
SMESH_Mesh* _mesh;
@ -88,4 +136,89 @@ protected:
std::map< int, std::pair<int,int> > _faceDescriptors;
};
//=============================================================================
/*!
* \brief Container of info needed to solve problems with internal shapes.
*
* Issue 0020676. It is made up as a class to be ready to extract from NETGEN
* and put in SMESH as soon as the same solution is needed somewhere else.
* The approach is to precompute internal edges in 2D and internal faces in 3D
* and put their mesh correctly (twice) into netgen mesh.
* In 2D, this class finds internal edges in faces and their vertices.
* In 3D, it additionally finds internal faces, their edges shared with other faces,
* and their vertices shared by several internal edges. Nodes built on the found
* shapes and mesh faces built on the found internal faces are to be doubled in
* netgen mesh to emulate a "crack"
*
* For internal faces a more simple solution is found, which is just to duplicate
* mesh faces on internal geom faces without modeling a "real crack". For this
* reason findBorderElements() is no more used anywhere.
*/
//=============================================================================
class NETGENPLUGIN_EXPORT NETGENPlugin_Internals
{
SMESH_Mesh& _mesh;
bool _is3D;
//2D
std::map<int,int> _e2face;//!<edges and their vertices in faces where they are TopAbs_INTERNAL
std::map<int,std::list<int> > _f2v;//!<faces with internal vertices
// 3D
std::set<int> _intShapes;
std::set<int> _borderFaces; //!< non-intrnal faces sharing the internal edge
std::map<int,std::list<int> > _s2v;//!<solids with internal vertices
public:
NETGENPlugin_Internals( SMESH_Mesh& mesh, const TopoDS_Shape& shape, bool is3D );
SMESH_Mesh& getMesh() const;
bool isShapeToPrecompute(const TopoDS_Shape& s);
// 2D meshing
// edges
bool hasInternalEdges() const { return !_e2face.empty(); }
bool isInternalEdge( int id ) const { return _e2face.count( id ); }
const std::map<int,int>& getEdgesAndVerticesWithFaces() const { return _e2face; }
void getInternalEdges( TopTools_IndexedMapOfShape& fmap,
TopTools_IndexedMapOfShape& emap,
TopTools_IndexedMapOfShape& vmap,
std::list< SMESH_subMesh* >& smToPrecompute);
// vertices
bool hasInternalVertexInFace() const { return !_f2v.empty(); }
const std::map<int,std::list<int> >& getFacesWithVertices() const { return _f2v; }
// 3D meshing
// faces
bool hasInternalFaces() const { return !_intShapes.empty(); }
bool isInternalShape( int id ) const { return _intShapes.count( id ); }
void findBorderElements( std::set< const SMDS_MeshElement*, TIDCompare > & borderElems );
bool isBorderFace( int faceID ) const { return _borderFaces.count( faceID ); }
void getInternalFaces( TopTools_IndexedMapOfShape& fmap,
TopTools_IndexedMapOfShape& emap,
std::list< SMESH_subMesh* >& facesSM,
std::list< SMESH_subMesh* >& boundarySM);
// vertices
bool hasInternalVertexInSolid() const { return !_s2v.empty(); }
bool hasInternalVertexInSolid(int soID ) const { return _s2v.count(soID); }
const std::map<int,std::list<int> >& getSolidsWithVertices() const { return _s2v; }
};
//================================================================================
/*!
* \brief It correctly initializes netgen library at constructor and
* correctly finishes using netgen library at destructor
*/
//================================================================================
struct NETGENPLUGIN_EXPORT NETGENPlugin_NetgenLibWrapper
{
nglib::Ng_Mesh * _ngMesh;
NETGENPlugin_NetgenLibWrapper();
~NETGENPlugin_NetgenLibWrapper();
void setMesh( nglib::Ng_Mesh* mesh );
};
#endif

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_NETGEN_2D.cxx
// Author : Michael Sazonov (OCN)
@ -129,3 +130,21 @@ bool NETGENPlugin_NETGEN_2D::Compute(SMESH_Mesh& aMesh,
mesher.SetParameters(dynamic_cast<const NETGENPlugin_SimpleHypothesis_2D*>(_hypothesis));
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

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_NETGEN_2D.hxx
// Author : Michael Sazonov (OCN)
@ -50,7 +51,10 @@ public:
SMESH_Hypothesis::Hypothesis_Status& aStatus);
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:
const SMESHDS_Hypothesis* _hypothesis;

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_NETGEN_2D3D.cxx
// Author : Michael Sazonov (OCN)
@ -132,3 +133,20 @@ bool NETGENPlugin_NETGEN_2D3D::Compute(SMESH_Mesh& aMesh,
mesher.SetParameters(dynamic_cast<const NETGENPlugin_SimpleHypothesis_2D*>(_hypothesis));
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

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_NETGEN_2D3D.hxx
// Author : Michael Sazonov (OCN)
@ -50,7 +51,11 @@ public:
SMESH_Hypothesis::Hypothesis_Status& aStatus);
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:
const SMESHDS_Hypothesis* _hypothesis;

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : idl implementation
// File : NETGENPlugin_NETGEN_2D3D_i.cxx
// Author : Michael Sazonov (OCN)

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : idl implementation
// File : NETGENPlugin_NETGEN_2D3D_i.hxx
// Author : Michael Sazonov (OCN)

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPlugin_NETGEN_2D_ONLY.cxx
// Author : Edward AGAPOV (OCC)
// Project : SALOME
@ -39,6 +37,7 @@
#include "StdMeshers_LengthFromEdges.hxx"
#include "StdMeshers_QuadranglePreference.hxx"
#include <Precision.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
@ -46,6 +45,7 @@
#include <list>
#include <vector>
#include <limits>
/*
Netgen include files
@ -59,13 +59,15 @@ namespace nglib {
//#include <meshtype.hpp>
namespace netgen {
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*);
/*extern*/ MeshingParameters mparam;
extern MeshingParameters mparam;
}
using namespace std;
using namespace netgen;
using namespace nglib;
//#define DUMP_SEGMENTS
//=============================================================================
/*!
*
@ -78,7 +80,7 @@ NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY(int hypId, int studyId,
{
MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY");
_name = "NETGEN_2D_ONLY";
_shapeType = (1 << TopAbs_FACE);// 1 bit /shape type
_compatibleHypothesis.push_back("MaxElementArea");
@ -149,7 +151,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::CheckHypothesis (SMESH_Mesh& aMesh,
return false;
}
if ( _hypMaxElementArea || _hypLengthFromEdges )
if ( _hypMaxElementArea || _hypLengthFromEdges || _hypQuadranglePreference)
aStatus = HYP_OK;
return aStatus == HYP_OK;
@ -172,6 +174,7 @@ static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
// Check wires and count nodes
// ----------------------------
int nbNodes = 0;
double totalLength = 0;
for ( int iW = 0; iW < wires.size(); ++iW )
{
StdMeshers_FaceSidePtr wire = wires[ iW ];
@ -185,7 +188,8 @@ static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
(new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Unexpected nb of points on wire ") << iW
<< ": " << uvPtVec.size()<<" != "<<wire->NbPoints()));
nbNodes += wire->NbSegments();
nbNodes += wire->NbPoints();
totalLength += wire->Length();
}
nodeVec.reserve( nbNodes );
@ -197,37 +201,59 @@ static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
// bb.Increase (bb.Diam()/10);
// ngMesh.SetLocalH (bb.PMin(), bb.PMax(), 0.5); // set grading
// map for nodes on vertices since they can be shared between wires
// ( issue 0020676, face_int_box.brep)
map<const SMDS_MeshNode*, int > node2ngID;
const int faceID = 1, solidID = 0;
ngMesh.AddFaceDescriptor (FaceDescriptor(faceID, solidID, solidID, 0));
if ( ngMesh.GetNFD() < 1 )
ngMesh.AddFaceDescriptor (FaceDescriptor(faceID, solidID, solidID, 0));
for ( int iW = 0; iW < wires.size(); ++iW )
{
StdMeshers_FaceSidePtr wire = wires[ iW ];
const vector<UVPtStruct>& uvPtVec = wire->GetUVPtStruct();
const int nbSegments = wire->NbPoints() - 1;
int firstPointID = ngMesh.GetNP() + 1;
int edgeID = 1, posID = -2;
for ( int i = 0; i < wire->NbSegments(); ++i ) // loop on segments
bool isInternalWire = false;
for ( int i = 0; i < nbSegments; ++i ) // loop on segments
{
// Add the first point of a segment
const SMDS_MeshNode * n = uvPtVec[ i ].node;
const int posShapeID = n->GetPosition()->GetShapeId();
bool onVertex = ( n->GetPosition()->GetTypeOfPosition() == SMDS_TOP_VERTEX );
// skip nodes on degenerated edges
if ( helper.IsDegenShape( posShapeID ) &&
helper.IsDegenShape( uvPtVec[ i+1 ].node->GetPosition()->GetShapeId() ))
continue;
nodeVec.push_back( n );
MeshPoint mp( Point<3> (n->X(), n->Y(), n->Z()) );
ngMesh.AddPoint ( mp, 1, EDGEPOINT );
int ngID1 = ngMesh.GetNP() + 1, ngID2 = ngID1+1;
if ( onVertex )
ngID1 = node2ngID.insert( make_pair( n, ngID1 )).first->second;
if ( ngID1 > ngMesh.GetNP() )
{
MeshPoint mp( Point<3> (n->X(), n->Y(), n->Z()) );
ngMesh.AddPoint ( mp, 1, EDGEPOINT );
nodeVec.push_back( n );
}
else
{
ngID2 = ngMesh.GetNP() + 1;
if ( i > 0 ) // prev segment belongs to same wire
{
Segment& prevSeg = ngMesh.LineSegment( ngMesh.GetNSeg() );
prevSeg[1] = ngID1;
}
}
// Add the segment
Segment seg;
seg.p1 = ngMesh.GetNP(); // ng node id
seg.p2 = seg.p1 + 1; // ng node id
seg[0] = ngID1; // ng node id
seg[1] = ngID2; // ng node id
seg.edgenr = ngMesh.GetNSeg() + 1;// segment id
seg.si = faceID; // = geom.fmap.FindIndex (face);
@ -240,7 +266,7 @@ static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
seg.epgeominfo[ iEnd ].v = pnt.v;
// find out edge id and node parameter on edge
bool onVertex = ( pnt.node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_VERTEX );
onVertex = ( pnt.node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_VERTEX );
if ( onVertex || posShapeID != posID )
{
// get edge id
@ -250,6 +276,7 @@ static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
const TopoDS_Edge& edge = wire->Edge( wire->EdgeIndex( normParam ));
edgeID = geom.emap.FindIndex( edge );
posID = posShapeID;
isInternalWire = ( edge.Orientation() == TopAbs_INTERNAL );
if ( onVertex ) // param on curve is different on each of two edges
seg.epgeominfo[ iEnd ].dist = helper.GetNodeU( edge, pnt.node );
}
@ -258,21 +285,55 @@ static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
ngMesh.AddSegment (seg);
// cout << "Segment: " << seg.edgenr << endl
// << "\tp1: " << seg.p1 << endl
// << "\tp2: " << seg.p2 << 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;
}
Segment& seg = ngMesh.LineSegment( ngMesh.GetNSeg() );
seg.p2 = firstPointID;
}
#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
ngMesh.CalcSurfacesOfNode();
// close chain of segments
if ( nbSegments > 0 )
{
Segment& lastSeg = ngMesh.LineSegment( ngMesh.GetNSeg() - int( isInternalWire));
const SMDS_MeshNode * lastNode = uvPtVec.back().node;
lastSeg[1] = node2ngID.insert( make_pair( lastNode, lastSeg[1] )).first->second;
if ( lastSeg[1] > ngMesh.GetNP() )
{
MeshPoint mp( Point<3> (lastNode->X(), lastNode->Y(), lastNode->Z()) );
ngMesh.AddPoint ( mp, 1, EDGEPOINT );
nodeVec.push_back( lastNode );
}
if ( isInternalWire )
{
Segment& realLastSeg = ngMesh.LineSegment( ngMesh.GetNSeg() );
realLastSeg[0] = lastSeg[1];
}
}
} // loop on wires of a face
// add a segment instead of internal vertex
NETGENPlugin_Internals intShapes( *helper.GetMesh(), helper.GetSubShape(), /*is3D=*/false );
NETGENPlugin_Mesher::addIntVerticesInFaces( geom, ngMesh, nodeVec, intShapes );
ngMesh.CalcSurfacesOfNode();
return TError();
}
@ -315,8 +376,8 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
// Make input netgen mesh
// -------------------------
Ng_Init();
netgen::Mesh * ngMesh = new netgen::Mesh ();
NETGENPlugin_NetgenLibWrapper ngLib;
netgen::Mesh * ngMesh = (netgen::Mesh*) ngLib._ngMesh;
netgen::OCCGeometry occgeo;
NETGENPlugin_Mesher::PrepareOCCgeometry( occgeo, F, aMesh );
@ -325,10 +386,8 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
vector< const SMDS_MeshNode* > nodeVec;
problem = AddSegmentsToMesh( *ngMesh, occgeo, wires, helper, nodeVec );
if ( problem && !problem->IsOK() ) {
delete ngMesh; Ng_Exit();
if ( problem && !problem->IsOK() )
return error( problem );
}
// --------------------
// compute edge length
@ -364,7 +423,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
// Generate surface mesh
// -------------------------
char *optstr;
char *optstr = 0;
int startWith = MESHCONST_MESHSURFACE;
int endWith = MESHCONST_OPTSURFACE;
int err = 1;
@ -404,7 +463,11 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
for ( int i = nbInputNodes + 1; i <= nbNodes; ++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());
#endif
nodeVec[ i-1 ] = node;
}
@ -435,10 +498,91 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
face = helper.AddFace(nodes[0],nodes[1],nodes[2],nodes[3]);
}
Ng_DeleteMesh((nglib::Ng_Mesh*)ngMesh);
Ng_Exit();
NETGENPlugin_Mesher::RemoveTmpFiles();
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

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPlugin_NETGEN_2D_ONLY.hxx
// Project : SALOME
// Author : Edward AGAPOV (OCC)
@ -29,25 +27,9 @@
#include "SMESH_2D_Algo.hxx"
#include "SMESH_Mesh.hxx"
/*#define OCCGEOMETRY
#include <occgeom.hpp>
#include <meshing.hpp>//amv*/
class StdMeshers_MaxElementArea;
class StdMeshers_LengthFromEdges;
class StdMeshers_QuadranglePreference;
//class NETGENPlugin_Hypothesis;
/*namespace netgen {
class OCCGeometry;
}*/
/*namespace netgen {
class OCCGeometry;
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*);
extern MeshingParameters mparam;
}*/
//using namespace netgen;
/*!
* \brief Mesher generating 2D elements on a geometrical face taking
@ -70,6 +52,9 @@ public:
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap);
/*static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
OCCGeometry& geom,
const TSideVector& wires,

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : NETGENPlugin_NETGEN_2D_ONLY_i.cxx
// Author : Edward AGAPOV (OCC)
@ -38,8 +36,8 @@
//=============================================================================
NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl )
int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : NETGENPlugin_NETGEN_2D_ONLY_i.cxx
// Author : Edward AGAPOV (OCC)

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : idl implementation
// File : NETGENPlugin_NETGEN_2D_i.cxx
// Author : Michael Sazonov (OCN)

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : idl implementation
// File : NETGENPlugin_NETGEN_2D_i.hxx
// Author : Michael Sazonov (OCN)

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,13 +19,13 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//=============================================================================
// File : NETGENPlugin_NETGEN_3D.cxx
// Moved here from SMESH_NETGEN_3D.cxx
// Created : lundi 27 Janvier 2003
// Author : Nadir BOUHAMOU (CEA)
// Project : SALOME
// $Header$
//=============================================================================
//
#include "NETGENPlugin_NETGEN_3D.hxx"
@ -40,11 +40,15 @@
#include "SMESH_Gen.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_MeshEditor.hxx"
#include "StdMeshers_QuadToTriaAdaptor.hxx"
#include <BRepGProp.hxx>
#include <BRep_Tool.hxx>
#include <GProp_GProps.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS.hxx>
#include <Standard_Failure.hxx>
@ -60,10 +64,13 @@
Netgen include files
*/
#define OCCGEOMETRY
#include <occgeom.hpp>
namespace nglib {
#include <nglib.h>
}
using namespace nglib;
using namespace std;
//=============================================================================
/*!
@ -72,7 +79,7 @@ using namespace nglib;
//=============================================================================
NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D(int hypId, int studyId,
SMESH_Gen* gen)
SMESH_Gen* gen)
: SMESH_3D_Algo(hypId, studyId, gen)
{
MESSAGE("NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D");
@ -104,10 +111,9 @@ NETGENPlugin_NETGEN_3D::~NETGENPlugin_NETGEN_3D()
*/
//=============================================================================
bool NETGENPlugin_NETGEN_3D::CheckHypothesis
(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
SMESH_Hypothesis::Hypothesis_Status& aStatus)
bool NETGENPlugin_NETGEN_3D::CheckHypothesis (SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
Hypothesis_Status& aStatus)
{
MESSAGE("NETGENPlugin_NETGEN_3D::CheckHypothesis");
@ -160,92 +166,126 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
const int invalid_ID = -1;
SMESH::Controls::Area areaControl;
SMESH::Controls::TSequenceOfXYZ nodesCoords;
// -------------------------------------------------------------------
// get triangles on aShell and make a map of nodes to Netgen node IDs
// -------------------------------------------------------------------
SMESH_MesherHelper helper(aMesh);
SMESH_MesherHelper* myTool = &helper;
bool _quadraticMesh = myTool->IsQuadraticSubMesh(aShape);
bool _quadraticMesh = helper.IsQuadraticSubMesh(aShape);
helper.SetElementsOnShape( true );
typedef map< const SMDS_MeshNode*, int> TNodeToIDMap;
TNodeToIDMap nodeToNetgenID;
list< const SMDS_MeshElement* > triangles;
list< bool > isReversed; // orientation of triangles
int Netgen_NbOfNodes = 0;
int Netgen_param2ndOrder = 0;
double Netgen_paramFine = 1.;
double Netgen_paramSize = pow( 72, 1/6. ) * pow( _maxElementVolume, 1/3. );
TopAbs_ShapeEnum mainType = aMesh.GetShapeToMesh().ShapeType();
bool checkReverse = ( mainType == TopAbs_COMPOUND || mainType == TopAbs_COMPSOLID );
double Netgen_point[3];
int Netgen_triangle[3];
int Netgen_tetrahedron[4];
// for the degeneraged edge: ignore all but one node on it;
// map storing ids of degen edges and vertices and their netgen id:
map< int, int* > degenShapeIdToPtrNgId;
map< int, int* >::iterator shId_ngId;
list< int > degenNgIds;
NETGENPlugin_NetgenLibWrapper ngLib;
Ng_Mesh * Netgen_mesh = ngLib._ngMesh;
StdMeshers_QuadToTriaAdaptor Adaptor;
Adaptor.Compute(aMesh,aShape);
for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next())
// vector of nodes in which node index == netgen ID
vector< const SMDS_MeshNode* > nodeVec;
{
const TopoDS_Shape& aShapeFace = exp.Current();
const SMESHDS_SubMesh * aSubMeshDSFace = meshDS->MeshElements( aShapeFace );
if ( aSubMeshDSFace )
const int invalid_ID = -1;
SMESH::Controls::Area areaControl;
SMESH::Controls::TSequenceOfXYZ nodesCoords;
// maps nodes to ng ID
typedef map< const SMDS_MeshNode*, int, TIDCompare > TNodeToIDMap;
typedef TNodeToIDMap::value_type TN2ID;
TNodeToIDMap nodeToNetgenID;
// find internal shapes
NETGENPlugin_Internals internals( aMesh, aShape, /*is3D=*/true );
// ---------------------------------
// Feed the Netgen with surface mesh
// ---------------------------------
TopAbs_ShapeEnum mainType = aMesh.GetShapeToMesh().ShapeType();
bool checkReverse = ( mainType == TopAbs_COMPOUND || mainType == TopAbs_COMPSOLID );
StdMeshers_QuadToTriaAdaptor Adaptor;
if ( aMesh.NbQuadrangles() > 0 )
Adaptor.Compute(aMesh,aShape);
for ( TopExp_Explorer exFa( aShape, TopAbs_FACE ); exFa.More(); exFa.Next())
{
const TopoDS_Shape& aShapeFace = exFa.Current();
int faceID = meshDS->ShapeToIndex( aShapeFace );
bool isInternalFace = internals.isInternalShape( faceID );
bool isRev = false;
if ( checkReverse && helper.NbAncestors(aShapeFace, aMesh, aShape.ShapeType()) > 1 )
if ( checkReverse && !isInternalFace &&
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 );
const SMESHDS_SubMesh * aSubMeshDSFace = meshDS->MeshElements( aShapeFace );
if ( !aSubMeshDSFace ) continue;
SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
while ( iteratorElem->more() ) // loop on elements on a face
while ( iteratorElem->more() ) // loop on elements on a geom face
{
// check element
// check mesh face
const SMDS_MeshElement* elem = iteratorElem->next();
if ( !elem )
return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
if ( !isTraingle ) {
//return error( COMPERR_BAD_INPUT_MESH,
// SMESH_Comment("Not triangle element ")<<elem->GetID());
// using adaptor
std::list<const SMDS_FaceOfNodes*> faces = Adaptor.GetTriangles(elem);
if(faces.size()==0) {
vector< const SMDS_MeshElement* > trias;
bool isTraingle = ( elem->NbNodes() == ( elem->IsQuadratic() ? 6 : 3 ));
if ( !isTraingle )
{
// use adaptor to convert quadrangle face into triangles
const list<const SMDS_FaceOfNodes*>* faces = Adaptor.GetTriangles(elem);
if(faces==0)
return error( COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID());
}
std::list<const SMDS_FaceOfNodes*>::iterator itf = faces.begin();
for(; itf!=faces.end(); itf++ ) {
triangles.push_back( (*itf) );
isReversed.push_back( isRev );
// put triange's nodes to nodeToNetgenID map
SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(myTool->IsMedium(node))
continue;
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
}
}
SMESH_Comment("No triangles in adaptor for element ")<<elem->GetID());
trias.assign( faces->begin(), faces->end() );
}
else {
// keep a triangle
triangles.push_back( elem );
isReversed.push_back( isRev );
// put elem nodes to nodeToNetgenID map
SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(myTool->IsMedium(node))
continue;
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
else
{
trias.push_back( elem );
}
// Add nodes of triangles and triangles them-selves to netgen mesh
for ( int i = 0; i < trias.size(); ++i )
{
// add three nodes of triangle
bool hasDegen = false;
for ( int iN = 0; iN < 3; ++iN )
{
const SMDS_MeshNode* node = trias[i]->GetNode( iN );
int shapeID = node->GetPosition()->GetShapeId();
if ( node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_EDGE &&
helper.IsDegenShape( shapeID ))
{
// ignore all nodes on degeneraged edge and use node on its vertex instead
TopoDS_Shape vertex = TopoDS_Iterator( meshDS->IndexToShape( shapeID )).Value();
node = SMESH_Algo::VertexNode( TopoDS::Vertex( vertex ), meshDS );
hasDegen = true;
}
int& ngID = nodeToNetgenID.insert(TN2ID( node, invalid_ID )).first->second;
if ( ngID == invalid_ID )
{
ngID = ++Netgen_NbOfNodes;
Netgen_point [ 0 ] = node->X();
Netgen_point [ 1 ] = node->Y();
Netgen_point [ 2 ] = node->Z();
Ng_AddPoint(Netgen_mesh, Netgen_point);
}
Netgen_triangle[ isRev ? 2-iN : iN ] = ngID;
}
// add triangle
if ( hasDegen && (Netgen_triangle[0] == Netgen_triangle[1] ||
Netgen_triangle[0] == Netgen_triangle[2] ||
Netgen_triangle[2] == Netgen_triangle[1] ))
continue;
Ng_AddSurfaceElement(Netgen_mesh, NG_TRIG, Netgen_triangle);
if ( isInternalFace && isTraingle )
{
swap( Netgen_triangle[1], Netgen_triangle[2] );
Ng_AddSurfaceElement(Netgen_mesh, NG_TRIG, Netgen_triangle);
}
}
#ifdef _DEBUG_
@ -256,91 +296,24 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
MESSAGE( "Warning: Degenerated " << elem );
}
#endif
}
// look for degeneraged edges and vetices
for (TopExp_Explorer expE(aShapeFace,TopAbs_EDGE);expE.More();expE.Next())
{
TopoDS_Edge aShapeEdge = TopoDS::Edge( expE.Current() );
if ( BRep_Tool::Degenerated( aShapeEdge ))
{
degenNgIds.push_back( invalid_ID );
int* ptrIdOnEdge = & degenNgIds.back();
// remember edge id
int edgeID = meshDS->ShapeToIndex( aShapeEdge );
degenShapeIdToPtrNgId.insert( make_pair( edgeID, ptrIdOnEdge ));
// remember vertex id
int vertexID = meshDS->ShapeToIndex( TopExp::FirstVertex( aShapeEdge ));
degenShapeIdToPtrNgId.insert( make_pair( vertexID, ptrIdOnEdge ));
}
}
}
}
// ---------------------------------
// Feed the Netgen with surface mesh
// ---------------------------------
} // loop on elements on a face
} // loop on faces of a SOLID or SHELL
int Netgen_NbOfNodes = 0;
int Netgen_param2ndOrder = 0;
double Netgen_paramFine = 1.;
double Netgen_paramSize = pow( 72, 1/6. ) * pow( _maxElementVolume, 1/3. );
// insert old nodes into nodeVec
nodeVec.resize( nodeToNetgenID.size() + 1, 0 );
TNodeToIDMap::iterator n_id = nodeToNetgenID.begin();
for ( ; n_id != nodeToNetgenID.end(); ++n_id )
nodeVec[ n_id->second ] = n_id->first;
nodeToNetgenID.clear();
double Netgen_point[3];
int Netgen_triangle[3];
int Netgen_tetrahedron[4];
Ng_Init();
Ng_Mesh * Netgen_mesh = Ng_NewMesh();
// set nodes and remember thier netgen IDs
bool isDegen = false, hasDegen = !degenShapeIdToPtrNgId.empty();
TNodeToIDMap::iterator n_id = nodeToNetgenID.begin();
for ( ; n_id != nodeToNetgenID.end(); ++n_id )
{
const SMDS_MeshNode* node = n_id->first;
// ignore nodes on degenerated edge
if ( hasDegen ) {
int shapeId = node->GetPosition()->GetShapeId();
shId_ngId = degenShapeIdToPtrNgId.find( shapeId );
isDegen = ( shId_ngId != degenShapeIdToPtrNgId.end() );
if ( isDegen && *(shId_ngId->second) != invalid_ID ) {
n_id->second = *(shId_ngId->second);
continue;
}
}
Netgen_point [ 0 ] = node->X();
Netgen_point [ 1 ] = node->Y();
Netgen_point [ 2 ] = node->Z();
Ng_AddPoint(Netgen_mesh, Netgen_point);
n_id->second = ++Netgen_NbOfNodes; // set netgen ID
if ( isDegen ) // all nodes on a degen edge get one netgen ID
*(shId_ngId->second) = n_id->second;
}
// set triangles
list< const SMDS_MeshElement* >::iterator tria = triangles.begin();
list< bool >::iterator reverse = isReversed.begin();
for ( ; tria != triangles.end(); ++tria, ++reverse )
{
int i = 0;
SMDS_ElemIteratorPtr triangleNodesIt = (*tria)->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(myTool->IsMedium(node))
continue;
Netgen_triangle[ *reverse ? 2 - i : i ] = nodeToNetgenID[ node ];
++i;
}
if ( !hasDegen ||
// ignore degenerated triangles, they have 2 or 3 same ids
(Netgen_triangle[0] != Netgen_triangle[1] &&
Netgen_triangle[0] != Netgen_triangle[2] &&
Netgen_triangle[2] != Netgen_triangle[1] ))
if ( internals.hasInternalVertexInSolid() )
{
Ng_AddSurfaceElement(Netgen_mesh, NG_TRIG, Netgen_triangle);
netgen::OCCGeometry occgeo;
NETGENPlugin_Mesher::addIntVerticesInSolids( occgeo,
(netgen::Mesh&) *Netgen_mesh,
nodeVec,
internals);
Netgen_NbOfNodes = Ng_GetNP(Netgen_mesh);
}
}
@ -351,8 +324,8 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
Ng_Meshing_Parameters Netgen_param;
Netgen_param.secondorder = Netgen_param2ndOrder;
Netgen_param.fineness = Netgen_paramFine;
Netgen_param.maxh = Netgen_paramSize;
Netgen_param.fineness = Netgen_paramFine;
Netgen_param.maxh = Netgen_paramSize;
Ng_Result status;
@ -381,8 +354,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
}
int Netgen_NbOfNodesNew = Ng_GetNP(Netgen_mesh);
int Netgen_NbOfTetra = Ng_GetNE(Netgen_mesh);
int Netgen_NbOfTetra = Ng_GetNE(Netgen_mesh);
MESSAGE("End of Volume Mesh Generation. status=" << status <<
", nb new nodes: " << Netgen_NbOfNodesNew - Netgen_NbOfNodes <<
@ -392,55 +364,52 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
// Feed back the SMESHDS with the generated Nodes and Volume Elements
// -------------------------------------------------------------------
if ( status == NG_VOLUME_FAILURE )
{
SMESH_ComputeErrorPtr err = NETGENPlugin_Mesher::readErrors(nodeVec);
if ( err && !err->myBadElements.empty() )
error( err );
}
bool isOK = ( /*status == NG_OK &&*/ Netgen_NbOfTetra > 0 );// get whatever built
if ( isOK )
{
// vector of nodes in which node index == netgen ID
vector< const SMDS_MeshNode* > nodeVec ( Netgen_NbOfNodesNew + 1 );
// insert old nodes into nodeVec
for ( n_id = nodeToNetgenID.begin(); n_id != nodeToNetgenID.end(); ++n_id ) {
nodeVec.at( n_id->second ) = n_id->first;
}
// create and insert new nodes into nodeVec
nodeVec.resize( Netgen_NbOfNodesNew + 1, 0 );
int nodeIndex = Netgen_NbOfNodes + 1;
int shapeID = meshDS->ShapeToIndex( aShape );
for ( ; nodeIndex <= Netgen_NbOfNodesNew; ++nodeIndex )
{
Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point );
SMDS_MeshNode * node = meshDS->AddNode(Netgen_point[0],
Netgen_point[1],
Netgen_point[2]);
meshDS->SetNodeInVolume(node, shapeID);
nodeVec.at(nodeIndex) = node;
nodeVec.at(nodeIndex) = helper.AddNode(Netgen_point[0], Netgen_point[1], Netgen_point[2]);
}
// create tetrahedrons
for ( int elemIndex = 1; elemIndex <= Netgen_NbOfTetra; ++elemIndex )
{
Ng_GetVolumeElement(Netgen_mesh, elemIndex, Netgen_tetrahedron);
SMDS_MeshVolume * elt = myTool->AddVolume (nodeVec.at( Netgen_tetrahedron[0] ),
nodeVec.at( Netgen_tetrahedron[1] ),
nodeVec.at( Netgen_tetrahedron[2] ),
nodeVec.at( Netgen_tetrahedron[3] ));
meshDS->SetMeshElementOnShape(elt, shapeID );
helper.AddVolume (nodeVec.at( Netgen_tetrahedron[0] ),
nodeVec.at( Netgen_tetrahedron[1] ),
nodeVec.at( Netgen_tetrahedron[2] ),
nodeVec.at( Netgen_tetrahedron[3] ));
}
}
Ng_DeleteMesh(Netgen_mesh);
Ng_Exit();
NETGENPlugin_Mesher::RemoveTmpFiles();
return (status == NG_OK);
}
bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
//================================================================================
/*!
* \brief Compute tetrahedral mesh from 2D mesh without geometry
*/
//================================================================================
bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
SMESH_MesherHelper* aHelper)
{
MESSAGE("NETGENPlugin_NETGEN_3D::Compute with maxElmentsize = " << _maxElementVolume);
const int invalid_ID = -1;
bool _quadraticMesh = false;
typedef map< const SMDS_MeshNode*, int> TNodeToIDMap;
typedef map< const SMDS_MeshNode*, int, TIDCompare > TNodeToIDMap;
TNodeToIDMap nodeToNetgenID;
list< const SMDS_MeshElement* > triangles;
SMESHDS_Mesh* MeshDS = aHelper->GetMeshDS();
@ -456,46 +425,37 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
StdMeshers_QuadToTriaAdaptor Adaptor;
Adaptor.Compute(aMesh);
SMDS_FaceIteratorPtr iteratorFace = MeshDS->facesIterator();
while(iteratorFace->more()) {
SMDS_FaceIteratorPtr fIt = MeshDS->facesIterator();
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
const SMDS_MeshElement* elem = iteratorFace->next();
const SMDS_MeshElement* elem = *itFace;
if ( !elem )
return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
vector< const SMDS_MeshElement* > trias;
bool isTraingle = ( elem->NbNodes() == ( elem->IsQuadratic() ? 6 : 3 ));
if ( !isTraingle ) {
//return error( COMPERR_BAD_INPUT_MESH,
// SMESH_Comment("Not triangle element ")<<elem->GetID());
// using adaptor
std::list<const SMDS_FaceOfNodes*> faces = Adaptor.GetTriangles(elem);
if(faces.size()==0) {
return error( COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID());
}
std::list<const SMDS_FaceOfNodes*>::iterator itf = faces.begin();
for(; itf!=faces.end(); itf++ ) {
triangles.push_back( (*itf) );
// put triange's nodes to nodeToNetgenID map
SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(aHelper->IsMedium(node))
continue;
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
}
}
const list<const SMDS_FaceOfNodes*>* faces = Adaptor.GetTriangles(elem);
if(faces==0)
continue; // Issue 0020682. There already can be 3d mesh
trias.assign( faces->begin(), faces->end() );
}
else {
// keep a triangle
triangles.push_back( elem );
// put elem nodes to nodeToNetgenID map
SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(aHelper->IsMedium(node))
continue;
trias.push_back( elem );
}
for ( int i = 0; i < trias.size(); ++i )
{
triangles.push_back( trias[i] );
for ( int iN = 0; iN < 3; ++iN )
{
const SMDS_MeshNode* node = trias[i]->GetNode( iN );
// put elem nodes to nodeToNetgenID map
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
}
}
@ -514,11 +474,10 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
int Netgen_triangle[3];
int Netgen_tetrahedron[4];
Ng_Init();
NETGENPlugin_NetgenLibWrapper ngLib;
Ng_Mesh * Netgen_mesh = ngLib._ngMesh;
Ng_Mesh * Netgen_mesh = Ng_NewMesh();
// set nodes and remember thier netgen IDs
// set nodes and remember thier netgen IDs
TNodeToIDMap::iterator n_id = nodeToNetgenID.begin();
for ( ; n_id != nodeToNetgenID.end(); ++n_id )
@ -530,7 +489,6 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
Netgen_point [ 2 ] = node->Z();
Ng_AddPoint(Netgen_mesh, Netgen_point);
n_id->second = ++Netgen_NbOfNodes; // set netgen ID
}
// set triangles
@ -547,7 +505,6 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
Netgen_triangle[ i ] = nodeToNetgenID[ node ];
++i;
}
Ng_AddSurfaceElement(Netgen_mesh, NG_TRIG, Netgen_triangle);
}
@ -609,8 +566,8 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
{
Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point );
SMDS_MeshNode * node = aHelper->AddNode(Netgen_point[0],
Netgen_point[1],
Netgen_point[2]);
Netgen_point[1],
Netgen_point[2]);
nodeVec.at(nodeIndex) = node;
}
@ -619,16 +576,100 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
{
Ng_GetVolumeElement(Netgen_mesh, elemIndex, Netgen_tetrahedron);
aHelper->AddVolume (nodeVec.at( Netgen_tetrahedron[0] ),
nodeVec.at( Netgen_tetrahedron[1] ),
nodeVec.at( Netgen_tetrahedron[2] ),
nodeVec.at( Netgen_tetrahedron[3] ));
nodeVec.at( Netgen_tetrahedron[1] ),
nodeVec.at( Netgen_tetrahedron[2] ),
nodeVec.at( Netgen_tetrahedron[3] ));
}
}
Ng_DeleteMesh(Netgen_mesh);
Ng_Exit();
NETGENPlugin_Mesher::RemoveTmpFiles();
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 expF(aShape, TopAbs_FACE); expF.More(); expF.Next()) {
TopoDS_Face F = TopoDS::Face( expF.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 expF(aShape, TopAbs_EDGE); expF.More(); expF.Next()) {
TopoDS_Edge E = TopoDS::Edge(expF.Current());
if( tmpMap.Contains(E) )
continue;
tmpMap.Add(E);
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(expF.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 = (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

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//=============================================================================
// File : NETGENPlugin_NETGEN_3D.hxx
// Moved here from SMESH_NETGEN_3D.hxx
@ -49,11 +50,15 @@ public:
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
const TopoDS_Shape& aShape);
virtual bool Compute(SMESH_Mesh& aMesh,
SMESH_MesherHelper* aHelper);
virtual bool Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap);
protected:
double _maxElementVolume;

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : NETGENPlugin_NETGEN_3D_i.cxx
// Moved here from SMESH_NETGEN_3D_i.cxx
@ -43,8 +44,8 @@ using namespace std;
//=============================================================================
NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl )
int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
@ -52,8 +53,8 @@ NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr theP
{
MESSAGE( "NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i" );
myBaseImpl = new ::NETGENPlugin_NETGEN_3D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
theStudyId,
theGenImpl );
}
//=============================================================================

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : NETGENPlugin_NETGEN_3D_i.hxx
// Moved here from SMESH_NETGEN_3D_i.hxx

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_2D.cxx
// Author : Edward AGAPOV

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_2D.hxx
// Author : Edward AGAPOV

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_2D_i.cxx
// Author : Edward AGAPOV

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_2D_i.hxx
// Author : Edward AGAPOV

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_3D.cxx
// Author : Edward AGAPOV

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_3D.hxx
// Author : Edward AGAPOV

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_3D_i.cxx
// Author : Edward AGAPOV

View File

@ -1,7 +1,4 @@
// 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
// Copyright (C) 2007-2010 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
@ -19,6 +16,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_3D_i.hxx
// Author : Edward AGAPOV

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2010 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
@ -19,6 +19,7 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH NETGENPlugin : implementaion of SMESH idl descriptions
// File : NETGENPlugin.cxx
// Author : Julia DOROVSKIKH