public class PgUtil
extends java.lang.Object
Constructor and Description |
---|
PgUtil() |
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 void |
compactTexture(PdVector[][] texture)
Translate texture coordinates of each element by an integer vector, such that the texture
coordinates are close to 0.
|
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.
|
public static PdVector getEdgeLengths(PgElementSet geom, PdVector edgeLength, boolean bUseBoundaryEdges)
geom.getNumElementIndices()
; it is less otherwise.geom
- Input geometry.edgeLength
- Output array of edge lengths. May be null.bUseBoundaryEdges
- Flag to specify whether boundary edges should be considered.public static PdVector getVertexAngles(PgElementSet geom, PdVector vertexAngle, boolean bUseBoundaryVertices)
geom.getNumElementIndices()
; it is less otherwise.
The method works correct if all elements are convex.geom
- Input geometry.vertexAngle
- Output array of vertex arrays. May be null.bUseBoundaryVertices
- Flag to specify whether boundary vertices should be considered.public static double averageEdgeLength(PgElementSet geom)
getEdgeLengths(PgElementSet, null, true).average()
instead.public static PdVector calcLinearGradient(PgElementSet geom, int elementIdx, PdVector values, PdVector grad)
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.public static PdVector calcLinearGradientNonConforming(PgElementSet geom, int elementIdx, PdVector values, PdVector grad)
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.public static PdVector calcLinearGradient(PdVector v1, PdVector v2, PdVector v3, PdVector values, PdVector grad)
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.public static void compactTexture(PdVector[][] texture)
public static PgVectorField[] deriveTexture(PgElementSet geom)
public static PdVector computeTextureAreas(PgElementSet geom)
"