Package cnuphys.magfield
Class CompositeField
- All Implemented Interfaces:
IMagField
,Serializable
,Cloneable
,Iterable<IMagField>
,Collection<IMagField>
,List<IMagField>
,RandomAccess
- Direct Known Subclasses:
RotatedCompositeField
A composition of multiple magnetic field maps. The resulting magnetic field
at a given point is the sum of the constituent fields at that point.
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
contains
(double x, double y, double z) Checks whether the field boundary contain the given point.float
getB1
(int index) Get B1 at a given index.float
getB2
(int index) Get B2 at a given index.float
getB3
(int index) Get B3 at a given index.float
Obtain the maximum field magnitude of any point in the map.getName()
Get the name of the fielddouble
Get the scale factorboolean
Check whether we have a solenoid fieldboolean
hasTorus()
Check whether we have a torus fieldboolean
Check whether we have a transverse solenoid fieldfinal boolean
Checks whether the field has been set to always return zero.void
Print the current configurationMethods inherited from class java.util.ArrayList
add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
CompositeField
public CompositeField()
-
-
Method Details
-
isZeroField
public final boolean isZeroField()Checks whether the field has been set to always return zero.- Specified by:
isZeroField
in interfaceIMagField
- Returns:
true
if the field is set to return zero.
-
add
-
getName
Description copied from interface:IMagField
Get the name of the field -
hasTorus
public boolean hasTorus()Check whether we have a torus field- Returns:
true
if we have a torus
-
hasSolenoid
public boolean hasSolenoid()Check whether we have a solenoid field- Returns:
true
if we have a solenoid
-
hasTransverseSolenoid
public boolean hasTransverseSolenoid()Check whether we have a transverse solenoid field- Returns:
true
if we have a transverse solenoid
-
getB1
public float getB1(int index) Description copied from interface:IMagField
Get B1 at a given index. -
getB2
public float getB2(int index) Description copied from interface:IMagField
Get B2 at a given index. -
getB3
public float getB3(int index) Description copied from interface:IMagField
Get B3 at a given index. -
getMaxFieldMagnitude
public float getMaxFieldMagnitude()Description copied from interface:IMagField
Obtain the maximum field magnitude of any point in the map.- Specified by:
getMaxFieldMagnitude
in interfaceIMagField
- Returns:
- the maximum field magnitude in the units of the map.
-
getScaleFactor
public double getScaleFactor()Description copied from interface:IMagField
Get the scale factor- Specified by:
getScaleFactor
in interfaceIMagField
- Returns:
- the scale factor
-
printConfiguration
Print the current configuration- Specified by:
printConfiguration
in interfaceIMagField
- Parameters:
ps
- the print stream
-
contains
public boolean contains(double x, double y, double z) Description copied from interface:IMagField
Checks whether the field boundary contain the given point.
-