volatileprototypes.fvlib
Class BehaviorSpringRelaxation

java.lang.Object
  extended by volatileprototypes.fvlib.Solver
      extended by volatileprototypes.fvlib.BehaviorSpringRelaxation

public final class BehaviorSpringRelaxation
extends Solver

Since:
0.2.0

Nested Class Summary
 
Nested classes/interfaces inherited from class volatileprototypes.fvlib.Solver
Solver.Caller
 
Field Summary
 
Fields inherited from class volatileprototypes.fvlib.Solver
xs
 
Constructor Summary
BehaviorSpringRelaxation()
          Constructor, generates a new class instance.
BehaviorSpringRelaxation(java.util.ArrayList<Link> linksin)
          Constructor, generates a new class instance using a copy of the supplied Link ArrayList.
BehaviorSpringRelaxation(Link[] linksin)
          Constructor, generates a new class instance using the supplied Link array.
 
Method Summary
 Link[] getL()
          Get the current Link array.
protected  int getNumCPUs()
           
 BehaviorSpringRelaxation setFast(boolean fin)
          Sets whether to use a faster solver or the normal one.
 BehaviorSpringRelaxation setL(java.util.ArrayList<Link> linksin)
          Sets the object's Link array using a copy of the supplied ArrayList.
 BehaviorSpringRelaxation setL(Link[] linksin)
          Sets the object's Link array using the supplied array.
protected  void stepFunction(int step, int offset)
           
 
Methods inherited from class volatileprototypes.fvlib.Solver
finalizeFunction, step
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BehaviorSpringRelaxation

public BehaviorSpringRelaxation()
Constructor, generates a new class instance.


BehaviorSpringRelaxation

public BehaviorSpringRelaxation(java.util.ArrayList<Link> linksin)
Constructor, generates a new class instance using a copy of the supplied Link ArrayList.

Parameters:
linksin - An ArrayList containing Link objects with which the object's list will be initialized.

BehaviorSpringRelaxation

public BehaviorSpringRelaxation(Link[] linksin)
Constructor, generates a new class instance using the supplied Link array.

Parameters:
linksin - An array containing Link objects with which the object's array will be initialized.
Method Detail

getNumCPUs

protected int getNumCPUs()
Overrides:
getNumCPUs in class Solver

setL

public BehaviorSpringRelaxation setL(java.util.ArrayList<Link> linksin)
Sets the object's Link array using a copy of the supplied ArrayList.

Parameters:
linksin - The ArrayList containing Link objects.
Returns:
The current object.

setL

public BehaviorSpringRelaxation setL(Link[] linksin)
Sets the object's Link array using the supplied array.

Parameters:
linksin - The array containing Link objects.
Returns:
The current object.

getL

public Link[] getL()
Get the current Link array.

Returns:
The current Link array.

setFast

public final BehaviorSpringRelaxation setFast(boolean fin)
Sets whether to use a faster solver or the normal one. In fvlib, a fast solver is implemented for spring interactions that uses just one Newton iteration to approximate the square root of the squared length between points using the rest length as reference. The faster solver reduces precision but increases simulation speed noticeably.

Parameters:
fin - A boolean representing whether to use fast sqrt.
Returns:
The current object.

stepFunction

protected final void stepFunction(int step,
                                  int offset)
Overrides:
stepFunction in class Solver