netgenplugin/doc/salome/gui/NETGENPLUGIN/input/netgenplugin_python_interface.doc
2012-10-08 13:15:52 +00:00

62 lines
1.3 KiB
Plaintext

/*!
\page netgenplugin_python_interface_page Python Interface
Python package NETGENPluginDC 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.
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
*/