|
|
||||||||
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.MovementIntegratorWrapper
public abstract class MovementIntegratorWrapper extends java.lang.Object implements MovementIntegrator
Wrapper, all method of which just call the same methods of some parent integrator.
The only addition is that performIteration()
method of this class also calls
beforeIteration()
and afterIteration()
methods before and after calling
parent.performIteration()
. By default these methods do nothing, but you
can override them to perform some additional corrections in the item set.
AlgART Laboratory 2010
Modifier and Type | Field and Description |
---|---|
protected MovementIntegrator |
parent
The parent integrator, specified in the argument of the constructor. |
Modifier | Constructor and Description |
---|---|
protected |
MovementIntegratorWrapper(MovementIntegrator parent)
Creates new instance of this class. |
Modifier and Type | Method and Description |
---|---|
protected void |
afterIteration()
This method is called by performIteration() method after that it calls
parent.performIteration() . |
protected void |
beforeIteration()
This method is called by performIteration() method before that it calls
parent.performIteration() . |
void |
copyBasicSettings(MovementIntegrator source)
Copies all basic settings, that can be accessed via getXxx/setXxx methods of this interface, from the specified object. |
double |
getAccelerationLimit()
Returns the acceleration limit Amax. |
long |
getCounterOfCheckedNeighbours()
Returns the internal thread-safe counter of "neighbour" item pairs ,
which were checked by MovementIntegrator.performIteration() method
while calculation of the right side of the motion equations. |
long |
getCounterOfProcessedInteractions()
Returns the internal thread-safe counter of really interacted item pairs, which were really processed by MovementIntegrator.performIteration() method
while calculation of the right side of the motion equations,
that is for which calculateForce method was really called
and returned true. |
long |
getCounterOfProcessedItems()
Returns the internal thread-safe counter of items, which were processed by MovementIntegrator.performIteration() method
while calculation of the right side of the motion equations. |
long |
getCounterOfProcessedSymmetricInteractions()
An analog of the counter MovementIntegrator.getCounterOfProcessedInteractions() , counting only pairs,
which were processed in more efficient way thanks to
symmetric interaction rules . |
double |
getDeltaT()
Returns the time step Δt for one iteration of integration. |
java.util.List<InteractionRule> |
getInteractionRules()
Returns the list of interaction rules, used by this object. |
ItemSet |
getItemSet()
Returns the item set, processed by this object. |
int |
getNumberOfParallelTasks()
Returns the current number of parallel threads, which is recommended this object to use for optimizing calculations on multiprocessor systems. |
double |
getT()
Returns the current time t in the physical model. |
double |
getVelocityLimit()
Returns the velocity limit Vmax. |
boolean |
getViscousForces()
Returns true if this object works in the mode of viscous forces. |
void |
performIteration()
Performs one iteration of integration. |
void |
resetCounters()
Resets to 0 all internal counters, returned by MovementIntegrator.getCounterOfProcessedItems() ,
MovementIntegrator.getCounterOfCheckedNeighbours() , MovementIntegrator.getCounterOfProcessedInteractions()
and MovementIntegrator.getCounterOfProcessedSymmetricInteractions() methods. |
void |
setAccelerationLimit(double accelerationLimit)
Sets the acceleration limit Amax to the given value. |
void |
setDeltaT(double deltaT)
Sets the current time Δt for one iteration of integration. |
void |
setNumberOfParallelTasks(int numberOfParallelTasks)
Sets the number of parallel threads, which should be used, if possible, for optimizing calculations on multiprocessor systems. |
void |
setT(double t)
Sets the current time t in the physical model. |
void |
setVelocityLimit(double velocityLimit)
Sets the velocity limit Vmax to the given value. |
void |
setViscousForces(boolean viscousForces)
Sets the mode of viscous forces ("pseudo-Newton's" motion equations), if the argument is true, or the usual mode (standard Newton's laws), if the argument is false See comments to this interface for more details. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.algart.model3d.common.movement.model.MovementIntegrator |
---|
isErrorInformationAvailable, maxLastCoordinateError, maxLastVelocityError, meanLastCoordinateError, meanLastVelocityError |
Field Detail |
---|
protected final MovementIntegrator parent
Constructor Detail |
---|
protected MovementIntegratorWrapper(MovementIntegrator parent)
parent
- the instance of MovementIntegrator
interface that will perform all operations.Method Detail |
---|
public ItemSet getItemSet()
MovementIntegrator
ItemSet
interface.
getItemSet
in interface MovementIntegrator
ItemSet
object, processed by this object.public java.util.List<InteractionRule> getInteractionRules()
MovementIntegrator
The result is an immutable view (Collections.unmodifiableList) or a clone of the internal collection, stored by this object: you cannot modify the set of used interaction rules via the result of this method.
The elements of the returned list are never null.
getInteractionRules
in interface MovementIntegrator
public int getNumberOfParallelTasks()
MovementIntegrator
The returned value is always positive (>0).
getNumberOfParallelTasks
in interface MovementIntegrator
public void setNumberOfParallelTasks(int numberOfParallelTasks)
MovementIntegrator
If this argument is 0, it is automatically replaced with
MovementIntegrator.getNumberOfParallelTasks()
method will return not 0,
but the actual number of available processors.
setNumberOfParallelTasks
in interface MovementIntegrator
numberOfParallelTasks
- the desired number of parallel threads for multiprocessor optimization.public boolean getViscousForces()
MovementIntegrator
comments to this interface
for more details.
getViscousForces
in interface MovementIntegrator
public void setViscousForces(boolean viscousForces)
MovementIntegrator
comments to this interface
for more details.
setViscousForces
in interface MovementIntegrator
viscousForces
- whether you this object should be switched in the mode of viscous forces.public double getAccelerationLimit()
MovementIntegrator
comments to this interface
for more details.
getAccelerationLimit
in interface MovementIntegrator
public void setAccelerationLimit(double accelerationLimit)
MovementIntegrator
comments to this interface
for more details.
setAccelerationLimit
in interface MovementIntegrator
accelerationLimit
- new acceleration limit Amax.public double getVelocityLimit()
MovementIntegrator
comments to this interface
for more details.
getVelocityLimit
in interface MovementIntegrator
public void setVelocityLimit(double velocityLimit)
MovementIntegrator
comments to this interface
for more details.
setVelocityLimit
in interface MovementIntegrator
velocityLimit
- new velocity limit Vmax.public double getT()
MovementIntegrator
MovementIntegrator.performIteration()
method.
getT
in interface MovementIntegrator
MovementIntegrator.getDeltaT()
public void setT(double t)
MovementIntegrator
setT
in interface MovementIntegrator
t
- new value of the current time t.public double getDeltaT()
MovementIntegrator
getDeltaT
in interface MovementIntegrator
public void setDeltaT(double deltaT)
MovementIntegrator
setDeltaT
in interface MovementIntegrator
deltaT
- new value of the time step Δt.public void copyBasicSettings(MovementIntegrator source)
MovementIntegrator
setNumberOfParallelTasks
(source.getNumberOfParallelTasks()
);setViscousForces
(source.getViscousForces()
);setAccelerationLimit
(source.getAccelerationLimit()
);setVelocityLimit
(source.getVelocityLimit()
);setT
(source.getT()
);setDeltaT
(source.getDeltaT()
);
copyBasicSettings
in interface MovementIntegrator
source
- another movement integrator, the basic settings of which should be copied into this one.public long getCounterOfProcessedItems()
MovementIntegrator
MovementIntegrator.performIteration()
method
while calculation of the right side of the motion equations.
Note that MovementIntegrator.performIteration()
can calculate the right side of the equations several times
(as in Runge-Kutta algorithms), and then every item will be also counted several times.
Usually the items, which do not have coordinates of centers and velocities
or do not have masses
, are not counted.
This counter is 0 after creating new instance of this class
and can be set to 0 by MovementIntegrator.resetCounters()
method.
This method is provided for profiling and debugging needs only. It works as described above in the implementations, offered by this package, but there is no guarantee that it will return correct values in all implementations. If the implementation does not provide this counter, this method should return 0 always.
getCounterOfProcessedItems
in interface MovementIntegrator
public long getCounterOfCheckedNeighbours()
MovementIntegrator
"neighbour" item pairs
,
which were checked by MovementIntegrator.performIteration()
method
while calculation of the right side of the motion equations.
This number depends on the implementation of ItemSet
interface:
good implementations, like GridItemSet
, allow to check only restricted number of items
while finding all "neighbours" of the given item, which can interact with it.
Note that the "neighbour" pair is counted independently for both its elements. In other words, it two items act to each other, their pair is counter twice.
Note that MovementIntegrator.performIteration()
can calculate the right side of the equations several times
(as in Runge-Kutta algorithms), and then every neighbour item pair will be also counted several times.
This counter is 0 after creating new instance of this class
and can be set to 0 by MovementIntegrator.resetCounters()
method.
This method is provided for profiling and debugging needs only. It works as described above in the implementations, offered by this package, but there is no guarantee that it will return correct values in all implementations. If the implementation does not provide this counter, this method should return 0 always.
getCounterOfCheckedNeighbours
in interface MovementIntegrator
public long getCounterOfProcessedInteractions()
MovementIntegrator
MovementIntegrator.performIteration()
method
while calculation of the right side of the motion equations,
that is for which calculateForce
method was really called
and returned true.
Note that an interacted pair is counted independently for both items. In other words, it two items act to each other, their pair is counter twice.
Note that an interacted pair is counted again for every interaction rule, applicable for this pair.
So, if there are K>1 rules, in which calculateForce
method
returned true for the given pair, then this pair will be counted K times.
Note that MovementIntegrator.performIteration()
can calculate the right side of the equations several times
(as in Runge-Kutta algorithms), and then every neighbour item pair will be also counted several times.
This counter is 0 after creating new instance of this class
and can be set to 0 by MovementIntegrator.resetCounters()
method.
This method is provided for profiling and debugging needs only. It works as described above in the implementations, offered by this package, but there is no guarantee that it will return correct values in all implementations. If the implementation does not provide this counter, this method should return 0 always.
getCounterOfProcessedInteractions
in interface MovementIntegrator
public long getCounterOfProcessedSymmetricInteractions()
MovementIntegrator
MovementIntegrator.getCounterOfProcessedInteractions()
, counting only pairs,
which were processed in more efficient way thanks to
symmetric interaction rules
.
Namely, some implementations of this interface can use the fact, that some interaction is symmetric
(implements SymmetricInteractionRule
), and calculate the interaction force only once.
The force F' of acting of the 2nd item to the 1st one is produced from
the force F of acting of the 1st item to the 2nd one by changing the sign:
MovementIntegrator.getCounterOfProcessedInteractions()
method.
But some "neighbour" item pairs cannot be processed in such a manner, for example,
when the first item is processed (moved) by one processor in multiprocessor system
and the second one is processed by another processor.
In such situation, this counter is not increased, though the counter,
returned by MovementIntegrator.getCounterOfProcessedInteractions()
method, is increased by 2
(by 1 for each from two items). So, this method can help to measure optimization,
achieved thanks to usage of symmetric interaction rules
.
This counter is 0 after creating new instance of this class
and can be set to 0 by MovementIntegrator.resetCounters()
method.
This method is provided for profiling and debugging needs only. It works as described above in the implementations, offered by this package, but there is no guarantee that it will return correct values in all implementations. If the implementation does not provide this counter, this method should return 0 always.
getCounterOfProcessedSymmetricInteractions
in interface MovementIntegrator
symmetric interaction rules
.public void resetCounters()
MovementIntegrator
MovementIntegrator.getCounterOfProcessedItems()
,
MovementIntegrator.getCounterOfCheckedNeighbours()
, MovementIntegrator.getCounterOfProcessedInteractions()
and MovementIntegrator.getCounterOfProcessedSymmetricInteractions()
methods.
resetCounters
in interface MovementIntegrator
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
protected void beforeIteration()
performIteration()
method before that it calls
parent.performIteration()
.
This default implementation does nothing.
protected void afterIteration()
performIteration()
method after that it calls
parent.performIteration()
.
This default implementation does nothing.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |