simulations.objects
Class EMCollection

java.lang.Object
  extended bysimulations.objects.BaseObject
      extended bysimulations.objects.EMCollection

public class EMCollection
extends BaseObject

A class which contains a collection of objects which extend BaseObject. This class knows how to compute the electric and magnetic and etc. fields of all the base objects of which it is comprised.

Version:
1.0
Author:
Andreas Sundquist

Field Summary
 java.util.Vector sources
          sources is a vector which contains references to the base objects in the EMCollection
private  Vec3 temp
          a temporary location for computation of the total electric field and etc.
 
Constructor Summary
EMCollection()
          The constructor for EMCollection.
 
Method Summary
 void Add(BaseObject em)
          adds a BaseObject to the collection of EM objects in the collection
 Vec3 Bfield(Vec3 x, Vec3 B)
          This method computes the total magnetic field of all the EM objects in the collection
 Vec3 Efield(Vec3 x, Vec3 E)
          This method computes the total electric field of all the EM objects in the collection
 void Evolve(double dt)
          Evolves all the base objects with the naive evolution specified.
 Vec3 Pfield(Vec3 x, Vec3 P)
          This method computes the total Pauli field of all the EM objects in the collection
 void Remove(BaseObject em)
          removes a BaseObject from the collection of EM objects in the collection
 
Methods inherited from class simulations.objects.BaseObject
Bfield, Efield, Pfield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sources

public java.util.Vector sources
sources is a vector which contains references to the base objects in the EMCollection


temp

private Vec3 temp
a temporary location for computation of the total electric field and etc.

Constructor Detail

EMCollection

public EMCollection()
The constructor for EMCollection. Simply creates a new vector, which is subsequently added to

Method Detail

Efield

public Vec3 Efield(Vec3 x,
                   Vec3 E)
This method computes the total electric field of all the EM objects in the collection

Specified by:
Efield in class BaseObject
Parameters:
x - the position of the observer
E - the total electric field at the position of the observer
Returns:
E the total electric field at the position of the observer

Bfield

public Vec3 Bfield(Vec3 x,
                   Vec3 B)
This method computes the total magnetic field of all the EM objects in the collection

Specified by:
Bfield in class BaseObject
Parameters:
x - the position of the observer
B - the total magnetic field at the position of the observer
Returns:
B the total magnetic field at the position of the observer

Pfield

public Vec3 Pfield(Vec3 x,
                   Vec3 P)
This method computes the total Pauli field of all the EM objects in the collection

Overrides:
Pfield in class BaseObject
Parameters:
x - the position of the observer
P - the total Pauli field at the position of the observer
Returns:
P the total Pauli field at the position of the observer

Evolve

public void Evolve(double dt)
Evolves all the base objects with the naive evolution specified. Should not be used.

Overrides:
Evolve in class BaseObject
Parameters:
dt - time step

Add

public void Add(BaseObject em)
adds a BaseObject to the collection of EM objects in the collection

Parameters:
em - the base object to be added

Remove

public void Remove(BaseObject em)
removes a BaseObject from the collection of EM objects in the collection

Parameters:
em - the base object to be removed