In [1]:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np

# For importing pyrst without proper installation
import sys
sys.path.append("/home/shomea/a/andreros/pyrst")

import pyrst
import pyrst.io
import pyrst.utils

In [3]:
nx, ny, nz = 10, 10, 4
G = pyrst.gridprocessing.cartGrid([nx, ny, nz])
print(G)


<PRST grid
  gridType: [u'tensorGrid', u'cartGrid']
  cells: <pyrst.gridprocessing.Cells object at 0x7f80da909850>
  cartDims: [10 10  4]
  gridDim: 3
  faces: <pyrst.gridprocessing.Faces object at 0x7f80da9098d0>
  nodes: <pyrst.gridprocessing.Nodes object at 0x7f80da909890>
>

In [5]:
pyrst.gridprocessing.computeGeometry(G)
print(G)


INFO:pyrst:Computing normals, areas and centroids...
INFO:pyrst:Computing cell volumes and centroids
<PRST grid
  gridType: [u'tensorGrid', u'cartGrid', u'computeGeometry']
  cells: <pyrst.gridprocessing.Cells object at 0x7f80da909850>
  cartDims: [10 10  4]
  gridDim: 3
  faces: <pyrst.gridprocessing.Faces object at 0x7f80da9098d0>
  nodes: <pyrst.gridprocessing.Nodes object at 0x7f80da909890>
>