Module simpa.core

Class SourceArrangement

java.lang.Object
simpa.core.api.SourceArrangement

public class SourceArrangement extends Object
Class that contains a list of PointSource objects that make up a SourceArrangement. It is used for reproducing an EM a field inside a volume.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SourceArrangement(String filename, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, org.apache.commons.math3.geometry.euclidean.threed.Rotation rotation, double scaling, String name)
    Sets the SourceArrangement based on a given file and applies the given translation and rotation.
    SourceArrangement(List<PointSource> poles, double scaling, String name)
    Constructs a SourceArrangement out of a list of point sources.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.commons.math3.geometry.euclidean.threed.Vector3D
    Gets the center of the element.
    Gets the element name.
    Gets the list of point sources.
    org.apache.commons.math3.geometry.euclidean.threed.Rotation
     
    double
    Gets the scaling of the source arrangement.
    void
    setScaling(double scaling)
    Sets the scaling of the source arrangement.
    void
    Writes a text file containing all source positions to the given file in the working directory.
    transformSources(org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, org.apache.commons.math3.geometry.euclidean.threed.Rotation rotation)
    Creates a transformed instance.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SourceArrangement

      public SourceArrangement(List<PointSource> poles, double scaling, String name)
      Constructs a SourceArrangement out of a list of point sources. All point sources must have the same type, mixing magnetic and electric sources is not allowed.
      Parameters:
      poles - Point sources.
      scaling - The scaling for the sources.
      name - The name of the element.
    • SourceArrangement

      public SourceArrangement(String filename, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, org.apache.commons.math3.geometry.euclidean.threed.Rotation rotation, double scaling, String name)
      Sets the SourceArrangement based on a given file and applies the given translation and rotation.
      Parameters:
      filename - Name of the file with the source locations.
      translation - Translation for the sources.
      rotation - Rotation that should be applied to the sources.
      scaling - Scaling for the sources
      name - Name of the element.
  • Method Details

    • getScaling

      public double getScaling()
      Gets the scaling of the source arrangement.
      Returns:
      The scaling value.
    • setScaling

      public void setScaling(double scaling)
      Sets the scaling of the source arrangement.
      Parameters:
      scaling - The scaling value.
    • getName

      public String getName()
      Gets the element name.
      Returns:
      The name of the element.
    • getCenter

      public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getCenter()
      Gets the center of the element.
      Returns:
      the center of the element (translation).
    • getRotation

      public org.apache.commons.math3.geometry.euclidean.threed.Rotation getRotation()
      Returns:
      Rotation of this instance compared to a reference frame frame {(1,0,0),{0,1,0),(0,0,1)}
    • sourcePositionsToFile

      public void sourcePositionsToFile(String fileName)
      Writes a text file containing all source positions to the given file in the working directory. For each source there is a line in the file.
      Parameters:
      fileName - - Name of the output file.
    • getPointSources

      public List<PointSource> getPointSources()
      Gets the list of point sources.
      Returns:
      The list of point sources.
    • transformSources

      public SourceArrangement transformSources(org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, org.apache.commons.math3.geometry.euclidean.threed.Rotation rotation)
      Creates a transformed instance. First rotates then translates all sources.
      Parameters:
      translation - Translation for the sources.
      rotation - Rotation that should be applied to the sources.