Class Grid3D#

Inheritance Relationships#

Base Type#

Class Documentation#

class Grid3D : public OrbitUtils::CppPyWrapper#

Public Functions

Grid3D(int nX, int nY, int nZ)#

Constructor

virtual ~Grid3D()#
double ***getArr3D()#

Returns the reference to the inner 3D array. The array is val[z][x][y].

Returns the reference to the inner 3D array

double **getSlice2D(int zInd)#

Returns the reference to one 2D slice of the inner 3D array

Grid2D *getGrid2D(int zInd)#

Returns the reference to Grid2D slice of the inner 3D array

int getSizeX()#

Returns the grid size in x-direction

int getSizeY()#

Returns the grid size in y-direction

int getSizeZ()#

Returns the grid size in z-direction

double getGridX(int index)#

Returns the grid point x-coordinate for this index.

double getGridY(int index)#

Returns the grid point y-coordinate for this index.

double getGridZ(int index)#

Returns the grid point z-coordinate for this index.

Returns the grid point z-coordinate for this index. The z-grid is different from x and y. We redefined it to allow the periodicity along the longitudinal coordinate in the beam.

double getStepX()#

Returns the grid step along x-axis

double getStepY()#

Returns the grid step along y-axis

double getStepZ()#

Returns the grid step along z-axis

double getMaxX()#

Returns the maximal value of the grid in x-axis

Returns the max x in the grid points

double getMinX()#

Returns the minimal value of the grid in x-axis

Returns the min x in the grid points

double getMaxY()#

Returns the maximal value of the grid in y-axis

Returns the max y in the grid points

double getMinY()#

Returns the minimal value of the grid in y-axis

Returns the min y in the grid points

double getMaxZ()#

Returns the maximal value of the grid in z-axis

Returns the max z in the grid points

double getMinZ()#

Returns the minimal value of the grid in z-axis

Returns the min z in the grid points

void setGridX(double xMin, double xMax)#

Sets the limits for the x-grid

void setGridY(double yMin, double yMax)#

Sets the limits for the y-grid

void setGridZ(double zMin, double zMax)#

Sets the limits for the z-grid

Sets the limits for the z-grid. The z-grid is different from x and y. We redefined it to allow the periodicity along the longitudinal coordinate in the beam.

double getValueOnGrid(int ix, int iy, int iz)#

Returns the non-interpolated value on grid

Returns the value on grid

void setValue(double value, int ix, int iy, int iz)#

Sets the value to the one point of the 3D grid

void setZero()#

define all elements as 0.0

Set all array values to zero

void multiply(double coeff)#

multiply all elements of Grid3D by constant coefficient

Multiply all elements of Grid3D by constant coefficient

void setLongWrapping(int isWrapped)#

If it is equal 0 we do not have longitudinal wrapping.

int getLongWrapping()#

If it is equal 0 we do not have longitudinal wrapping.

void binBunch(Bunch *bunch)#

Bins the Bunch into the 2D grid. If bunch has a macrosize particle attribute it will be used.

Bins the Bunch into the 3D grid. If bunch has a macrosize particle attribute it will be used.

void binBunch(Bunch *bunch, double lambda)#

Bins the Bunch into the 2D grid. If bunch has a macrosize particle attribute it will be used. The coordinates of the particles will be wrapped longitudinally with period of lambda.

Bins the Bunch into the 3D grid. If bunch has a macrosize particle attribute it will be used. This method will wrap the bunch particles in the longitudonal directions if longWrapping = 1.

void binBunchSlice2D(Bunch *bunch)#

Bins the Bunch into the 3D grid slice by slice. No interpolation between x-y 2D slices during the binning. If bunch has a macrosize particle attribute it will be used. This method is used in SpaceChargeCalcSliceBySlice2D.cc.

void binValueSlice2D(double macroSize, double x, double y, double z)#

Bins the value into the grid 3D slice by slice. No interpolation between x-y 2D slices during the binning. This method is used in SpaceChargeCalcSliceBySlice2D.cc.

void binValue(double macroSize, double x, double y, double z)#

Bins the value onto grid

Bins the value into the grid 3D assuming a wrapped longitudinal direction

void calcGradient(double x, double &gradX, double y, double &gradY, double z, double &gradZ)#

Calculates gradient of Arr3D. gradX = gradient_x(Arr3D), and so on

Calculates gradient of Arr3D. gradX = gradient_x(Arr3D), and so on for longitudinally wrapped grid

double getValue(double x, double y, double z)#

Calculates value at the point with coordinates x,y,z

double getSum()#

returns the sum of all grid points

double getSliceSum(int iZ)#

returns the sum of all grid points in the slice with index iZ

double getSliceSum(double z)#

returns the sum of all grid points in the slice with position z

void synchronizeMPI(pyORBIT_MPI_Comm *pyComm)#

synchronize MPI

Protected Functions

double calcValueOnX(int iX, int iY, int iZ, double Wxm, double Wx0, double Wxp)#

Calculates interpolated value along x-axis for fixed y and z

double calcValueOnY(int iX, int iY, int iZ, double Wym, double Wy0, double Wyp)#

Calculates interpolated value along y-axis for fixed x and z

double calcSheetGradient(int iZ, int iX, int iY, double xm, double x0, double xp, double ym, double y0, double yp)#

Calculates Gradient from each z-sheet without interpolating in z

void getIndAndFracX(double x, int &ind, double &frac)#
void getIndAndFracY(double y, int &ind, double &frac)#
void getGridIndAndFrac(double x, int &xInd, double &xFrac, double y, int &yInd, double &yFrac, double z, int &zInd, double &zFrac)#

Protected Attributes

double ***Arr3D#
Grid2D **grid2dArr#
int nZ_#
int nX_#
int nY_#
double xMin_#
double xMax_#
double yMin_#
double yMax_#
double zMin_#
double zMax_#
double dx_#
double dy_#
double dz_#
int longWrapping#