From c4b4efc985bf25c0671c97f90e3f3f9d0af3e92d Mon Sep 17 00:00:00 2001 From: prascle Date: Wed, 20 Mar 2013 15:26:56 +0000 Subject: [PATCH] PR: update documentation with geomBuilder and smeshBuilder --- configure.ac | 1 + doc/salome/Makefile.am | 2 +- doc/salome/examples/Makefile.am | 31 +++++++++++ doc/salome/examples/netgendemo.py | 50 ++++++++++++++++++ doc/salome/gui/NETGENPLUGIN/doxyfile.in | 7 ++- doc/salome/gui/NETGENPLUGIN/doxyfile_py.in | 3 +- .../input/netgenplugin_python_interface.doc | 52 ++----------------- 7 files changed, 96 insertions(+), 50 deletions(-) create mode 100644 doc/salome/examples/Makefile.am create mode 100644 doc/salome/examples/netgendemo.py diff --git a/configure.ac b/configure.ac index c691861..a207a40 100644 --- a/configure.ac +++ b/configure.ac @@ -442,6 +442,7 @@ AC_OUTPUT([ \ NETGENPLUGIN_version.h \ doc/Makefile \ doc/salome/Makefile \ + doc/salome/examples/Makefile \ doc/salome/gui/Makefile \ doc/salome/gui/NETGENPLUGIN/Makefile \ doc/salome/gui/NETGENPLUGIN/doxyfile \ diff --git a/doc/salome/Makefile.am b/doc/salome/Makefile.am index 9ded0be..543ad31 100644 --- a/doc/salome/Makefile.am +++ b/doc/salome/Makefile.am @@ -23,7 +23,7 @@ # Modified by : Alexander BORODIN (OCN) - autotools usage # $Header: # -SUBDIRS = gui +SUBDIRS = examples gui SUBDIRSGUI = gui usr_docs: diff --git a/doc/salome/examples/Makefile.am b/doc/salome/examples/Makefile.am new file mode 100644 index 0000000..0e62bb3 --- /dev/null +++ b/doc/salome/examples/Makefile.am @@ -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) diff --git a/doc/salome/examples/netgendemo.py b/doc/salome/examples/netgendemo.py new file mode 100644 index 0000000..8ef585b --- /dev/null +++ b/doc/salome/examples/netgendemo.py @@ -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() diff --git a/doc/salome/gui/NETGENPLUGIN/doxyfile.in b/doc/salome/gui/NETGENPLUGIN/doxyfile.in index 510aa76..bc49d09 100755 --- a/doc/salome/gui/NETGENPLUGIN/doxyfile.in +++ b/doc/salome/gui/NETGENPLUGIN/doxyfile.in @@ -42,7 +42,7 @@ INPUT = @srcdir@/input FILE_PATTERNS = *.doc EXCLUDE = IMAGE_PATH = @srcdir@/images -EXAMPLE_PATH = +EXAMPLE_PATH = @top_srcdir@/doc/salome/examples #--------------------------------------------------------------------------- #HTML related options @@ -113,3 +113,8 @@ GENERATE_RTF = NO #because it wrongly defines location of the html files for search. TAGFILES = netgenpluginpy_doc.tag=../NETGENPLUGIN/netgenpluginpy_doc SEARCHENGINE = YES + +#--------------------------------------------------------------------------- +#Custom commands +#--------------------------------------------------------------------------- +ALIASES += tui_script{1}="\include \1 Download this script" diff --git a/doc/salome/gui/NETGENPLUGIN/doxyfile_py.in b/doc/salome/gui/NETGENPLUGIN/doxyfile_py.in index 531aab1..7024d90 100755 --- a/doc/salome/gui/NETGENPLUGIN/doxyfile_py.in +++ b/doc/salome/gui/NETGENPLUGIN/doxyfile_py.in @@ -100,7 +100,8 @@ EXAMPLE_RECURSIVE = NO #Input related options #--------------------------------------------------------------------------- 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 = IMAGE_PATH = @srcdir@/images RECURSIVE = NO diff --git a/doc/salome/gui/NETGENPLUGIN/input/netgenplugin_python_interface.doc b/doc/salome/gui/NETGENPLUGIN/input/netgenplugin_python_interface.doc index cd916f4..29cf161 100644 --- a/doc/salome/gui/NETGENPLUGIN/input/netgenplugin_python_interface.doc +++ b/doc/salome/gui/NETGENPLUGIN/input/netgenplugin_python_interface.doc @@ -2,59 +2,17 @@ \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. 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: -\code - -import geompy -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 +\anchor example_NETGENPlugin +

Example of 2d and 3d mesh generation with NETGEN:

+\tui_script{netgendemo.py} */ -- 2.39.2