Class PbGrid2D

Direct Known Subclasses:
PbCartesianGrid2D, PbPolarGrid2D, PbRegularCartesianGrid2D

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

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

  • Method Details

    • getDim

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

      public void setGeometry(int num_x, int num_y, float[] x, float[] y)
      Defines a 2D surface 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. Idem for y array.
    • getNodeIndices

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

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

      public void setGeometry(int num_x, int num_y, float[] x, float[] y, float[] z)
      Defines a 3D surface 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. Idem for y array. The size of z array is always num_x * num_y.
    • getCellIndices

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