jvx.vector

## Class PwHodge

- java.lang.Object
- - jv.object.PsObject
  - - jvx.project.PjWorkshop
    - - jvx.vector.PwHodge

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf

      public class PwHodge
      extends PjWorkshop

  Study Hodge decomposition of discrete vector fields. A vector field is split in gradient and rotation free parts with a remaining harmonic component.
  See Also:
    Serialized Form
  Author:
    Konrad Polthier, Eike Preuss
  Version:
    27.10.12, 4.00 revised (kp) Full revision of 2d case.
    07.10.07, 3.50 revised (kp) Full revision of update mechanism and optimization.
    09.12.06, 3.00 revised (kp) Moved to jvx.vector from jvx.geom.
    06.05.03, 2.80 revised (ep) Beta methods for computing rotational features.
    19.06.02, 2.70 revised (ep) Added method `getZExtrema`.
    28.01.02, 2.60 revised (ep) New workshop classes and internationalization.
    28.05.01, 2.50 revised (ep) Get displays WITH FRAME from viewer, initialize 0-gradient properties at begin.
    17.05.01, 2.40 revised (ep) 5 displays to 3 displays, corrected update of minimizers.
    11.12.00, 2.30 revised (ep) Made displays available to other classes.
    10.12.00, 2.20 revised (ep) May change zero bounds condition for U and W separately.
    06.06.00, 2.10 revised (ep) Moved to separate workshop.
    06.03.00, 2.00 revised (ep) Corrected updates and made various changes.
    24.11.99, 1.00 created (kp).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DETECT_SADDLES`
    `static int` | `DETECT_SINKS_SOURCES`
    `static int` | `DETECT_VORTICES`

    - ### Fields inherited from class jv.object.PsObject

      `HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS`

    - ### Fields inherited from interface jv.project.PjWorkshopIf

      `MODE_BUG, MODE_STANDARD, MODE_VALIDATE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PwHodge()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Removes geometry and displays from workshop, and closes super workshop.
    `void` | `decompose()` Initiates minimization of the two energies that produce the three parts of the decomposition.
    `int` | `getDetectionFlags()` Compare the DETECT_... constants.
    `PvDisplayIf` | `getDisplay(int dispIndex)` Returns one of the three displays: rotation-free, divergence-free and harmonic component and their features.
    `PgVectorField` | `getDivergenceFree()` Call method `minimize()` before using this method.
    `PgVectorField` | `getHarmonic()` Call method `minimize()` before using this method.
    `PgElementSet` | `getPotentialU()` Call method `minimize()` before using this method.
    `PgElementSet` | `getPotentialW()` Call method `minimize()` before using this method.
    `PgVectorField` | `getRotationFree()` Call method `minimize()` before using this method.
    `PgSurfaceGraph` | `getUGraph()` Call method `minimize()` before using this method.
    `int` | `getVectorFieldIndex()` Get index of vector field of domain geometry.
    `boolean` | `getVisibleComponent(int index)`
    `boolean` | `getVisibleFeat(int index)`
    `boolean` | `getVisibleGraph(int index)`
    `PgSurfaceGraph` | `getWGraph()` Call method `minimize()` before using this method.
    `boolean` | `getZeroBoundsU()`
    `boolean` | `getZeroBoundsV()`
    `static PgPointSet` | `getZExtrema(PgElementSet surface, java.awt.Color min, java.awt.Color other, java.awt.Color max, double eps)` Extract local extreme with respect to z-direction and return as new point set.
    `void` | `init()` Initialize and reset project, stops the running animation if any.
    `boolean` | `isEnabledAutoDecompose()` Determines if automatic Hodge decomposition on updates of geometry is enabled.
    `boolean` | `isShowingDisplay(int dispIndex)` Handling of the displays that show the vector field components and the potentials.
    `void` | `removeGeometry()` Remove the assigned geometry and its backup clone.
    `void` | `reset()` TODO: Not implemented yet.
    `void` | `selectVectorField(int vfIndex)` Selects a vector field of the underlying domain.
    `void` | `setDetectionFlags(int flag)` Sets which features to include in feature detection.
    `void` | `setEnabledAutoDecompose(boolean flag)` Automatically compute Hodge decomposition on updates of geometry.
    `void` | `setGeometry(PgGeometry geom)` Assign a geometry on which this workshop operates, and create a backup clone of the geometry.
    `void` | `setIconScale(double value)` Scales the icons that are drawn for sinks, sources, vortices and saddles.
    `void` | `setVisibleComponent(int index, boolean visible)`
    `void` | `setVisibleFeat(int index, boolean visible)`
    `void` | `setVisibleGraph(int index, boolean visible)`
    `void` | `setZeroBounds(boolean flag)` Whether the two resulting potentials should be zero on the boundary.
    `void` | `setZeroBoundsU(boolean flag)` Sets zero boundary condition of potential of rotation free part (so this vector field is tangential to boundary edges if set).
    `void` | `setZeroBoundsV(boolean flag)` Sets zero boundary condition of potential of divergence free part (so this part is orthogonal to boundary edges if set).
    `void` | `showDisplay(int dispIndex, boolean bVisible)` Handling of the displays that show the vector field components and the potentials.
    `void` | `stop()` Stop minimization explicitly before it is completed.
    `boolean` | `update(java.lang.Object event)` Update this workshop when a depend child changes.

    - ### Methods inherited from class jvx.project.PjWorkshop

      `cancel, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, setDisplay, setDisplays, setModal, setMode, setStandalone, setViewer`

    - ### Methods inherited from class jv.object.PsObject

      `addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels`

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

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

    - ### Methods inherited from interface jv.object.PsUpdateIf

      `getFather, getName, setParent`

- - ### Field Detail

    - #### DETECT_SINKS_SOURCES

          public static final int DETECT_SINKS_SOURCES

      See Also:
        Constant Field Values

    - #### DETECT_VORTICES

          public static final int DETECT_VORTICES

      See Also:
        Constant Field Values

    - #### DETECT_SADDLES

          public static final int DETECT_SADDLES

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### PwHodge

          public PwHodge()

  - ### Method Detail

    - #### init

          public void init()

      Description copied from class: `PjWorkshop`
      Initialize and reset project, stops the running animation if any. Does not reset any registered display nor geometry. They must be reset individually in each subclass.
      Overrides:
        `init` in class `PjWorkshop`

    - #### close

          public void close()

      Removes geometry and displays from workshop, and closes super workshop.
      Overrides:
        `close` in class `PjWorkshop`
      Version:
        06.08.05, 1.10 revised (kp) Code tuned.

    - #### reset

          public void reset()

      TODO: Not implemented yet.
      Overrides:
        `reset` in class `PjWorkshop`

    - #### removeGeometry

          public void removeGeometry()

      Description copied from class: `PjWorkshop`
      Remove the assigned geometry and its backup clone. Subclasses frequently overwrite this method but are advised to call this method.
      Overrides:
        `removeGeometry` in class `PjWorkshop`

    - #### setGeometry

          public void setGeometry(PgGeometry geom)

      Description copied from class: `PjWorkshop`
      Assign a geometry on which this workshop operates, and create a backup clone of the geometry. The backup geometry is restored if the workshop is canceled.

      Subclasses frequently overwrite this method but are advised to call this method.

      Specified by:
        `setGeometry` in interface `PjWorkshopIf`
      Overrides:
        `setGeometry` in class `PjWorkshop`
      Parameters:
        `geom` - the workshop modifies this geometry.

    - #### update

          public boolean update(java.lang.Object event)

      Update this workshop when a depend child changes.
      Specified by:
        `update` in interface `PsUpdateIf`
      Overrides:
        `update` in class `PjWorkshop`
      Parameters:
        `event` - sender of this update.
      Returns:
        true if update was correctly handled by superclass.
      See Also:
        `PsObject.setParent(PsUpdateIf)`, `PsObject.getFather()`, `PsObject.addUpdateListener(PsUpdateIf)`

    - #### getVectorFieldIndex

          public int getVectorFieldIndex()

      Get index of vector field of domain geometry.

    - #### selectVectorField

          public void selectVectorField(int vfIndex)

      Selects a vector field of the underlying domain.
      Parameters:
        `vfIndex` - Select element based vector field of current geometry

    - #### setZeroBounds

          public void setZeroBounds(boolean flag)

      Whether the two resulting potentials should be zero on the boundary. That means that the vector field components are orthogonal and tangential to the boundary edges respectively.

    - #### setZeroBoundsU

          public void setZeroBoundsU(boolean flag)

      Sets zero boundary condition of potential of rotation free part (so this vector field is tangential to boundary edges if set).

    - #### getZeroBoundsU

          public boolean getZeroBoundsU()

    - #### setZeroBoundsV

          public void setZeroBoundsV(boolean flag)

      Sets zero boundary condition of potential of divergence free part (so this part is orthogonal to boundary edges if set).

    - #### getZeroBoundsV

          public boolean getZeroBoundsV()

    - #### isEnabledAutoDecompose

          public boolean isEnabledAutoDecompose()

      Determines if automatic Hodge decomposition on updates of geometry is enabled.
      Returns:
        true if auto Hodge decomposition is enabled

    - #### setEnabledAutoDecompose

          public void setEnabledAutoDecompose(boolean flag)

      Automatically compute Hodge decomposition on updates of geometry.
      Parameters:
        `flag` - true to enable automatic Hodge decomposition

    - #### getRotationFree

          public PgVectorField getRotationFree()

      Call method `minimize()` before using this method.

    - #### getDivergenceFree

          public PgVectorField getDivergenceFree()

      Call method `minimize()` before using this method.

    - #### getHarmonic

          public PgVectorField getHarmonic()

      Call method `minimize()` before using this method.

    - #### getPotentialU

          public PgElementSet getPotentialU()

      Call method `minimize()` before using this method.
      Returns:
        potential of rotation free part

    - #### getPotentialW

          public PgElementSet getPotentialW()

      Call method `minimize()` before using this method.
      Returns:
        potential of divergence free part

    - #### getUGraph

          public PgSurfaceGraph getUGraph()

      Call method `minimize()` before using this method.
      Returns:
        potential of rotation free part

    - #### getWGraph

          public PgSurfaceGraph getWGraph()

      Call method `minimize()` before using this method.
      Returns:
        potential of divergence free part

    - #### setVisibleComponent

          public void setVisibleComponent(int index,
                                          boolean visible)

    - #### getVisibleComponent

          public boolean getVisibleComponent(int index)

    - #### setVisibleGraph

          public void setVisibleGraph(int index,
                                      boolean visible)

    - #### getVisibleGraph

          public boolean getVisibleGraph(int index)

    - #### setVisibleFeat

          public void setVisibleFeat(int index,
                                     boolean visible)

    - #### getVisibleFeat

          public boolean getVisibleFeat(int index)

    - #### setDetectionFlags

          public void setDetectionFlags(int flag)

      Sets which features to include in feature detection. Default is to detect nothing (flag==0).
      Parameters:
        `flag` - binary flag; combine the DETECT_... constants with binary OR operator.

    - #### getDetectionFlags

          public int getDetectionFlags()

      Compare the DETECT_... constants.
      See Also:
        `setDetectionFlags(int)`

    - #### setIconScale

          public void setIconScale(double value)

      Scales the icons that are drawn for sinks, sources, vortices and saddles.
      Parameters:
        `value` - default is 1.

    - #### isShowingDisplay

          public boolean isShowingDisplay(int dispIndex)

      Handling of the displays that show the vector field components and the potentials.

    - #### showDisplay

          public void showDisplay(int dispIndex,
                                  boolean bVisible)

      Handling of the displays that show the vector field components and the potentials.

    - #### getDisplay

          public PvDisplayIf getDisplay(int dispIndex)

      Returns one of the three displays: rotation-free, divergence-free and harmonic component and their features.
      Parameters:
        `dispIndex` - 0-2

    - #### decompose

          public void decompose()

      Initiates minimization of the two energies that produce the three parts of the decomposition. As the minimization is done in separate threads this method perhaps returns without instant effect. The update method of the parent of this PwHodge object is called with this object as argument when the computation of the vector field parts is finished.

      A call of minimize() will terminate instantly, if there is already an unterminated minimization process running at the moment!!! To ensure that a new minimization is initiated, call `stop()` first and then `minimize()`!

    - #### stop

          public void stop()

      Stop minimization explicitly before it is completed. `update(this)` needs to be called to inform info panel.

    - #### getZExtrema

          public static PgPointSet getZExtrema(PgElementSet surface,
                                               java.awt.Color min,
                                               java.awt.Color other,
                                               java.awt.Color max,
                                               double eps)

      Extract local extreme with respect to z-direction and return as new point set.

"

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