net.talvi.puffinplot.data
Class Tensor

java.lang.Object
  extended by net.talvi.puffinplot.data.Tensor

public class Tensor
extends java.lang.Object

A second-order symmetric tensor used to represent the anisotropy of magnetic susceptibility.


Constructor Summary
Tensor(double k11, double k22, double k33, double k12, double k23, double k13)
          Creates a tensor with the specified components.
Tensor(double k11, double k22, double k33, double k12, double k23, double k13, Matrix correct1, Matrix correct2)
          Creates a tensor with the specified components and transformed using the specified matrices.
Tensor(java.util.List<Vec3> axes)
          Creates a tensor with the specified principal axes.
 
Method Summary
static Tensor fromDirections(Vec3 k1, Vec3 k2, Vec3 k3)
          Creates a tensor with the specified axes.
 Vec3 getAxis(int axis)
          Returns one of the tensor's three principal axes as a vector.
static java.util.List<java.lang.String> getEmptyFields()
          Returns a list of empty strings equal in length to the number of parameters.
static java.util.List<java.lang.String> getHeaders()
          Returns the headers describing the parameters as a list of strings.
 java.util.List<java.lang.String> toStrings()
          Returns the principal directions as a list of strings.
 java.lang.String toTensorComponentString()
          Returns a string giving the components of the tensor, separated by spaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tensor

public Tensor(double k11,
              double k22,
              double k33,
              double k12,
              double k23,
              double k13)
Creates a tensor with the specified components. Since the tensor is symmetric, only six components need to be defined.

Parameters:
k11 - (1,1) component
k22 - (2,2) component
k33 - (3,3) component
k12 - (1,2) and (2,1) component
k23 - (2,3) and (3,2) component
k13 - (1,3) and (3,1) component

Tensor

public Tensor(double k11,
              double k22,
              double k33,
              double k12,
              double k23,
              double k13,
              Matrix correct1,
              Matrix correct2)
Creates a tensor with the specified components and transformed using the specified matrices. The tensor is constructed by first making a tensor with the specified components, then sequentially transforming it by the two specified matrices. Since the tensor is symmetric, only six components need to be defined.

Parameters:
k11 - (1,1) component
k22 - (2,2) component
k33 - (3,3) component
k12 - (1,2) and (2,1) component
k23 - (2,3) and (3,2) component
k13 - (1,3) and (3,1) component
correct1 - first correction matrix
correct2 - second correction matrix

Tensor

public Tensor(java.util.List<Vec3> axes)
Creates a tensor with the specified principal axes.

Parameters:
axes - the principal axes of the tensor
Method Detail

toTensorComponentString

public java.lang.String toTensorComponentString()
Returns a string giving the components of the tensor, separated by spaces. The order is k11, k22, k33, k12, k23, k13.

Returns:
a string giving the components of the tensor, separated by spaces

fromDirections

public static Tensor fromDirections(Vec3 k1,
                                    Vec3 k2,
                                    Vec3 k3)
Creates a tensor with the specified axes.

Parameters:
k1 - major axis
k2 - intermediate axis
k3 - minor axis
Returns:
a tensor with the specified axes

getAxis

public Vec3 getAxis(int axis)
Returns one of the tensor's three principal axes as a vector.

Parameters:
axis - 0 for major axis, 1 for intermediate, and 2 for minor
Returns:
the requested axis

toStrings

public java.util.List<java.lang.String> toStrings()
Returns the principal directions as a list of strings. The order of the parameters is the same as the order of the headers provided by getHeaders().

Returns:
the principal directions as a list of strings

getEmptyFields

public static java.util.List<java.lang.String> getEmptyFields()
Returns a list of empty strings equal in length to the number of parameters.

Returns:
a list of empty strings equal in length to the number of parameters

getHeaders

public static java.util.List<java.lang.String> getHeaders()
Returns the headers describing the parameters as a list of strings.

Returns:
the headers describing the parameters