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(PdVector v0,
PdVector v1,
PdVector v2,
PdVector v3,
PdVector values,
PdVector grad)
Computes the gradient of a linear function in R^3 defined by its values in 4 points.
|
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 |
calcLinearGradient(PgTetraSet geom,
int tetraInd,
PdVector values,
PdVector grad)
Calculates the gradient of a linear scalar function whose values is given
at four vertices in a tetra.
|
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.
|
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 PdVector calcLinearGradient(PgTetraSet geom, int tetraInd, PdVector values, PdVector grad)
geom
- Geometry containing the domain tetraset.tetraInd
- Index of the tetra.values
- Values of the scalar function at the vertices. Must have a length of 4.grad
- The gradient will be copied there and returned. May be null or must have
a length of 4.public static PdVector calcLinearGradient(PdVector v0, PdVector v1, PdVector v2, PdVector v3, PdVector values, PdVector grad)
w1 = v1-v0, w2 = v2-v0, w3 = v3-v0
grad = g + ((s2-s0) - <g,w3>)(w1 x w2) *6/volume(tet), with
g := gradient in plane (w1,w2)
v1
- First point in space.v2
- Second point in space.v3
- Third point in space.values
- PdVector containing the 4 function values.grad
- Output for the gradient vector. May be null.public static PgVectorField[] deriveTexture(PgElementSet geom)
public static PdVector computeTextureAreas(PgElementSet geom)
"