jvx.numeric
Class PnGeodesicRK
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.numeric.PnGeodesicRK
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf
- Direct Known Subclasses:
- PnElementRK, PnTranslationRK, PnVertexRK, PnVertexRKIgnoreDirection
public abstract class PnGeodesicRK extends PsObject
Discrete Runge-Kutta solver on triangular element sets. Element set must be triangulated.- See Also:
PnElementRK,PnVertexRK,PnVertexRKIgnoreDirection,PgElementSet.triangulate(jv.geom.PgElementSet), Serialized Form- Author:
- Eike Preuß
- Version:
- 01.03.06, 1.40 revised (ah) Use PnStraightestGeodesic.
20.02.03, 1.30 revised (ep) New methodevalthat returns the evaluation result in new allocated baryvector.
22.01.03, 1.20 revised (ep) You can invert the direction of integration with get/setInvertDirection.
15.01.03, 1.10 revised (ep) Changes with respect to new RK class that ignores the sign (direction) of vector fields.
11.07.01, 1.05 revised (ep) Speed optimization in the whole thing.
20.02.00, 1.04 revised (ep) removed "small velocity bug", added StepLength 28.12.99, 1.03 revised (ep) added fast-mode (euler-mode)
27.12.99, 1.02 revised (ep) corrected handling of |vector| == 0
21.11.99, 1.01 revised (ep) split into PnGeodesicRK, PnVertexRK, PnElementRK
-
-
Field Summary
-
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
-
-
Constructor Summary
Constructors Constructor and Description PnGeodesicRK(PgElementSet geom)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description PdBaryDireval(int elemInd, PdBary bary)Wrapper that callseval(int, PdBary, PdBaryDir)with a new barycentric vector.abstract voideval(int elemInd, PdBary bary, PdBaryDir out)Evaluate vector field on given element at given barycentric coordinate.booleangetInvertDirection()doublegetStepLength()Returns Euclidean length of last Runge-Kutta step.booleannextStep()Calculates the next step of actual integration.booleanprepareSolve(PgPolygonOnElementSet outpoly, int iniElem, PdBary iniPoint, double h)Unlesssolveis used, this method has to be called before integration.voidsetFirstOrder(boolean flag)Sets integration method to euler if flag is true, else to 4th-order Runge-Kutta.voidsetFourthOrder(boolean flag)Sets integration method to 4th-order Runge-Kutta if flag is true, else to euler.voidsetGeometry(PgElementSet geom)Sets underlying geometry.voidsetInvertDirection(boolean flag)If set to 'true', the negative vector field is used.voidsolve(PdBary initPoint, double h, int numIterations, PdBary outPoint)Solves for outPoint at initPoint.voidsolve(PdBary initPoint, double h, PdBary outPoint)Solves for outPoint at initPoint.voidsolve(PgPolygonOnElementSet outpoly, int iniElem, PdBary iniPoint, double h, int numIterations)Returns a whole integral line.-
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, init, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, update, updatePanels
-
-
-
-
Constructor Detail
-
PnGeodesicRK
public PnGeodesicRK(PgElementSet geom)
-
-
Method Detail
-
setGeometry
public void setGeometry(PgElementSet geom)
Sets underlying geometry.- Parameters:
geom- new underlying geometry
-
setFirstOrder
public void setFirstOrder(boolean flag)
Sets integration method to euler if flag is true, else to 4th-order Runge-Kutta.- Parameters:
flag- true: euler; false: 4th-order RK
-
setFourthOrder
public void setFourthOrder(boolean flag)
Sets integration method to 4th-order Runge-Kutta if flag is true, else to euler.- Parameters:
flag- true: 4th-order RK; false: euler
-
solve
public void solve(PgPolygonOnElementSet outpoly, int iniElem, PdBary iniPoint, double h, int numIterations)
Returns a whole integral line. To get an integral line of unfixed length step by step, useprepareSolve,nextStepandgetStepPolygon.- Parameters:
outpoly- output polygoniniElem- initial element indexiniPoint- initial barycentric coordinatesh- stepsizenumIterations- number of iterations- See Also:
prepareSolve(jvx.geom.PgPolygonOnElementSet, int, jv.vecmath.PdBary, double),nextStep(),getStepLength()
-
solve
public void solve(PdBary initPoint, double h, int numIterations, PdBary outPoint)
Solves for outPoint at initPoint.- Parameters:
initPoint- inputh- stepsizenumIterations- number of iterationsoutPoint- output- Version:
- 01.03.06, 1.00 created (ah)
-
solve
public void solve(PdBary initPoint, double h, PdBary outPoint)
Solves for outPoint at initPoint.- Parameters:
initPoint- inputh- stepsizeoutPoint- output- Version:
- 01.03.06, 1.00 created (ah)
-
prepareSolve
public boolean prepareSolve(PgPolygonOnElementSet outpoly, int iniElem, PdBary iniPoint, double h)
Unlesssolveis used, this method has to be called before integration. It initializes all internal variables.- Parameters:
outpoly- output polygoniniElem- initial element indexiniPoint- initial barycentric coordinatesh- stepsize- See Also:
solve(PdBary, double, int, PdBary)
-
nextStep
public boolean nextStep()
Calculates the next step of actual integration.- Returns:
- false if the integration stopped by error, the geometry boundary was reached, or the next direction would be of zero length
- See Also:
solve(PdBary, double, int, PdBary),prepareSolve(jvx.geom.PgPolygonOnElementSet, int, jv.vecmath.PdBary, double),getStepLength()- Version:
- 01.03.06, 1.20 revised (ah) Avoid unnecessary copying
. 01.03.06, 1.10 revised (ah) Use PnStraightestGeodesic
-
getStepLength
public double getStepLength()
Returns Euclidean length of last Runge-Kutta step.
-
setInvertDirection
public void setInvertDirection(boolean flag)
If set to 'true', the negative vector field is used. MUST BE SUPPORTED BY EVAL-METHOD OF SUBCLASSES.- Since:
- JavaView 2.49.004
-
getInvertDirection
public boolean getInvertDirection()
- Since:
- JavaView 2.49.004
-
eval
public abstract void eval(int elemInd, PdBary bary, PdBaryDir out)Evaluate vector field on given element at given barycentric coordinate.- Parameters:
elemInd- the element in which the vector field will be evaluatedbary- barycentric coordinates of the point in which the vector field will be evaluatedout- output: in thisPdBaryDirthe evaluated direction will be stored- See Also:
PnElementRK.eval(int, jv.vecmath.PdBary, jv.vecmath.PdBaryDir),PnVertexRK.eval(int, jv.vecmath.PdBary, jv.vecmath.PdBaryDir),PnTranslationRK.eval(int, jv.vecmath.PdBary, jv.vecmath.PdBaryDir)
-
eval
public PdBaryDir eval(int elemInd, PdBary bary)
Wrapper that callseval(int, PdBary, PdBaryDir)with a new barycentric vector.- Since:
- JavaView xx.xx.xxx
-
-
"