Hemisphere Grid Construction

Sphere

Simple Sphere

To create a Simple Sphere Grid in python mode, you need the following arguments:

  • nbR : number of hexahedra on radial.

  • nbA : number of hexahedra along the perimeter of the sphere.

  • nbH : number of hexahedra along the axis of the sphere.

Use the function makeSphereTop:

elts = doc.makeSphereTop(nbR, nbA, nbH)

GUI command: Simple Sphere and Simple Rind

Uniform Sphere

The following data are required:

  • center: center coordinates of the sphere (a vertex).

  • vx : the base of the sphere (a vector).

  • vz : the axis of the hole (a vector).

  • rtrou : the radius of the hole in the sphere.

  • rext : the radius of the sphere.

  • angle : angle of the sphere around the Z axis.

  • vplan : the vertex along the vertical axis where the rind will be cut.

  • nr : number of hexahedra on radial.

  • na : number of hexahedra along the perimeter of the sphere.

  • nh : number of hexahedra along the axis of the sphere.

Use the function makeSphereUni to make a uniform sphere grid:

elts = doc.makeSphereUni (center, vx, vz, rtrou, rext, angle, vplan, nr, na, nh)

GUI command: Uniform Sphere

Custom Sphere

The following data are required:

  • center: center coordinates of the sphere (a vertex).

  • vx : the base of the sphere (a vector).

  • vz : the axis of the sphere (a vector).

  • trad : a list of radiuses in ascendant order.

  • tang : a list of angles in ascendant order.

  • tphi : a list of heights in ascendant order.

Use the function makeSphere to make a custom sphere:

elts = doc.makeSphere(center, vx, vz, trad, tang, tphi)

GUI command: Custom Sphere

Operations on elts: Elements

Example

 1# -*- coding: utf-8 -*-
 2# Copyright (C) 2009-2026  CEA, EDF
 3#
 4# This library is free software; you can redistribute it and/or
 5# modify it under the terms of the GNU Lesser General Public
 6# License as published by the Free Software Foundation; either
 7# version 2.1 of the License, or (at your option) any later version.
 8#
 9# This library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public
15# License along with this library; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17#
18# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19#
20
21####### Sphere Grid Test ##########
22
23import hexablock
24
25
26doc  = hexablock.addDocument ("Sphere Grid Test")
27
28# Simple Sphere -----
29
30nr = 4
31na = 8
32nh = 12
33
34sphere0 = doc.makeSphereTop(nr, na, nh)
35sphere0.saveVtk("makeSphereTop.vtk")
36
37# Uniform Sphere -----
38
39center  = doc.addVertex (0, 0, 0)
40vplan = doc.addVertex (0, 0, -0.5)
41vx    = doc.addVector (1, 0, 0)
42vz    = doc.addVector (0, 0, 1)
43rtrou = 1
44rext  = 10
45angle = 180
46
47sphere1 = doc.makeSphereUni (center, vx, vz, rtrou, rext, angle, vplan, nr, na, nh)
48sphere1.saveVtk("makeSphereUni.vtk")
49
50# Custom Sphere -----
51
52dr     = (rext-rtrou)/nr
53dtheta = angle/na
54dphi   = 180.0/nh
55trad = []
56tang = []
57tphi = []
58
59for nro in range(nr+1):
60  trad.append(rtrou + nro*dr)
61  
62for nro in range(na+1):
63  tang.append(nro*dtheta)
64  
65for nro in range(nh+1):
66  tphi.append(-90 + nro*dphi)
67
68sphere2 = doc.makeSphere (center, vx, vz, trad, tang, tphi)
69sphere2.saveVtk("makeSphere.vtk")

Rind

Simple Rind

To create a Simple Rind Grid in python mode, you need the following arguments:

  • nbR : number of hexahedra on radial.

  • nbA : number of hexahedra along the perimeter of the rind.

  • nbH : number of hexahedra along the axis of the rind.

Use the function makeRindTop:

elts = doc.makeRindTop(nbR, nbA, nbH)

GUI command: Simple Sphere and Simple Rind

Uniform Rind

The following data are required:

  • center: center coordinates of the rind (a vertex).

  • vx : the base of the rind (a vector).

  • vz : the axis of the hole (a vector).

  • rtrou : the radius of the hole in the rind.

  • rint : the internal radius.

  • rext : the radius of the rind.

  • angle : angle of the rind around the Z axis.

  • vplan : the vertex along the vertical axis where the rind will be cut.

  • nr : number of hexahedra on radial.

  • na : number of hexahedra along the perimeter of the rind.

  • nh : number of hexahedra along the axis of the rind.

Use the function makeRindUni to make a uniform rind grid:

elts = doc.makeRindUni(center, vx, vz, rtrou, rint, rext, angle, vplan, nr, na, nh)

GUI command: Uniform Rind

Custom Rind

The following data are required:

  • center: center coordinates of the rind grid (a vertex).

  • vx : the base of the rind grid (a vector).

  • vz : the axis of the rind (a vector).

  • trad : a list of radiuses in ascendant order.

  • tang : a list of angles in ascendant order.

  • tphi : a list of heights in ascendant order.

Use the function makeRind to make a custom rind grid:

elts = doc.makeRind(center, vx, vz, trad, tang, tphi)

GUI command: Custom Rind

Operations on elts: Elements

Example

 1# -*- coding: utf-8 -*-
 2# Copyright (C) 2009-2026  CEA, EDF
 3#
 4# This library is free software; you can redistribute it and/or
 5# modify it under the terms of the GNU Lesser General Public
 6# License as published by the Free Software Foundation; either
 7# version 2.1 of the License, or (at your option) any later version.
 8#
 9# This library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public
15# License along with this library; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17#
18# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19#
20
21####### Rind Grid Test ##########
22
23import hexablock
24
25
26doc  = hexablock.addDocument ("Rind Grid Test")
27
28
29# Simple Rind -----
30
31
32nr = 4
33na = 8
34nh = 12
35
36rind0 = doc.makeRindTop(nr, na, nh)
37rind0.saveVtk("makeRindTop.vtk")
38
39# Uniform Rind -----
40
41center  = doc.addVertex (0, 0, 0)
42vplan = doc.addVertex (0, 0, -0.5)
43vx    = doc.addVector (1, 0, 0)
44vz    = doc.addVector (0, 0, 1)
45rtrou = 1
46rint  = 8
47rext  = 10
48angle = 180
49
50rind1 = doc.makeRindUni(center, vx, vz, rtrou, rint, rext, angle, vplan, nr, na, nh)
51rind1.saveVtk("makeRindUni.vtk")
52
53# Custom Rind -----
54
55dr     = (rext-rtrou)/nr
56dtheta = angle/na
57dphi   = 180.0/nh
58trad = []
59tang = []
60tphi = []
61
62trad.append(rtrou)
63for nro in range(nr+1):
64  trad.append(rint + nro*dr)
65  
66for nro in range(na+1):
67  tang.append(nro*dtheta)
68  
69for nro in range(nh+1):
70  tphi.append(-90 + nro*dphi)
71
72rind2 = doc.makeRind(center, vx, vz, trad, tang, tphi)
73rind2.saveVtk("makeRind.vtk")

Concentric (Spherical) Grid

Simple Concentric

To create a Simple Concentric Grid in python mode, you need the following arguments:

  • nbLayers: the number of nested hexahedra.

  • crit : the criteria.

Use the function makeSphericalTop:

elts = doc.makeSphericalTop(nbLayers, crit)

GUI command: Simple Concentric (Spherical)

Uniform Concentric

The following data are required:

  • center : center coordinates of the concentric.

  • vx : the base of the concentric (a vector).

  • vz : the axis of the concentric (a vector).

  • rayon : the radius.

  • nbLayers: the number of nested hexahedra.

  • crit : the criteria.

Use the function makeSphericalUni to make a uniform concentric:

elts = doc.makeSphericalUni(center, vx, vz, rayon, nbLayers, crit)

GUI command: Uniform Concentric (Spherical)

Custom Concentric

The following data are required:

  • center : center coordinates of the concentric.

  • vx : the base of the concentric (a vector).

  • vz : the axis of the concentric (a vector).

  • tr : a list of radiuses in ascendant order.

  • crit : the criteria.

Use the function makeSpherical to make a custom concentric grid:

elts = doc.makeSpherical (center, vx, vz, tr, crit)

GUI command: Custom Concentric (Spherical)

Operations on elts: Elements

Example

 1# -*- coding: utf-8 -*-
 2# Copyright (C) 2009-2026  CEA, EDF
 3#
 4# This library is free software; you can redistribute it and/or
 5# modify it under the terms of the GNU Lesser General Public
 6# License as published by the Free Software Foundation; either
 7# version 2.1 of the License, or (at your option) any later version.
 8#
 9# This library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public
15# License along with this library; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17#
18# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19#
20
21####### Concentric (Spherical) Grid Test ##########
22
23import hexablock
24
25
26doc  = hexablock.addDocument ("Spherical Grid Test")
27
28# Simple Spherical Grid -----
29
30nbLayers = 3
31crit = 0
32
33grid0 = doc.makeSphericalTop(nbLayers, crit)
34grid0.saveVtk("makeSphericalTop.vtk")
35
36# Uniform Spherical Grid -----
37
38center = doc.addVertex (0, 0, 10)
39vx     = doc.addVector (1, 0, 0)
40vz     = doc.addVector (0, 1, 1)
41rayon  = 1
42
43grid1 = doc.makeSphericalUni(center, vx, vz, rayon, nbLayers, crit);
44grid1.saveVtk("makeSphericalUni.vtk")
45
46# Custom Spherical Grid-----
47
48tr = [10, 20, 30, 40] # a list of radiuses (one radius for each layer)
49
50grid2 = doc.makeSpherical (center, vx, vz, tr, crit)
51grid2.saveVtk("makeSpherical.vtk")