jvx.geom

## Class PwBary

- java.lang.Object
- - jvx.geom.PwBary

-     public final class PwBary
      extends java.lang.Object

  Static methods that handle barycentric coordinates on triangulated element sets.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PwBary()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `changeBarycentricOnEdge(PdBary inOut, int locind1, int locind2)` Switch to barycentric coordinates that represent same point on edge wrt the other element adjacent to edge.
    `static boolean` | `changeBarycentricOnEdge(PgElementSet geom, PdBaryDir baryDir, int locInd)` Changes the barycentric representation of a vector in an element with respect to a neighbour element.
    `static int` | `changeBarycentricOnEdge(PgElementSet geom, PdBary inoutBary, int locInd)` A given point in element e will be projected to an adjacent edge and its barycentric coordinates in the neighbour triangle is returned.
    `static double` | `computeLambda(PdBary pos, PdBaryDir dir)` Computes the smallest positive solution of 'pos + lambda*dir lies on boundary' for lambda.
    `static PdBaryDir[]` | `computeNormals(PgPolygonOnElementSet poly, PdBaryDir[] normals, PiVector elementind)` TODO: DOES NOT WORK WITH CLOSED POLYGONS YET!
    `static int` | `equalizeElementIndex(PgPolygonOnElementSet poly, int index1, int index2, PdBary out1, PdBary out2)` Outputs the coordinates of two vertices on a barycentric polygon such that their barycentric coordinates refer to the same element.
    `static PdBary[]` | `getBaryDescriptions(PgElementSet geom, PdBary bary, double eps)` Get the barycentric coordinates of a given point in all elements, which contains this point. (2, if it lies on an edge, more if it lies on a vertex).
    `static int` | `getEdgeIndex(PdBary pos)` Checks for first occurrence of zero (i.e. |.|< eps) in the barycentric vector.
    `static PdBaryDir[]` | `getGeodRepresentation(PgElementSet geom, int origElem, PdBaryDir origDir, int localvertexindex, PiVector elements, PiVector localind)` Calculates the representations of a given vector in all elements of a vertex star by completion to a unnormalized angle of theta/2.
    `static double` | `getOrientedAngle(PgElementSet geom, int elemInd, PdBaryDir a, PdBaryDir b, boolean recalc)` Oriented angle between two barycentric vectors in a triangle.
    `static double` | `getOrientedAngleAtEdge(PgElementSet geom, int elemind1, PdBaryDir dir1, int localedgeind1, int elemind2, PdBaryDir dir2, int localedgeind2, boolean recalc)`
    `static double` | `getOrientedAngleAtVertex(PgElementSet geom, int elemind1, PdBaryDir dir1, int localvertind1, int elemind2, PdBaryDir dir2, int localvertind2, boolean recalc)` Computes the normalized angle between two barycentric vectors based at the same vertex.
    `static PdBaryDir[]` | `getProjRepresentation(PgElementSet geom, int origElem, PdBaryDir origDir, int localvertexindex, PiVector elements, PiVector locind)` Calculates the representations of a given vector in all elements of a vertex star by projection onto the plane the element lays in.
    `static PdBaryDir[]` | `getTransRepresentation(PgElementSet geom, int origElem, PdBaryDir origDir, int localvertexindex, PiVector elements, PiVector locind)` Calculates the representations of a given vector in all elements of a vertex star by parallel translation along a straightest geodesic (half angles).
    `static double` | `getTransRepresentationValues(PgElementSet geom, int origElem, PdBaryDir origDir, int localvertexindex, PiVector elements, PiVector locind, PdVector betas)` Calculates the values (beta,theta) of a given vector in all elements of a vertex star by parallel translation along a straightest geodesic.
    `static PdVector` | `getVector(PdVector dir, PgElementSet geom, PdBaryDir baryDir)` Get the coordinates of a vector from its barycentric coordinates.
    `static PdVector` | `getVertex(PdVector vertex, PgElementSet geom, PdBary bary)` Get the coordinates of a vertex from its barycentric coordinates.
    `static PdVector` | `getVertex(PdVector vertex, PgPolygon polygon, PdBary bary)` Get vertex from barycentric coordinates on a polygon.
    `static double` | `getVertexAngles(PgVertexStar star, PgElementSet geom, PdVector angles)` Calculates inner angles of the elements of a vertex star.
    `static int` | `liesOnEdge(PdBary pos)` Checks if given barycentric position lies within PuMath.EPS distance to the interior of an edge, and away from vertices.
    `static int` | `liesOnVertex(PdBary pos)` Checks if given barycentric position lies within PuMath.EPS range of a vertex, and returns local index of that vertex.
    `static boolean` | `makeBaryDescription(PgElementSet geom, PdBary bary, int newElement, double eps)` Try to make a barycentric description of a point w.r.t. a specidied element in the geometry.
    `static boolean` | `makeCommonBaryDescription(PgElementSet geom, PdBary bary1, PdBary bary2, double eps)` Convert the barycentric coordinates of two points on a surface, such that they are described w.r.t. the same triangle of the surface.
    `static PdBary` | `newVertexBary(int element, int locVertInd)` Make a new PdBary instance representing a vertex on the given element set.
    `static double` | `norm(PgElementSet geom, int elemInd, PdBaryDir x, boolean geometryChanged)` Euclidean norm of two intrinsic (barycentric) vectors.
    `static PdBary` | `projectOntoElement(PgElementSet geom, int elementIdx, PdVector point, PdBary outBary)` Project a point from R^3 to an element of geom in normal direction.
    `static boolean` | `projectOntoElement(PgElementSet geom, int elemInd, PdVector vector, PdBaryDir outdir)` Projects given vector onto elements plane.
    `static PdBary` | `projectOntoElement(PgElementSet geom, int elementIdx, PdVector point, PdVector dir, PdBary outBary)` Project a point from R^3 to an element of geom.
    `static void` | `projectOntoElementEdge(int edgeInd, PdBary bary)` Project the barycentric coordinates from a point to an edge of the barycentric triangle.
    `static void` | `projectOntoElementEdge(PgElementSet geom, PdBary bary, int edgeInd)` Project a point from R^3 to an element edge of geom.
    `static PdBary` | `projectOntoElementSet(PgElementSet geom, PdVector point, PdBary outBary)` Project a point from R^3 to a surface.
    `static double` | `projectOntoPolygon(PdVector vertex, PgPolygon polygon, PdBary bary2D)` Project a vertex onto its nearest point on a given polygon.
    `static void` | `projectToInside(PgElementSet target, PdBary inOutBary)` Projects the given point inside the specified triangle.
    `static int` | `rotateAtEdge(PgElementSet geom, int elem, PdBaryDir dir, int localedgeind, PdBaryDir out, PdBary pos, double angle, boolean recalc)` Rotates a barycentric direction with base point on edge.
    `static int` | `rotateAtVertex(PgElementSet geom, int elemind, int localvertexind, PdBaryDir dir, PdBaryDir outdir, PdBary bary, double angle)` Rotates direction at vertex in same orientation as the star.
    `static void` | `rotateInElement(PgElementSet geom, int elemInd, PdBaryDir dir, double angle, PdBaryDir outdir, boolean bForceRecalc)` Rotates direction in same orientation as the element's.
    `static double` | `scalar(PgElementSet geom, int elemInd, PdBaryDir x, PdBaryDir y, boolean geometryChanged)` Computes scalar product of barycentric directions in world coordinates, that means the scalar product of the vectors in euclidean space.
    `static boolean` | `showsIntoElement(PdBaryDir dir, int vertexindex)` Checks if given barycentric vector shows into its element.
    `static PdBaryDir` | `subBary(PgElementSet geom, PdBary b1, PdBary b2, PdBaryDir outDir)` Substract two points on a surface in barycentric coordinates.
    `static boolean` | `transformBary(PgElementSet geom, int origElem, PdBary origBary, int destElem, PdBary outBary)` Tries to change a barycentric coordinate to the representation of the same space point wrt a different triangle.
    `static void` | `translatePolygonOnElementSet(PgPolygonOnElementSet poly, PdBaryDir[] vf, PiVector vfInd, PdVector distField)` Translates the vertices of the polygon a given distance into a given direction.
    `static PdBary` | `vertexToBary(PgElementSet geom, int vertex, int neighbourElement)` Create barycentric coordinates of a given vertex in a PgElementSet.

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

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

- - ### Constructor Detail

    - #### PwBary

          public PwBary()

  - ### Method Detail

    - #### scalar

          public static double scalar(PgElementSet geom,
                      int elemInd,
                      PdBaryDir x,
                      PdBaryDir y,
                      boolean geometryChanged)

      Computes scalar product of barycentric directions in world coordinates, that means the scalar product of the vectors in euclidean space. The directions have to live on the same element. If geometry and element index are the same as they were at previous call of `scalar` and `!geometryChanged` then some calculations are skipped.
      Parameters:
        `geom` - geometry the barycentric directions live on
        `elemInd` - element the barycentric directions live on
        `x` - one direction
        `y` - other direction
        `geometryChanged` - if `true` all variables are forced to be recalculated; should only be used if the vertex positions may have changed
      Returns:
        scalar product

    - #### norm

          public static double norm(PgElementSet geom,
                    int elemInd,
                    PdBaryDir x,
                    boolean geometryChanged)

      Euclidean norm of two intrinsic (barycentric) vectors. Implemented as copy of the method `PwBary.scalar` and additional square root.
      Parameters:
        `geom` - the geometry the barycentric direction lives on
        `elemInd` - the element the barycentric direction lives on
        `x` - barycentric vector
        `geometryChanged` - if `true` all variables are forced to be recalculated; should only be used if the vertex positions may have changed
      Returns:
        sqrt(< x,x >)
      See Also:
        `scalar(jv.geom.PgElementSet, int, jv.vecmath.PdBaryDir, jv.vecmath.PdBaryDir, boolean)`

    - #### getVertexAngles

          public static double getVertexAngles(PgVertexStar star,
                               PgElementSet geom,
                               PdVector angles)

      Calculates inner angles of the elements of a vertex star. Only for triangulations. User has to ensure that star is already computed, and that geom and angles parameters are not null.
      Parameters:
        `star` - the star
        `geom` - the geometry
        `angles` - output: vertex angles of elements in star, in same order as `PgVertexStar.getElement()`. if necessary it is resized.
      Returns:
        sum of the angles

    - #### getGeodRepresentation

          public static PdBaryDir[] getGeodRepresentation(PgElementSet geom,
                                          int origElem,
                                          PdBaryDir origDir,
                                          int localvertexindex,
                                          PiVector elements,
                                          PiVector localind)

      Calculates the representations of a given vector in all elements of a vertex star by completion to a unnormalized angle of theta/2. Element set must be triangulated.
      Parameters:
        `geom` - triangulation
        `origElem` - element in which the vector is given
        `origDir` - vector that will be translated to the other elements
        `localvertexindex` - local index in `origElem` of the vertex at which the vector is given
        `elements` - output: global element indices of the vertex star
        `localind` - output: local vertex indices of common vertex in elements at vertex star
      Returns:
        array of the calculated directions at success, null else

    - #### getTransRepresentation

          public static PdBaryDir[] getTransRepresentation(PgElementSet geom,
                                           int origElem,
                                           PdBaryDir origDir,
                                           int localvertexindex,
                                           PiVector elements,
                                           PiVector locind)

      Calculates the representations of a given vector in all elements of a vertex star by parallel translation along a straightest geodesic (half angles). Element set must be triangulated.
      Parameters:
        `geom` - triangulation
        `origElem` - element in which the vector is given
        `origDir` - vector that will be translated to the other elements
        `localvertexindex` - the local index in `origElem` of the vertex in which the vector is given
        `elements` - output: global element indices of the vertex star
        `locind` - output: local vertex indices of the vertex star
      Returns:
        array of the calculated directions at success, null else

    - #### getTransRepresentationValues

          public static double getTransRepresentationValues(PgElementSet geom,
                                            int origElem,
                                            PdBaryDir origDir,
                                            int localvertexindex,
                                            PiVector elements,
                                            PiVector locind,
                                            PdVector betas)

      Calculates the values (beta,theta) of a given vector in all elements of a vertex star by parallel translation along a straightest geodesic. Rotate counter-clockwise next edge by angleOfEvaluationPointToEdge - 2*PI/theta*(beta+angle), where angle is the angle between evaluation position and edge. Element set must be triangulated.
      Parameters:
        `geom` - set of elements
        `origElem` - element in which the vector is given
        `origDir` - vector that will be translated to the other elements
        `localvertexindex` - the local index in `origElem` of the vertex in which the vector is given
        `elements` - output: global element indices of the vertex star, beginning with origElem
        `locind` - output: local indices of common vertex of star, beginning with localvertexindex
        `betas` - output: beta values
      Returns:
        theta

    - #### getProjRepresentation

          public static PdBaryDir[] getProjRepresentation(PgElementSet geom,
                                          int origElem,
                                          PdBaryDir origDir,
                                          int localvertexindex,
                                          PiVector elements,
                                          PiVector locind)

      Calculates the representations of a given vector in all elements of a vertex star by projection onto the plane the element lays in. Element set must be triangulated.
      Parameters:
        `geom` - set of elements
        `origElem` - element on which the vector is given
        `origDir` - vector that will be translated to the other elements
        `localvertexindex` - the local index in `origElem` of the vertex in which the vector is given
        `elements` - output: global element indicee of the vertex star
        `locind` - output: local vertex indices of the vertex star
      Returns:
        array of the calculated directions at success, null else

    - #### projectOntoElement

          public static boolean projectOntoElement(PgElementSet geom,
                                   int elemInd,
                                   PdVector vector,
                                   PdBaryDir outdir)

      Projects given vector onto elements plane.
      Parameters:
        `geom` - underlying geometry
        `elemInd` - global element index
        `vector` - in world coordinates
        `outdir` - output: barycentric coordinates of the projected vector
      Returns:
        True, if no error occurs.

    - #### projectOntoElement

          public static PdBary projectOntoElement(PgElementSet geom,
                                  int elementIdx,
                                  PdVector point,
                                  PdBary outBary)

      Project a point from R^3 to an element of geom in normal direction. This method assumes correct element normals.
      Parameters:
        `geom` - Underlying triangulated surface in R^3.
        `elementIdx` - Index of a triangle in geom.
        `point` - Point in R^3 to project.
        `outBary` - Output for projected point. May be null.
      Returns:
        Barycentric coordinates of projected point.

    - #### projectOntoElement

          public static PdBary projectOntoElement(PgElementSet geom,
                                  int elementIdx,
                                  PdVector point,
                                  PdVector dir,
                                  PdBary outBary)

      Project a point from R^3 to an element of geom.
      Parameters:
        `geom` - Underlying triangulated surface in R^3.
        `elementIdx` - Index of a triangle in geom.
        `point` - Point in R^3 to project.
        `dir` - Projection direction.
        `outBary` - Output for projected point. May be null.
      Returns:
        Barycentric coordinates of projected point or null if the triangle is degenerated.

    - #### projectOntoElementEdge

          public static void projectOntoElementEdge(PgElementSet geom,
                                    PdBary bary,
                                    int edgeInd)

      Project a point from R^3 to an element edge of geom. If `outBary` is `null`, a new `PdBary` is created and returned.
      Parameters:
        `geom` - Base geometry.
        `bary` - Barycentric coordinates of point to be projected. Will be modified.
        `edgeInd` - Target local edge index.

    - #### projectToInside

          public static void projectToInside(PgElementSet target,
                             PdBary inOutBary)

      Projects the given point inside the specified triangle. The result is the point of the triangle with non-negative barycentric coordinates and the smallest Euclidean distance to the given point.
      Parameters:
        `target` - Base geometry.
        `inOutBary` - Point in barycentric coordinates wrt the triangle in which it should be projected.

    - #### projectOntoElementEdge

          public static void projectOntoElementEdge(int edgeInd,
                                    PdBary bary)

      Project the barycentric coordinates from a point to an edge of the barycentric triangle.
      Parameters:
        `edgeInd` - Target edge index.
        `bary` - Input and output point.

    - #### projectOntoElementSet

          public static PdBary projectOntoElementSet(PgElementSet geom,
                                     PdVector point,
                                     PdBary outBary)

      Project a point from R^3 to a surface. This method performs a linear run over all elements.

    - #### projectOntoPolygon

          public static double projectOntoPolygon(PdVector vertex,
                                  PgPolygon polygon,
                                  PdBary bary2D)

      Project a vertex onto its nearest point on a given polygon. This method performs a linear run over all vertices of the polygon.
      Parameters:
        `vertex` - Vertex to project.
        `polygon` - Given polygon.
        `bary2D` - Barycentric coordinates of projected vertex will be copied here.
      Returns:
        Distance of the vertex to the polygon.

    - #### getOrientedAngle

          public static double getOrientedAngle(PgElementSet geom,
                                int elemInd,
                                PdBaryDir a,
                                PdBaryDir b,
                                boolean recalc)

      Oriented angle between two barycentric vectors in a triangle. User has to ensure that geometry is not null, element index is valid, a and b are not null and have size 3.
      THIS METHOD IS NOT THREAD SAFE! SIMULTANEOUS CALLS IN DIFFERENT THREADS MAY PRODUCE WEIRD RESULTS!
      Parameters:
        `geom` - underlying geometry
        `elemInd` - global element index
        `a` - first vector
        `b` - second vector
        `recalc` - used for scalar product
      Returns:
        oriented angle in [-PI, PI]; negative if `a` must be rotated against the orientation of the triangle; -3*PI if an error occurred
      See Also:
        `scalar(jv.geom.PgElementSet, int, jv.vecmath.PdBaryDir, jv.vecmath.PdBaryDir, boolean)`

    - #### getOrientedAngleAtVertex

          public static double getOrientedAngleAtVertex(PgElementSet geom,
                                        int elemind1,
                                        PdBaryDir dir1,
                                        int localvertind1,
                                        int elemind2,
                                        PdBaryDir dir2,
                                        int localvertind2,
                                        boolean recalc)

      Computes the normalized angle between two barycentric vectors based at the same vertex. (The angle that the first vector must be rotated around the vertex to become the second vertex.) If vertex star is closed, the angle is a positive angle. If the vertex star is NOT closed, the sign of the returned angle tells in which direction the first vector must be rotated such that it doesn't cross the boundary of the star.
      The element indices of the two vectors must be different for this method! Use `getOrientedAngle` if this is not the case. Furthermore they must point into the element they lie on.
      THIS METHOD IS NOT THREAD SAFE! SIMULTANEOUS CALLS IN DIFFERENT THREADS MAY PRODUCE WEIRD RESULTS!

    - #### getOrientedAngleAtEdge

          public static double getOrientedAngleAtEdge(PgElementSet geom,
                                      int elemind1,
                                      PdBaryDir dir1,
                                      int localedgeind1,
                                      int elemind2,
                                      PdBaryDir dir2,
                                      int localedgeind2,
                                      boolean recalc)

    - #### rotateInElement

          public static void rotateInElement(PgElementSet geom,
                             int elemInd,
                             PdBaryDir dir,
                             double angle,
                             PdBaryDir outdir,
                             boolean bForceRecalc)

      Rotates direction in same orientation as the element's.
      Parameters:
        `geom` - underlying geometry
        `elemInd` - element on that vector lies
        `dir` - barycentric direction
        `angle` - rad
        `outdir` - output: result of rotation; may be same instance as dir
        `bForceRecalc` - used for scalar product
      See Also:
        `scalar(jv.geom.PgElementSet, int, jv.vecmath.PdBaryDir, jv.vecmath.PdBaryDir, boolean)`

    - #### rotateAtVertex

          public static int rotateAtVertex(PgElementSet geom,
                           int elemind,
                           int localvertexind,
                           PdBaryDir dir,
                           PdBaryDir outdir,
                           PdBary bary,
                           double angle)

      Rotates direction at vertex in same orientation as the star. An angle of 2*Pi means a complete turn around the star.
      Parameters:
        `geom` - underlying geometry
        `elemind` - global element index
        `localvertexind` - local index of vertex that is base of the rotation
        `dir` - original vector
        `outdir` - output: result of rotation
        `bary` - output: barycentric coordinates of the base point of the result
        `angle` - normalized angle [0;2*PI] ^= 360°
      Returns:
        global element index where outdir lies on, or -1 if either an error occurred or rotation would be outside of element set (if vertex star is not closed)

    - #### rotateAtEdge

          public static int rotateAtEdge(PgElementSet geom,
                         int elem,
                         PdBaryDir dir,
                         int localedgeind,
                         PdBaryDir out,
                         PdBary pos,
                         double angle,
                         boolean recalc)

      Rotates a barycentric direction with base point on edge.
      Parameters:
        `geom` - underlying triangulation
        `elem` - element index of barycentric direction
        `dir` - barycentric direction with base point on element edge (pointing into element)
        `localedgeind` - local index in element of the edge the direction lies on
        `out` - output: rotated barycentric direction
        `pos` - input/output: base point is converted to new element if necessary
        `angle` - in [0;2*PI]
      Returns:
        element index of output direction

    - #### showsIntoElement

          public static boolean showsIntoElement(PdBaryDir dir,
                                 int vertexindex)

      Checks if given barycentric vector shows into its element.
      Parameters:
        `dir` - barycentric vector that shall be checked
        `vertexindex` - local vertex index that is the base of the direction
      Returns:
        true if barycentric vector shows into its element

    - #### liesOnVertex

          public static int liesOnVertex(PdBary pos)

      Checks if given barycentric position lies within PuMath.EPS range of a vertex, and returns local index of that vertex. Method works for any dimension of barycentric coordinates.
      Parameters:
        `pos` - barycentric point, must not be null
      Returns:
        local index if pos lies close to a vertex, -1 otherwise.

    - #### liesOnEdge

          public static int liesOnEdge(PdBary pos)

      Checks if given barycentric position lies within PuMath.EPS distance to the interior of an edge, and away from vertices. Returns local index of vertex opposite to edge, or -1 if position is not close to an edge.

      Method works for triangles and higher dimensional simplices only.

      Parameters:
        `pos` - barycentric position
      Returns:
        local vertex index of vertex opposite to edge, or -1 if not on edge.

    - #### computeLambda

          public static double computeLambda(PdBary pos,
                             PdBaryDir dir)

      Computes the smallest positive solution of 'pos + lambda*dir lies on boundary' for lambda. You have to ensure that pos and dir have same size and are not null. pos has to lie inside the simplex.
      Parameters:
        `pos` - Must not be null. Must have same size as dir.
        `dir` - Must not be null. Must have same size as pos.
      Returns:
        Double.POSITIVE_INFINITY if dir is zero and pos does not already lie on boundary.

    - #### getEdgeIndex

          public static int getEdgeIndex(PdBary pos)

      Checks for first occurrence of zero (i.e. |.|< eps) in the barycentric vector.
      Parameters:
        `pos` - must not be null
      Returns:
        -1 if point lies strictly inside or outside the simplex.

    - #### computeNormals

          public static PdBaryDir[] computeNormals(PgPolygonOnElementSet poly,
                                   PdBaryDir[] normals,
                                   PiVector elementind)

      TODO: DOES NOT WORK WITH CLOSED POLYGONS YET!

    - #### translatePolygonOnElementSet

          public static void translatePolygonOnElementSet(PgPolygonOnElementSet poly,
                                          PdBaryDir[] vf,
                                          PiVector vfInd,
                                          PdVector distField)

      Translates the vertices of the polygon a given distance into a given direction. Note: This will produce a polygon that does no longer fully live on the element set, only the vertices are still somewhere on the element set. This makes the PolygonOnElementSet useless for most other methods that handle PolygonOnElementSets (that usually require a polygon vertex where the polygon crosses a geometry edge).
      Parameters:
        `poly` - polygon to translate
        `vf` - normalized barycentric directions for each vertex of polygon
        `vfInd` - element indices for the barycentric directions
        `distField` - the distance to move for each polygon vertex

    - #### transformBary

          public static boolean transformBary(PgElementSet geom,
                              int origElem,
                              PdBary origBary,
                              int destElem,
                              PdBary outBary)

      Tries to change a barycentric coordinate to the representation of the same space point wrt a different triangle.

    - #### equalizeElementIndex

          public static int equalizeElementIndex(PgPolygonOnElementSet poly,
                                 int index1,
                                 int index2,
                                 PdBary out1,
                                 PdBary out2)

      Outputs the coordinates of two vertices on a barycentric polygon such that their barycentric coordinates refer to the same element.

      Parameters:
        `poly` - the polygon on a triangulation
        `index1` - first point (index in poly)
        `index2` - second point (index in poly)
      Returns:
        common element index or -1

    - #### changeBarycentricOnEdge

          public static void changeBarycentricOnEdge(PdBary inOut,
                                     int locind1,
                                     int locind2)

      Switch to barycentric coordinates that represent same point on edge wrt the other element adjacent to edge. Only triangles. This method does not test, if the neighbour element exists and also does not adapt the element index of inOut.
      Parameters:
        `inOut` - must have a zero at locind1, result is put here
        `locind1` - local index of edge in origin triangle
        `locind2` - local index of edge in destination triangle

    - #### changeBarycentricOnEdge

          public static int changeBarycentricOnEdge(PgElementSet geom,
                                    PdBary inoutBary,
                                    int locInd)

      A given point in element e will be projected to an adjacent edge and its barycentric coordinates in the neighbour triangle is returned.

      This method works differently than changeBarycentricOnEdge(PdBary, int, int), since it also handles the case if the two elements are differently oriented. Furthermore, the elementInd will be set to the new element.
      Parameters:
        `geom` - A geometry.
        `inoutBary` - Barycentric coordinates of a point on the surface.
        `locInd` - Local edge index for the current element (inoutBary.getElementInd()).
      Returns:
        Local index of the edge resp neighbour element or -1 if surface boundary has been reached.

    - #### changeBarycentricOnEdge

          public static boolean changeBarycentricOnEdge(PgElementSet geom,
                                        PdBaryDir baryDir,
                                        int locInd)

      Changes the barycentric representation of a vector in an element with respect to a neighbour element.
      Parameters:
        `geom` - Given element set.
        `baryDir` - Barycentric coordinates of a vector on the geometry. Used for input and output.
        `locInd` - Local neighbour index for an incident element. The barycentric coordinates will be rewritten with respect to this neighbour element.

    - #### getBaryDescriptions

          public static PdBary[] getBaryDescriptions(PgElementSet geom,
                                     PdBary bary,
                                     double eps)

      Get the barycentric coordinates of a given point in all elements, which contains this point. (2, if it lies on an edge, more if it lies on a vertex).
      Parameters:
        `geom` - A geometry.
        `bary` - Barycentric coordinates of a point on geom.
        `eps` - Accuracy of the calculation. Points with a distance of < eps to a vertex/edge will be treated as lying on that vertex/edge.
      Returns:
        Barycentric coordinates of the given point with respect to all incident elements.

    - #### makeBaryDescription

          public static boolean makeBaryDescription(PgElementSet geom,
                                    PdBary bary,
                                    int newElement,
                                    double eps)

      Try to make a barycentric description of a point w.r.t. a specidied element in the geometry.
      Parameters:
        `geom` - Input geometry.
        `bary` - Barycentric point on geom. If possible, the new barycentric coordinates will be copied here.
        `newElement` - New element index.
        `eps` - Epsilon tolerance.
      Returns:
        True, if bary can be expressed w.r.t. the new element.

    - #### makeCommonBaryDescription

          public static boolean makeCommonBaryDescription(PgElementSet geom,
                                          PdBary bary1,
                                          PdBary bary2,
                                          double eps)

      Convert the barycentric coordinates of two points on a surface, such that they are described w.r.t. the same triangle of the surface. If this is possible, the input coordinates will be changed to that representation.
      Parameters:
        `geom` - Underlying surface.
        `bary1` - First point.
        `bary2` - Second point.
        `eps` - Accuracy of the test if a point lies on an edge.
      Returns:
        True, if the points could be represented w.r.t. the same triangle.

    - #### getVertex

          public static PdVector getVertex(PdVector vertex,
                           PgElementSet geom,
                           PdBary bary)

      Get the coordinates of a vertex from its barycentric coordinates.
      Parameters:
        `vertex` - Output vector for the coordinates of the point. May be null.
        `geom` - Given geometry.
        `bary` - Barycentric coordinates of the point on the geometry.
      Returns:
        either argument vertex, or newly created vertex if argument was null.

    - #### getVertex

          public static PdVector getVertex(PdVector vertex,
                           PgPolygon polygon,
                           PdBary bary)

      Get vertex from barycentric coordinates on a polygon.
      Parameters:
        `vertex` - Output vector for the coordinates of the point. May be null.
        `polygon` - Given polygon.
        `bary` - Barycentric coordinates. Must be of dimension 2.
      Returns:
        either argument vertex, or newly created vertex if argument was null.

    - #### getVector

          public static PdVector getVector(PdVector dir,
                           PgElementSet geom,
                           PdBaryDir baryDir)

      Get the coordinates of a vector from its barycentric coordinates.
      Parameters:
        `dir` - Output direction for the coordinates of the vector. May be null.
        `geom` - Geometry.
        `baryDir` - Barycentric coordinates of the vector on the geometry.
      Returns:
        either argument vector, or newly created vector if argument was null.

    - #### newVertexBary

          public static PdBary newVertexBary(int element,
                             int locVertInd)

      Make a new PdBary instance representing a vertex on the given element set.
      Parameters:
        `element` - Element index in the element set.
        `locVertInd` - Local vertex index of the vertex in the element.
      Returns:
        A new PdBary representing the vertex.

    - #### subBary

          public static PdBaryDir subBary(PgElementSet geom,
                          PdBary b1,
                          PdBary b2,
                          PdBaryDir outDir)

      Substract two points on a surface in barycentric coordinates. The two points must lie in the same triangle or on an edge or vertex, such that they can be written w.r.t. the same triangle.

    - #### vertexToBary

          public static PdBary vertexToBary(PgElementSet geom,
                            int vertex,
                            int neighbourElement)

      Create barycentric coordinates of a given vertex in a PgElementSet.

"

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