JavaView® v2.00.008

jvx.numeric
Class PnEnergy

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jvx.numeric.PnFunction
              |
              +--jvx.numeric.PnEnergy
All Implemented Interfaces:
java.lang.Cloneable, PsUpdateIf, java.io.Serializable
Direct Known Subclasses:
PnAreaEnergy, PnConfEnergy, PnDiriEnergy, PnSpringEnergy

public abstract class PnEnergy
extends PnFunction

Energy functional on triangulated surfaces including gradient and hessian computations.

Surface must contain all boundary information. Domain is only used by some energy functionals to compute the stiffness matrix.

Version:
04.01.01, 2.50 revised (kp) Domain geometry may be missing.
06.06.99, 2.00 revised (kp) Extracted from merged PnAreaEnergy and PnDirichletEnergy.
21.04.99, 1.00 created (kp) from PnDiriEnergy.
Author:
Konrad Polthier
See Also:
Serialized Form

Field Summary
protected  PgBndPolygon[] m_bndList
          Array of boundary curves.
protected  boolean m_bNormal
          Restrict gradient to normal component.
protected  boolean m_bTangential
          Restrict gradient to tangential component.
protected  int m_dim
          Dimension of vertices in image triangulation.
protected  PgElementSet m_domain
          Domain of map, or null.
protected  int[] m_index
          For each interior vertex this index array stores its position in the global vertex array.
protected  int[] m_invIndex
          For each regular vertex this index array stores either a -1 or its position in the interior vertex array m_index.
protected  int m_noiv
          Number of free vertices, determines number of free variables = m_noiv*m_dim.
protected  int m_nop
          Number of vertices in triangulation.
protected  PnStiffMatrix m_stiffMatrix
          Stiffness matrix.
protected  PdVector m_store
          Vector for intermediate storage.
protected  PgElementSet m_surface
          Surface or image of map.
 
Fields inherited from class jvx.numeric.PnFunction
m_bEvaluable
 
Fields inherited from class jv.object.PsObject
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS
 
Constructor Summary
PnEnergy()
           
 
Method Summary
 double eval(PdVector coord)
          Compute Area energy of a coord vector using the stiffness matrix of a PnArea instance.
 PdVector evalGradient(PdVector coord, PdVector gradient)
          Evaluate Area gradient of a coord vector using the stiffness matrix of a PnArea instance.
abstract  PdMatrix evalHessian(PdMatrix hessian)
          Subclass must supply method to compute hessian of energy.
 int getNumOfVariables()
          Get number of free variables of energy.
 PdVector[] getSpectrum(PdVector eValue, PdVector[] eVector)
          Compute eigenvalues and eigenvectors of normalized hessian.
 void init()
          If instance has missing name then assign default name 'object_NUMBER' where number is the total number of already created instances.
 void initSurface(PgElementSet domain, PgElementSet surface)
          Method called from energyMinimizer.minimizeStep() to update the stiffness matrix after conjugate gradient method has returned.
 boolean setSurface(PgElementSet domain, PgElementSet surface)
          Set domain and surface, and initialize energy structure.
 void testEigenvalues()
           
 
Methods inherited from class jvx.numeric.PnFunction
enableEvaluation, isEvaluable
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, update, updatePanels
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_domain

protected PgElementSet m_domain
Domain of map, or null.

m_surface

protected PgElementSet m_surface
Surface or image of map.

m_nop

protected int m_nop
Number of vertices in triangulation.

m_noiv

protected int m_noiv
Number of free vertices, determines number of free variables = m_noiv*m_dim.

m_dim

protected int m_dim
Dimension of vertices in image triangulation.

m_stiffMatrix

protected PnStiffMatrix m_stiffMatrix
Stiffness matrix.

m_bndList

protected PgBndPolygon[] m_bndList
Array of boundary curves.

m_store

protected PdVector m_store
Vector for intermediate storage.

m_bTangential

protected boolean m_bTangential
Restrict gradient to tangential component.

m_bNormal

protected boolean m_bNormal
Restrict gradient to normal component.

m_index

protected int[] m_index
For each interior vertex this index array stores its position in the global vertex array. Length of array is equal to number of interior vertices.

m_invIndex

protected int[] m_invIndex
For each regular vertex this index array stores either a -1 or its position in the interior vertex array m_index. Length of array is equal to number of regular vertices.
Constructor Detail

PnEnergy

public PnEnergy()
Method Detail

init

public void init()
Description copied from class: PsObject
If instance has missing name then assign default name 'object_NUMBER' where number is the total number of already created instances.
Overrides:
init in class PsObject

initSurface

public void initSurface(PgElementSet domain,
                        PgElementSet surface)
Method called from energyMinimizer.minimizeStep() to update the stiffness matrix after conjugate gradient method has returned. E.g. PnDiriEnergy should copy surface into domain if in iteration mode i.e. if dimension of domain and surface are equal.

getNumOfVariables

public int getNumOfVariables()
Get number of free variables of energy.
Overrides:
getNumOfVariables in class PnFunction

setSurface

public boolean setSurface(PgElementSet domain,
                          PgElementSet surface)
Set domain and surface, and initialize energy structure. Method is called from outside whenever domain or surface has been updated. Domain argument maybe null.

eval

public double eval(PdVector coord)
Compute Area energy of a coord vector using the stiffness matrix of a PnArea instance. Method uses the array m_store of PnArea for intermediate storage and modifies its entries.
Overrides:
eval in class PnFunction
Parameters:
coord - Coordinate vector with list of doubles
Returns:
double Energy of coordinate vector
See Also:
vgp.discrete.harmonic.PnAreaEnergy

evalGradient

public PdVector evalGradient(PdVector coord,
                             PdVector gradient)
Evaluate Area gradient of a coord vector using the stiffness matrix of a PnArea instance. Along boundary gradient is modified to fulfill any boundary constraints. Special feature for outside calls: If outside wants to evaluate the gradient without allocating gradient, then instead of gradient a null may be passed. In this case the gradient information is store in an internal variable which is returned as gradient. Handle with care and do not modify size returned gradient.
Overrides:
evalGradient in class PnFunction
Parameters:
coord - Coordinate vector with list of doubles
gradient - Gradient vector to be modified, maybe null.
See Also:
vgp.discrete.harmonic.PnAreaEnergy

evalHessian

public abstract PdMatrix evalHessian(PdMatrix hessian)
Subclass must supply method to compute hessian of energy.
Overrides:
evalHessian in class PnFunction
Parameters:
hessian - Hessian of energy with square size

getSpectrum

public PdVector[] getSpectrum(PdVector eValue,
                              PdVector[] eVector)
Compute eigenvalues and eigenvectors of normalized hessian.
Parameters:
eValue - Vector to store the eigenvalues. Size will be adjusted.
eVector - Possibly empty array to store the eigenvectors. Will be returned.

testEigenvalues

public void testEigenvalues()

JavaView® v2.00.008

The software JavaView® is copyright protected. All Rights Reserved.