java.lang.Object
simpa.core.api.SourceArrangement
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
ConstructorsConstructorDescriptionSourceArrangement(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 TypeMethodDescriptionorg.apache.commons.math3.geometry.euclidean.threed.Vector3DGets the center of the element.getName()Gets the element name.Gets the list of point sources.org.apache.commons.math3.geometry.euclidean.threed.RotationdoubleGets the scaling of the source arrangement.voidsetScaling(double scaling) Sets the scaling of the source arrangement.voidsourcePositionsToFile(String fileName) 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.
-
Constructor Details
-
SourceArrangement
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 sourcesname- 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
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
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
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.
-