Merge from BR_plugins_pbyacs 03/04/2013

This commit is contained in:
vsr 2013-04-04 07:11:14 +00:00
parent 7c07317f73
commit db7aa8538f
12 changed files with 131 additions and 63 deletions

View File

@ -442,6 +442,7 @@ AC_OUTPUT([ \
NETGENPLUGIN_version.h \ NETGENPLUGIN_version.h \
doc/Makefile \ doc/Makefile \
doc/salome/Makefile \ doc/salome/Makefile \
doc/salome/examples/Makefile \
doc/salome/gui/Makefile \ doc/salome/gui/Makefile \
doc/salome/gui/NETGENPLUGIN/Makefile \ doc/salome/gui/NETGENPLUGIN/Makefile \
doc/salome/gui/NETGENPLUGIN/doxyfile \ doc/salome/gui/NETGENPLUGIN/doxyfile \

View File

@ -23,7 +23,7 @@
# Modified by : Alexander BORODIN (OCN) - autotools usage # Modified by : Alexander BORODIN (OCN) - autotools usage
# $Header: # $Header:
# #
SUBDIRS = gui SUBDIRS = examples gui
SUBDIRSGUI = gui SUBDIRSGUI = gui
usr_docs: usr_docs:

View File

@ -0,0 +1,31 @@
# Copyright (C) 2007-2013 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
#
# File : Makefile
# Author : Alexander KOVALEV (Open Cascade NN)
# Modified by :
# Module : doc
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
pyexamplesdir = $(docdir)/examples/NETGENPLUGIN
pyexamples_SCRIPTS = netgendemo.py
EXTRA_DIST += $(pyexamples_SCRIPTS)

View File

@ -0,0 +1,50 @@
# 2d and 3d mesh generation with NETGEN
import salome
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
# create a box
box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
geompy.addToStudy(box, "Box")
# 1. Create a triangular 2D mesh on the box with NETGEN_1D2D algorithm
triaN = smesh.Mesh(box, "Box : triangular mesh by NETGEN_1D2D")
# create a Netgen_1D2D algorithm for solids
algo2D = triaN.Triangle(smeshBuilder.NETGEN_1D2D)
# define hypotheses
n12_params = algo2D.Parameters()
# define number of segments
n12_params.SetNbSegPerEdge(19)
# define max element
n12_params.SetMaxSize(300)
# 2. Create a tetrahedral mesh on the box with NETGEN_1D2D3D algorithm (full netgen)
tetraN = smesh.Mesh(box, "Box : tetrahedrical mesh by NETGEN_1D2D3D")
# create a Netgen_1D2D3D algorithm for solids
algo3D = tetraN.Tetrahedron(smeshBuilder.FULL_NETGEN)
# define hypotheses
n123_params = algo3D.Parameters()
# define number of segments
n123_params.SetNbSegPerEdge(11)
# define max element size
n123_params.SetMaxSize(300)
# compute the meshes
triaN.Compute()
tetraN.Compute()

View File

@ -33,10 +33,7 @@ DOC_PYTHONPATH=$(prefix)/bin/salome:$(SMESH_ROOT_DIR)/bin/salome:$(SMESH_ROOT_DI
DOC_LD_LIBRARY_PATH=$(prefix)/lib/salome:${SMESH_ROOT_DIR}/lib/salome:${MED_ROOT_DIR}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome DOC_LD_LIBRARY_PATH=$(prefix)/lib/salome:${SMESH_ROOT_DIR}/lib/salome:${MED_ROOT_DIR}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome
DOC_SMESH_MeshersList=NETGENPlugin DOC_SMESH_MeshersList=NETGENPlugin
smesh.py: $(top_srcdir)/src/NETGENPlugin/NETGENPluginDC.py usr_docs: doxyfile_py doxyfile
@PYTHONPATH=$(DOC_PYTHONPATH):${PYTHONPATH} LD_LIBRARY_PATH=$(DOC_LD_LIBRARY_PATH):${LD_LIBRARY_PATH} SMESH_MeshersList=$(DOC_SMESH_MeshersList) $(PYTHON) $(SMESH_ROOT_DIR)/bin/salome/collect_mesh_methods.py -d -o $@ NETGENPlugin
usr_docs: doxyfile_py doxyfile smesh.py
@$(DOXYGEN) doxyfile_py ; \ @$(DOXYGEN) doxyfile_py ; \
$(DOXYGEN) doxyfile $(DOXYGEN) doxyfile

View File

@ -42,7 +42,7 @@ INPUT = @srcdir@/input
FILE_PATTERNS = *.doc FILE_PATTERNS = *.doc
EXCLUDE = EXCLUDE =
IMAGE_PATH = @srcdir@/images IMAGE_PATH = @srcdir@/images
EXAMPLE_PATH = EXAMPLE_PATH = @top_srcdir@/doc/salome/examples
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#HTML related options #HTML related options
@ -113,3 +113,8 @@ GENERATE_RTF = NO
#because it wrongly defines location of the html files for search. #because it wrongly defines location of the html files for search.
TAGFILES = netgenpluginpy_doc.tag=../NETGENPLUGIN/netgenpluginpy_doc TAGFILES = netgenpluginpy_doc.tag=../NETGENPLUGIN/netgenpluginpy_doc
SEARCHENGINE = YES SEARCHENGINE = YES
#---------------------------------------------------------------------------
#Custom commands
#---------------------------------------------------------------------------
ALIASES += tui_script{1}="\include \1 <a href=\"../../examples/NETGENPLUGIN/\1\">Download this script</a>"

View File

@ -99,9 +99,9 @@ EXAMPLE_RECURSIVE = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#Input related options #Input related options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
INPUT = @top_srcdir@/src/NETGENPlugin/NETGENPluginDC.py \ INPUT = @top_srcdir@/src/NETGENPlugin/NETGENPluginBuilder.py \
smesh.py \ @SMESH_ROOT_DIR@/lib/python@PYTHON_VERSION@/site-packages/salome/salome/smesh/smeshBuilder.py \
@SMESH_ROOT_DIR@/bin/salome/smesh_algorithm.py @SMESH_ROOT_DIR@/lib/python@PYTHON_VERSION@/site-packages/salome/salome/smesh/smesh_algorithm.py
FILE_PATTERNS = FILE_PATTERNS =
IMAGE_PATH = @srcdir@/images IMAGE_PATH = @srcdir@/images
RECURSIVE = NO RECURSIVE = NO

View File

@ -2,59 +2,17 @@
\page netgenplugin_python_interface_page Python Interface \page netgenplugin_python_interface_page Python Interface
Python package NETGENPluginDC defines several classes, destined for Python package NETGENPlugin defines several classes, destined for
creation of the 2D and 3D meshes. creation of the 2D and 3D meshes.
NETGEN meshing plugin dynamically adds several methods to the NETGEN meshing plugin dynamically adds several methods to the
smesh.Mesh class to create meshing algorithms. \ref SMESH_SWIG.smeshBuilder.Mesh "class Mesh" to create meshing algorithms.
Below you can see an example of usage of the NETGENPlugin package for mesh generation: Below you can see an example of usage of the NETGENPlugin package for mesh generation:
\code \anchor example_NETGENPlugin
<h2>Example of 2d and 3d mesh generation with NETGEN:</h2>
import geompy \tui_script{netgendemo.py}
import smesh
# create a box
box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
geompy.addToStudy(box, "Box")
# 1. Create a triangular 2D mesh on the box with NETGEN_1D2D algorithm
triaN = smesh.Mesh(box, "Box : triangular mesh by NETGEN_1D2D")
# create a Netgen_1D2D algorithm for solids
algo2D = triaN.Triangle(smesh.NETGEN_1D2D)
# define hypotheses
n12_params = algo2D.Parameters()
# define number of segments
n12_params.SetNbSegPerEdge(19)
# define max element
n12_params.SetMaxSize(300)
# 2. Create a tetrahedral mesh on the box with NETGEN_1D2D3D algorithm (full netgen)
tetraN = smesh.Mesh(box, "Box : tetrahedrical mesh by NETGEN_1D2D3D")
# create a Netgen_1D2D3D algorithm for solids
algo3D = tetraN.Tetrahedron(smesh.FULL_NETGEN)
# define hypotheses
n123_params = algo3D.Parameters()
# define number of segments
n123_params.SetNbSegPerEdge(11)
# define max element size
n123_params.SetMaxSize(300)
# compute the meshes
triaN.Compute()
tetraN.Compute()
\endcode
*/ */

View File

@ -84,7 +84,7 @@
output="TRIA,QUAD" output="TRIA,QUAD"
dim="2"> dim="2">
<python-wrap> <python-wrap>
<algo>NETGEN_2D_ONLY=Triangle(algo=smesh.NETGEN_2D)</algo> <algo>NETGEN_2D_ONLY=Triangle(algo=smeshBuilder.NETGEN_2D)</algo>
<hypo>LengthFromEdges=LengthFromEdges()</hypo> <hypo>LengthFromEdges=LengthFromEdges()</hypo>
<hypo>MaxElementArea=MaxElementArea(SetMaxElementArea())</hypo> <hypo>MaxElementArea=MaxElementArea(SetMaxElementArea())</hypo>
<hypo>NETGEN_Parameters_2D_ONLY=Parameters()</hypo> <hypo>NETGEN_Parameters_2D_ONLY=Parameters()</hypo>
@ -102,7 +102,7 @@
dim="2" dim="2"
support-submeshes="true"> support-submeshes="true">
<python-wrap> <python-wrap>
<algo>NETGEN_2D=Triangle(algo=smesh.NETGEN_1D2D)</algo> <algo>NETGEN_2D=Triangle(algo=smeshBuilder.NETGEN_1D2D)</algo>
<hypo>NETGEN_Parameters_2D=Parameters()</hypo> <hypo>NETGEN_Parameters_2D=Parameters()</hypo>
<hypo>NETGEN_SimpleParameters_2D=Parameters(smesh.SIMPLE)</hypo> <hypo>NETGEN_SimpleParameters_2D=Parameters(smesh.SIMPLE)</hypo>
<hypo>ViscousLayers2D=ViscousLayers2D(SetTotalThickness(),SetNumberLayers(),SetStretchFactor(),SetIgnoreEdges())</hypo> <hypo>ViscousLayers2D=ViscousLayers2D(SetTotalThickness(),SetNumberLayers(),SetStretchFactor(),SetIgnoreEdges())</hypo>
@ -116,7 +116,7 @@
dim="3" dim="3"
support-submeshes="true"> support-submeshes="true">
<python-wrap> <python-wrap>
<algo>NETGEN_2D3D=Tetrahedron(algo=smesh.NETGEN_1D2D3D)</algo> <algo>NETGEN_2D3D=Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)</algo>
<hypo>NETGEN_Parameters=Parameters()</hypo> <hypo>NETGEN_Parameters=Parameters()</hypo>
<hypo>NETGEN_SimpleParameters_3D=Parameters(smesh.SIMPLE)</hypo> <hypo>NETGEN_SimpleParameters_3D=Parameters(smesh.SIMPLE)</hypo>
</python-wrap> </python-wrap>

View File

@ -99,4 +99,8 @@ libNETGENEngine_la_LDFLAGS += \
$(KERNEL_LDFLAGS) -lSalomeGenericObj -lSalomeNS -lSALOMELocalTrace -lOpUtil $(KERNEL_LDFLAGS) -lSalomeGenericObj -lSalomeNS -lSALOMELocalTrace -lOpUtil
# Scripts to be installed. # Scripts to be installed.
dist_salomescript_DATA= NETGENPluginDC.py #dist_salomescript_DATA= NETGENPluginDC.py
mypkgpythondir = $(salomepythondir)/salome/NETGENPlugin
mypkgpython_PYTHON = \
__init__.py \
NETGENPluginBuilder.py

View File

@ -18,11 +18,11 @@
# #
## ##
# @package NETGENPluginDC # @package NETGENPluginBuilder
# Python API for the NETGEN meshing plug-in module. # Python API for the NETGEN meshing plug-in module.
from smesh_algorithm import Mesh_Algorithm from salome.smesh.smesh_algorithm import Mesh_Algorithm
from smesh import AssureGeomPublished, ParseParameters, IsEqual from salome.smesh.smeshBuilder import AssureGeomPublished, ParseParameters, IsEqual
# import NETGENPlugin module if possible # import NETGENPlugin module if possible
noNETGENPlugin = 0 noNETGENPlugin = 0

View File

@ -0,0 +1,22 @@
# Copyright (C) 2007-2013 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
#
##
# @package NETGENPluginBuilder
# Python API for the NETGEN meshing plug-in module.