public abstract class PnEnergy extends PnFunction
Surface must contain all boundary information. Domain is only used by some energy functionals to compute the stiffness matrix.
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
Constructor and Description |
---|
PnEnergy() |
Modifier and Type | Method and Description |
---|---|
boolean |
computeNormalizedHessian(PdMatrix hessian,
PdMatrix mass)
Compute L2 normalized hessian.
|
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.
|
PdMatrix |
evalHessian(PdMatrix hessian)
Subclass must supply method to compute hessian of energy.
|
PdMatrix |
getConstrain() |
int |
getNumOfVariables()
Get number of free variables of energy.
|
PdVector[] |
getSpectrum(PdVector eValue,
PdVector[] eVector)
Compute eigenvalues and eigenvectors of normalized hessian.
|
boolean |
getZeroGradientAtBounds()
Check if the gradient at the boundary is constrained to zero.
|
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 |
isEnabledConstrainMatrix()
Determine if usage of a constrain matrix is enabled.
|
boolean |
isUseConstrainMatrix() |
void |
setConstrain(PdMatrix constrain) |
void |
setEnabledConstrainMatrix(boolean flag)
Enable usage of a constrain matrix for index computation of Neumann boundary geometries.
|
boolean |
setSurface(PgElementSet domain,
PgElementSet surface)
Set domain and surface, and initialize energy structure.
|
void |
setUseConstrainMatrix(boolean useConstrainMatrix) |
void |
setZeroGradientAtBounds(boolean flag)
Constrains the gradient at the boundary to zero or not, if the boundary
polygons of the geometry do not exist or have no boundary constraints.
|
void |
testEigenvalues() |
enableEvaluation, isEvaluable
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, update, updatePanels
public void init()
PsObject
public void initSurface(PgElementSet domain, PgElementSet surface)
public int getNumOfVariables()
getNumOfVariables
in class PnFunction
public boolean isEnabledConstrainMatrix()
public void setEnabledConstrainMatrix(boolean flag)
public boolean setSurface(PgElementSet domain, PgElementSet surface)
Domain argument maybe null but surface must always be assigned.
domain
- additional geometry used to specify mapssurface
- geometry which is usually optimizedpublic void setZeroGradientAtBounds(boolean flag)
true
, i.e. constrained gradient.public boolean getZeroGradientAtBounds()
setZeroGradientAtBounds(boolean)
public double eval(PdVector coord)
eval
in class PnFunction
coord
- Coordinate vector with list of doublesPnAreaEnergy
public PdVector evalGradient(PdVector coord, PdVector gradient)
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.
If no special boundary constraints are set, then you may use setZeroGradientAtBounds(boolean)
to set the gradient zero at the boundary (or free again).
evalGradient
in class PnFunction
coord
- Coordinate vector with list of doublesgradient
- Gradient vector to be modified, maybe null
.PnAreaEnergy
public PdMatrix evalHessian(PdMatrix hessian)
evalHessian
in class PnFunction
hessian
- Hessian of energy with square sizepublic PdVector[] getSpectrum(PdVector eValue, PdVector[] eVector)
eValue
- Vector to store the eigenvalues. Size will be adjusted.eVector
- Possibly empty array to store the eigenvectors. Will be returned.public boolean computeNormalizedHessian(PdMatrix hessian, PdMatrix mass)
public void testEigenvalues()
public PdMatrix getConstrain()
public void setConstrain(PdMatrix constrain)
constrain
- public boolean isUseConstrainMatrix()
public void setUseConstrainMatrix(boolean useConstrainMatrix)
useConstrainMatrix
- "