Class PbTriangleMesh2D

All Implemented Interfaces:
Cloneable

public class PbTriangleMesh2D extends PbIndexedMesh2D implements Cloneable
Defines a surface mesh of triangles. Class to define an indexed 2D mesh made up of triangles cells. This mesh is defined by a list of triangles. Each triangles is defined by 3 indices of nodes.

The nodes coordinates are defined by 2 (or 3) arrays x_nod, y_nod, (and z_nod) of num_nodes floats. The triangles are defined by the array triangle_index of num_triangles*3 integers. triangle_index[(n*3)+p] is the p-th node index of the n-th triangle of the mesh (0 <= p <= 3).

Each edge of a triangle may have 2 references in the mesh, that is, one edge is common to 2 triangles. The edges which are referred to once in the mesh define the limits of the mesh.

The geometry of this mesh can be defined also from a points field. In this case the Voronoi method is used to build the triangle mesh.

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

  • Constructor Details

    • PbTriangleMesh2D

      public PbTriangleMesh2D()
      Calls PbTriangleMesh2D(true).
    • PbTriangleMesh2D

      public PbTriangleMesh2D(int num_nodes, float[] x_nod, float[] y_nod, float[] z_nod, int num_triangles, int[] triangle_index)
      Calls PbTriangleMesh2D(num_nodes, x_nod, y_nod, z_nod, num_triangles, triangle_index, true).
    • PbTriangleMesh2D

      public PbTriangleMesh2D(int num_nodes, float[] x_nod, float[] y_nod, int num_triangles, int[] triangle_index)
      Calls PbTriangleMesh2D(num_nodes, x_nod, y_nod, num_triangles, triangle_index, true).
    • PbTriangleMesh2D

      public PbTriangleMesh2D(PbTriangleMesh2D mesh)
      Copy constructor.
    • PbTriangleMesh2D

      public PbTriangleMesh2D(boolean isDataDuplicate)
      Constructor of a default simple mesh. See also PbMesh for more explanations about data duplication.
    • PbTriangleMesh2D

      public PbTriangleMesh2D(int num_nodes, float[] x_nod, float[] y_nod, int num_triangles, int[] triangle_index, boolean is_data_duplicate)
      Constructor of a 2D surface mesh. See also PbMesh for more explanations about data duplication.
    • PbTriangleMesh2D

      public PbTriangleMesh2D(int num_nodes, float[] x_nod, float[] y_nod, float[] z_nod, int num_triangles, int[] triangle_index, boolean is_data_duplicate)
      Constructor of a 3D surface mesh. See also PbMesh for more explanations about data duplication.
  • Method Details

    • clone

      public Object clone()
      Overrides:
      clone in class PbIndexedMesh2D
    • setGeometry

      public void setGeometry(int num_nodes, float[] x_nod, float[] y_nod, float[] z_nod, int num_triangles, int[] triangle_index)
      Sets a new 3D geometry.
    • setGeometry

      public void setGeometry(int numPoints, float[] xPointsField, float[] yPointsField)
      Set a new 2D geometry from a points field. The triangulation is realized by the DELAUNAY method.
    • setGeometry

      public void setGeometry(int num_nodes, float[] x_nod, float[] y_nod, int num_triangles, int[] triangle_index)
      Sets a new 2D geometry.