jvx.geom

## Class PgUtil

- java.lang.Object
- - jvx.geom.PgUtil

-     public class PgUtil
      extends java.lang.Object

  Util class containing static methods which provide analysis about geometries.
  Since:
    JavaView 3.99.045 moved to jvx from dev.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PgUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static double` | `averageEdgeLength(PgElementSet geom)` Deprecated. Use `getEdgeLengths(PgElementSet, null, true).average()` instead.
    `static PdVector` | `calcLinearGradient(PdVector v1, PdVector v2, PdVector v3, PdVector values, PdVector grad)` Computes the gradient of a linear function defined by its values in 3 points in space.
    `static PdVector` | `calcLinearGradient(PgElementSet geom, int elementIdx, PdVector values, PdVector grad)` Calculates the gradient of a linear scalar function whose values is given at three vertices in an element.
    `static PdVector` | `calcLinearGradientNonConforming(PgElementSet geom, int elementIdx, PdVector values, PdVector grad)` Calculates the gradient of a linear scalar function whose values is given at three vertices in an element.
    `static PdVector` | `computeTextureAreas(PgElementSet geom)` Compute area of all triangles in texture space.
    `static PgVectorField[]` | `deriveTexture(PgElementSet geom)` Compute two vector fields as the gradients of the actual textures.
    `static PdVector` | `getEdgeLengths(PgElementSet geom, PdVector edgeLength, boolean bUseBoundaryEdges)` Get array of all edge lengths of a mesh in the traditional neighbourhood based iteration.
    `static PdVector` | `getVertexAngles(PgElementSet geom, PdVector vertexAngle, boolean bUseBoundaryVertices)` Get array of all vertex angles of a mesh ordered by elements.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PgUtil

          public PgUtil()

  - ### Method Detail

    - #### getEdgeLengths

          public static PdVector getEdgeLengths(PgElementSet geom,
                                PdVector edgeLength,
                                boolean bUseBoundaryEdges)

      Get array of all edge lengths of a mesh in the traditional neighbourhood based iteration. If boundary edges are considered, then the length of the output array equals `geom.getNumElementIndices()`; it is less otherwise.
      Parameters:
        `geom` - Input geometry.
        `edgeLength` - Output array of edge lengths. May be null.
        `bUseBoundaryEdges` - Flag to specify whether boundary edges should be considered.

    - #### getVertexAngles

          public static PdVector getVertexAngles(PgElementSet geom,
                                 PdVector vertexAngle,
                                 boolean bUseBoundaryVertices)

      Get array of all vertex angles of a mesh ordered by elements. If boundary vertices are used, then the length of the output array equals `geom.getNumElementIndices()`; it is less otherwise. The method works correct if all elements are convex.
      Parameters:
        `geom` - Input geometry.
        `vertexAngle` - Output array of vertex arrays. May be null.
        `bUseBoundaryVertices` - Flag to specify whether boundary vertices should be considered.

    - #### averageEdgeLength

          public static double averageEdgeLength(PgElementSet geom)

      Deprecated. Use `getEdgeLengths(PgElementSet, null, true).average()` instead.

    - #### calcLinearGradient

          public static PdVector calcLinearGradient(PgElementSet geom,
                                    int elementIdx,
                                    PdVector values,
                                    PdVector grad)

      Calculates the gradient of a linear scalar function whose values is given at three vertices in an element.
      Parameters:
        `geom` - Geometry containing the domain element.
        `elementIdx` - Index of the element. The element will be considered to be a triangle. If it has more vertices, only the first 3 vertices will be used.
        `values` - Values of the scalar function at the vertices. Must have a length of 3.
        `grad` - The gradient will be copied there and returned. May be null or must have a length of 3.

    - #### calcLinearGradientNonConforming

          public static PdVector calcLinearGradientNonConforming(PgElementSet geom,
                                                 int elementIdx,
                                                 PdVector values,
                                                 PdVector grad)

      Calculates the gradient of a linear scalar function whose values is given at three vertices in an element.
      Parameters:
        `geom` - Geometry containing the domain element.
        `elementIdx` - Index of the element. The element will be considered to be a triangle. If it has more vertices, only the first 3 vertices will be used.
        `values` - Values of the scalar function at the vertices. Must have a length of 3.
        `grad` - The gradient will be copied there and returned. May be null or must have a length of 3.

    - #### calcLinearGradient

          public static PdVector calcLinearGradient(PdVector v1,
                                    PdVector v2,
                                    PdVector v3,
                                    PdVector values,
                                    PdVector grad)

      Computes the gradient of a linear function defined by its values in 3 points in space.
      Parameters:
        `v1` - First point in space.
        `v2` - Second point in space.
        `v3` - Third point in space.
        `values` - PdVector containing the 3 function values.
        `grad` - Output for the gradient vector. May be null.
      Returns:
        The gradient of the linear function as a vector of same dimension as input points.

    - #### deriveTexture

          public static PgVectorField[] deriveTexture(PgElementSet geom)

      Compute two vector fields as the gradients of the actual textures.

    - #### computeTextureAreas

          public static PdVector computeTextureAreas(PgElementSet geom)

      Compute area of all triangles in texture space. The area value will be signed, i.e. negative area means, that the texture map for this triangle flips the orientation. Geometry must be triangulated.
      Returns:
        Vector filled with area of each triangle in texture space.

"

The software JavaView? is copyright protected. All Rights Reserved.
"