PR: update documentation with geomBuilder and smeshBuilder
This commit is contained in:
parent
a6a291ea7c
commit
c4b4efc985
@ -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 \
|
||||||
|
@ -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:
|
||||||
|
31
doc/salome/examples/Makefile.am
Normal file
31
doc/salome/examples/Makefile.am
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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)
|
50
doc/salome/examples/netgendemo.py
Normal file
50
doc/salome/examples/netgendemo.py
Normal 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()
|
@ -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>"
|
||||||
|
@ -100,7 +100,8 @@ EXAMPLE_RECURSIVE = NO
|
|||||||
#Input related options
|
#Input related options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
INPUT = @top_srcdir@/src/NETGENPlugin/NETGENPluginBuilder.py \
|
INPUT = @top_srcdir@/src/NETGENPlugin/NETGENPluginBuilder.py \
|
||||||
@SMESH_ROOT_DIR@/bin/salome/smesh_algorithm.py
|
@SMESH_ROOT_DIR@/lib/python@PYTHON_VERSION@/site-packages/salome/salome/smesh/smeshBuilder.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
|
||||||
|
@ -2,59 +2,17 @@
|
|||||||
|
|
||||||
\page netgenplugin_python_interface_page Python Interface
|
\page netgenplugin_python_interface_page Python Interface
|
||||||
|
|
||||||
Python package NETGENPluginBuilder 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
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user