Class Grid3Ddouble

  • All Implemented Interfaces:
    Grid3D, java.io.Serializable

    public class Grid3Ddouble
    extends java.lang.Object
    implements Grid3D, java.io.Serializable
    a 3D Grid of doubles
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Grid3Ddouble​(int xDim, int yDim, int zDim)
      creates a new Grid3Ddouble of dimensions xDim by yDim by zDim with optional wraparound
      Grid3Ddouble​(int xDim, int yDim, int zDim, boolean wrapX, boolean wrapY, boolean wrapZ)
      creates a new Grid3Ddouble of dimensions xDim by yDim by zDim without wraparound
    • Method Summary

      Modifier and Type Method Description
      void Add​(int i, double val)
      adds to the current field value at the specified index
      void Add​(int x, int y, int z, double val)
      adds to the current field value at the specified coordinates
      void AddAll​(double val)
      adds specified value to all entries of the curr field
      void BoundAll​(double min, double max)
      Bounds all values in the current field between min and max
      double Get​(int i)
      gets the current field value at the specified index
      double Get​(int x, int y, int z)
      gets the current field value at the specified coordinates
      double GetAvg()
      gets the average value of all squares in the current field
      double[] GetField()
      returns the complete field as an array
      double GradientX​(int x, int y, int z)
      returns the gradient of the field in the X direction at the coordinates specified
      double GradientX​(int x, int y, int z, double boundaryCond)
      returns the gradient of the field in the X direction at the coordinates specified, will use the boundary value provided for gradients that go over the boundary
      double GradientY​(int x, int y, int z)
      returns the gradient of the field in the Y direction at the coordinates specified
      double GradientY​(int x, int y, int z, double boundaryCond)
      returns the gradient of the field in the Y direction at the coordinates specified, will use the boundary value provided for gradients that go over the boundary
      double GradientZ​(int x, int y, int z)
      returns the gradient of the field in the Z direction at the coordinates specified
      double GradientZ​(int x, int y, int z, double boundaryCond)
      returns the gradient of the field in the Z direction at the coordinates specified, will use the boundary value provided for gradients that go over the boundary
      boolean IsWrapX()  
      boolean IsWrapY()  
      boolean IsWrapZ()  
      int Length()  
      void Scale​(int i, double val)
      multiplies the current field value at the specified index
      void Scale​(int x, int y, int z, double val)
      multiplies the current field value at the specified coordinates
      void ScaleAll​(double val)
      multiplies all entries in the field by the value
      void Set​(int i, double val)
      sets the current field value at the specified index
      void Set​(int x, int y, int z, double val)
      sets the current field value at the specified coordinates
      void SetAll​(double val)
      sets all squares in current the field to the specified value
      int Xdim()  
      int Ydim()  
      int Zdim()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • xDim

        public final int xDim
      • yDim

        public final int yDim
      • zDim

        public final int zDim
      • length

        public final int length
      • wrapX

        public boolean wrapX
      • wrapY

        public boolean wrapY
      • wrapZ

        public boolean wrapZ
    • Constructor Detail

      • Grid3Ddouble

        public Grid3Ddouble​(int xDim,
                            int yDim,
                            int zDim,
                            boolean wrapX,
                            boolean wrapY,
                            boolean wrapZ)
        creates a new Grid3Ddouble of dimensions xDim by yDim by zDim without wraparound
      • Grid3Ddouble

        public Grid3Ddouble​(int xDim,
                            int yDim,
                            int zDim)
        creates a new Grid3Ddouble of dimensions xDim by yDim by zDim with optional wraparound
    • Method Detail

      • Get

        public double Get​(int i)
        gets the current field value at the specified index
      • Get

        public double Get​(int x,
                          int y,
                          int z)
        gets the current field value at the specified coordinates
      • Set

        public void Set​(int i,
                        double val)
        sets the current field value at the specified index
      • Set

        public void Set​(int x,
                        int y,
                        int z,
                        double val)
        sets the current field value at the specified coordinates
      • GetField

        public double[] GetField()
        returns the complete field as an array
      • Add

        public void Add​(int x,
                        int y,
                        int z,
                        double val)
        adds to the current field value at the specified coordinates
      • Scale

        public void Scale​(int x,
                          int y,
                          int z,
                          double val)
        multiplies the current field value at the specified coordinates
      • Scale

        public void Scale​(int i,
                          double val)
        multiplies the current field value at the specified index
      • Add

        public void Add​(int i,
                        double val)
        adds to the current field value at the specified index
      • BoundAll

        public void BoundAll​(double min,
                             double max)
        Bounds all values in the current field between min and max
      • SetAll

        public void SetAll​(double val)
        sets all squares in current the field to the specified value
      • AddAll

        public void AddAll​(double val)
        adds specified value to all entries of the curr field
      • ScaleAll

        public void ScaleAll​(double val)
        multiplies all entries in the field by the value
      • GetAvg

        public double GetAvg()
        gets the average value of all squares in the current field
      • GradientX

        public double GradientX​(int x,
                                int y,
                                int z)
        returns the gradient of the field in the X direction at the coordinates specified
      • GradientY

        public double GradientY​(int x,
                                int y,
                                int z)
        returns the gradient of the field in the Y direction at the coordinates specified
      • GradientZ

        public double GradientZ​(int x,
                                int y,
                                int z)
        returns the gradient of the field in the Z direction at the coordinates specified
      • GradientX

        public double GradientX​(int x,
                                int y,
                                int z,
                                double boundaryCond)
        returns the gradient of the field in the X direction at the coordinates specified, will use the boundary value provided for gradients that go over the boundary
      • GradientY

        public double GradientY​(int x,
                                int y,
                                int z,
                                double boundaryCond)
        returns the gradient of the field in the Y direction at the coordinates specified, will use the boundary value provided for gradients that go over the boundary
      • GradientZ

        public double GradientZ​(int x,
                                int y,
                                int z,
                                double boundaryCond)
        returns the gradient of the field in the Z direction at the coordinates specified, will use the boundary value provided for gradients that go over the boundary
      • Xdim

        public int Xdim()
        Specified by:
        Xdim in interface Grid3D
      • Ydim

        public int Ydim()
        Specified by:
        Ydim in interface Grid3D
      • Zdim

        public int Zdim()
        Specified by:
        Zdim in interface Grid3D
      • Length

        public int Length()
        Specified by:
        Length in interface Grid3D
      • IsWrapX

        public boolean IsWrapX()
        Specified by:
        IsWrapX in interface Grid3D
      • IsWrapY

        public boolean IsWrapY()
        Specified by:
        IsWrapY in interface Grid3D
      • IsWrapZ

        public boolean IsWrapZ()
        Specified by:
        IsWrapZ in interface Grid3D