Class PbGrid3D

Direct Known Subclasses:
PbCartesianGrid3D, PbRegularCartesianGrid3D

public class PbGrid3D extends PbMesh3D
Defines an abstract grid volume mesh. This class defines a mesh of which topology is a regular grid made of num_x * num_y * num_z nodes. Each node with index (i,j,k) in the mesh (except for points along the mesh border) is connected to six points with indices (i+1,j,k), (i,j+1,k), (i-1,j,k), (i,j-1,k), (i,j,k-1), (i,j,k+1).

The values on the mesh nodes are defined by the PbMesh.addValuesSet() method, where argument val is an array of num_x * num_y * num_z floats.

  • Method Details

    • getNodeIndices

      public int[] getNodeIndices(int nod_index)
      Calculates indices i,j,k that verify (i*num_y + j)*num_z + k.
    • getDim

      public int[] getDim()
      Gets the dimensions num_x, num_y, num_z of the grid.
    • getNodeCoord

      public SbVec3f getNodeCoord(int i, int j, int k)
      Gets the coordinates of a node defined by its i,j,k indices on the grid.
    • getCellIndices

      public int[] getCellIndices(int cell_index)
      Calculates indices i,j,k that verify cell_index = (i*(num_y-1) + j)*(num_z-1) + k.
    • setGeometry

      public void setGeometry(int num_x, int num_y, int num_z, float[] x, float[] y, float[] z)
      Defines a volume mesh geometry. The size of the x array depends on the derived class that calls this method. It is either num_x or num_x * num_y * num_z. Idem for y and z array.