|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.algart.model3d.common.movement.model.AbstractMovementIntegrator net.algart.model3d.common.movement.model.EulerMovementIntegrator
public class EulerMovementIntegrator extends AbstractMovementIntegrator
The simplest implementation of the MovementIntegrator
interface, based on
the classic Euler method
for solving Cauchy problem.
More precisely, let the coordinates and velocities of all items at the current moment
tn be described by the vector wn,
and we want to find the coordinates and velocities wn+1 at the next moment
comments to MovementIntegrator
.
This class uses the following formula:
wn+1 = wn + Δt f(tn, wn)
where calculateLeftSide
method).
This class does not support estimation of the maximal and mean errors:
isErrorInformationAvailable()
method returns false,
maxLastCoordinateError()
,
meanLastCoordinateError()
,
maxLastVelocityError()
,
meanLastVelocityError()
methods return Double.NaN.
Please see comments fo MovementIntegrator
interface about multithreading usage.
AlgART Laboratory 2010
Modifier and Type | Field and Description |
---|
Fields inherited from class net.algart.model3d.common.movement.model.AbstractMovementIntegrator |
---|
countOfCheckedNeighbours, countOfProcessedInteractions, countOfProcessedItems, countOfProcessedSymmetricInteractions, n |
Modifier and Type | Method and Description |
---|---|
static EulerMovementIntegrator |
getEulerIntegrator(ItemSet itemSet,
java.util.Collection<InteractionRule> interactionRules,
double deltaT)
Creates new instance of this class. |
void |
performIteration()
Performs one iteration of integration. |
protected void |
preprocess()
Performs necessary preprocessing before an iteration, in particular, reallocate all necessary work memory. |
java.lang.String |
toString()
Returns a brief string description of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static EulerMovementIntegrator getEulerIntegrator(ItemSet itemSet, java.util.Collection<InteractionRule> interactionRules, double deltaT)
The itemSet argument is just stored in an internal field, and this reference
will be returned by getItemSet()
method.
Unlike this, the interactionRules collection is copied into a newly created list:
no references to it are maintained by the created object.
itemSet
- the item set, which will be processed by this class.interactionRules
- the set of interaction rules, used by this class.deltaT
- the time step Δt.java.lang.NullPointerException
- if one of the arguments is null or
if one of interaction rules in the passed collection is null.java.lang.IllegalArgumentException
- if deltaT<0.public void performIteration()
MovementIntegrator
having centers and velocities
and having masses
,
according to the motion equations.
See comments to this interface
for more details.
performIteration
in interface MovementIntegrator
performIteration
in class AbstractMovementIntegrator
protected void preprocess()
AbstractMovementIntegrator
AbstractMovementIntegrator.performIteration()
method
and before any call of
AbstractMovementIntegrator.calculateLeftSide(double[], double[], double[], double[], double[], double[], double)
or
AbstractMovementIntegrator.calculateLeftSide(double[], double[], double[], double[], double[], double[], double, int, int, int)
methods, if the item set was corrected in any way after the last call of this method.
This implementation reallocates a temporary memory, used by
AbstractMovementIntegrator.calculateLeftSide(double[], double[], double[], double[], double[], double[], double, int, int, int)
method, and calls itemSet.preprocess()
.
Please don't forget to call it from all overriding implementations.
preprocess
in class AbstractMovementIntegrator
public java.lang.String toString()
The result of this method may depend on implementation.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |