|
GOAT (Geometrical optics application tool) 0.1
|
Template class to store arbitrary information in a 3D-grid This template class provides a virtual 3D-grid of arbitrary values which can be used to store e.g. the electric field in a volume. It circumscribes a sphere with radius r0 and virtual means here, that only the parts which are needed were allocated, but for the programmer it seems like a whole array or grid. By adding an object to the grid, the memory for the grid around the object (circumscribed box) is allocated, so one can store the electric field inside the object. The cells of the grid can be addressed with help of the bracket()-operator with different arguments. More...
#include <superarray.h>
Public Member Functions | |
| void | add (const SuperArray &S) |
Adds another SuperArray object. In this function, all array elements from S are added to the existing array elements. *. | |
| bool | addInc (ObjectShape *E, const bool isAbsolute=false) |
| Add object to SuperArray Add one objects to the SuperArray. An object is added to the SuperArray by allocating memory that corresponds to the volume of the circumscribing cuboid. | |
| bool | addInc (std::vector< ObjectShape * >Obj, int numObj, const bool isAbsolute=false) |
| Summing up SuperArray Here, all cell contents are first added up. The absolute value is taken from the result and squared. | |
| void | allockugel () |
| void | arrangeGrids () |
| void | clear () |
| Clear the SuperArray and release the allocated memory. | |
| void | clear () |
| void | copy (const SuperArray &S) |
Copies SuperArray object Here, S will be copied into the existing SuperArray and all elements will be overridden. | |
| void | fill (const T &x) |
Fill the whole SuperArray with value x. | |
| maths::Vector< INDEX_TYPE > | gitterpunkt (maths::Vector< double > P) |
| bool | inObject (INDEX_TYPE ix, INDEX_TYPE iy, INDEX_TYPE iz, int i) |
checks if a point indicated by its indices (ix, iy, iz) is inside the i -th object | |
| bool | inObject (maths::Vector< double > P, int i) |
checks if P is inside the i-th object (p in real coordinates) | |
| bool | inObject (maths::Vector< INDEX_TYPE > Pi, int i) |
checks if Pi is inside the i-th object (pi in indices) | |
| maths::Vector< INDEX_TYPE > | kugelindex (maths::Vector< INDEX_TYPE > Pi) |
Checks if the point Pi (indicated by the indices) is inside the calculation sphere The function returns the Vector Pi, if it is inside the calculation sphere otherwise a the vector (-1,-1,-1) is returned (for internal use only) | |
| T | kugelwert (int ix, int iy, int iz) |
| for internal use only | |
| T | kugelwert (maths::Vector< int > Pi) |
| for internal use only | |
| void | makeReal () |
| T & | operator() (INDEX_TYPE ix, INDEX_TYPE iy, INDEX_TYPE iz) |
| gives the content of the cell[ix][iy][iz] | |
| T & | operator() (int i, INDEX_TYPE ix, INDEX_TYPE iy, INDEX_TYPE iz, bool isObjectCoordinate=true) |
| returns the content of the i-th object, with the grid-coordinates ix,iy,iz | |
| T & | operator() (int i, maths::Vector< double > P) |
| gives back the contents of the cell at P from the i-th object (faster) | |
| T & | operator() (int i, maths::Vector< INDEX_TYPE > Pi) |
| gives back the contents of the cell with indices stored in Pi from the i-th object (faster) | |
| T & | operator() (maths::Vector< double > P) |
| gives back the contents of the cell at P | |
| T & | operator() (maths::Vector< INDEX_TYPE > Pi) |
| gives back the contents of the cell with indices stored in Pi | |
| SuperArray & | operator= (const SuperArray &S) |
| Assignment operator. | |
| bool | read (std::string fname) |
| void | reinit (double r0, INDEX_TYPE n) |
| void | reinit (double r0, INDEX_TYPE nx, INDEX_TYPE ny, INDEX_TYPE nz) |
| void | removeAllObjects () |
| void | removeObject (int i) |
| void | setActive (int i) |
| void | setInactive (int i) |
| void | setNumberOfCellsPerDirection (INDEX_TYPE no) |
| void | sub (const SuperArray &S) |
Subtract another SuperArray object. In this function, all array elements from S are subtracted from the existing array elements. | |
| SuperArray () | |
| SuperArray (const SuperArray &S) | |
| SuperArray (double r0, INDEX_TYPE nx, INDEX_TYPE ny, INDEX_TYPE nz, const int typ=IN_OBJECT) | |
| Constructor for SuperArray. | |
| SuperArray (double r0, INDEX_TYPE nx, INDEX_TYPE ny, INDEX_TYPE nz, std::vector< ObjectShape * >Obj, int numObjs, const bool isAbsolute=false, const int typ=IN_OBJECT) | |
| bool | write (std::string fname) |
| bool | write (std::string fname) |
| ~SuperArray () | |
Public Attributes | |
| maths::Vector< double > | d |
| Edge length of one cell in x-, y- and z-direction. | |
| T | dummy |
| int | Error |
| Holds an error number. | |
| std::vector< std::vector< std::vector< std::vector< T > > > > | G |
| Here, the data is stored. G[i][ix][iy][iz], whereas i: index of the object, ix,iy,iz: indices of the grid around object i. | |
| maths::Matrix< double > | H |
| bool | iscleared = true |
| Array is cleared (needed by the clear() function) | |
| bool | isequal |
| std::vector< std::vector< std::vector< T > > > | K |
| std::vector< maths::Vector< INDEX_TYPE > > | n |
| n[i]: Dimensions, i.e. number of subdivision in x-, y- and z-direction | |
| maths::Vector< INDEX_TYPE > | nges |
| Vector which contains the number of subdivisions in x-, y- and z-direction for the whole (virtual) array. | |
| int | numObjs |
| Number of objects. | |
| std::vector< ObjectShape * > | Obj |
| here are the objects | |
| T | pc |
| std::vector< maths::Vector< INDEX_TYPE > > | Pul |
| maths::Matrix< double > | R |
| Transformation matrices in the local array coordinate system and backwards. | |
| double | r0 |
| Radius of the calculation sphere. | |
| int | type |
| Mainly used for inelastic scattering. type=IN_HOST means the grid is stored in the whole volume, type=IN_OBJECT means grid is only used in the (active) objects. | |
| std::vector< int > | ywerte |
| std::vector< std::vector< int > > | zwerte |
Template class to store arbitrary information in a 3D-grid This template class provides a virtual 3D-grid of arbitrary values which can be used to store e.g. the electric field in a volume. It circumscribes a sphere with radius r0 and virtual means here, that only the parts which are needed were allocated, but for the programmer it seems like a whole array or grid. By adding an object to the grid, the memory for the grid around the object (circumscribed box) is allocated, so one can store the electric field inside the object. The cells of the grid can be addressed with help of the bracket()-operator with different arguments.
Definition at line 25 of file superarray.h.
| GOAT::raytracing::SuperArray< T >::SuperArray | ( | ) |
Definition at line 191 of file superarray.h.
| GOAT::raytracing::SuperArray< T >::SuperArray | ( | double | r0, |
| INDEX_TYPE | nx, | ||
| INDEX_TYPE | ny, | ||
| INDEX_TYPE | nz, | ||
| const int | typ = IN_OBJECT ) |
Constructor for SuperArray.
| r0 | Radius of the circumscribed sphere nx, ny, nz number of cells in the x-, y-, z- direction |
| type | describes wether the whole space of the grid is allocated (IN_HOST) or in the objects only (IN_OBJECT) |
Definition at line 202 of file superarray.h.
| GOAT::raytracing::SuperArray< T >::SuperArray | ( | double | r0, |
| INDEX_TYPE | nx, | ||
| INDEX_TYPE | ny, | ||
| INDEX_TYPE | nz, | ||
| std::vector< ObjectShape * > | Obj, | ||
| int | numObjs, | ||
| const bool | isAbsolute = false, | ||
| const int | typ = IN_OBJECT ) |
Definition at line 220 of file superarray.h.
|
inline |
Definition at line 37 of file superarray.h.
|
inline |
Definition at line 59 of file superarray.h.
| void GOAT::raytracing::SuperArray< T >::add | ( | const SuperArray< T > & | S | ) |
Adds another SuperArray object. In this function, all array elements from S are added to the existing array elements. *.
Definition at line 871 of file superarray.h.
| bool GOAT::raytracing::SuperArray< T >::addInc | ( | ObjectShape * | E, |
| const bool | isAbsolute = false ) |
Add object to SuperArray Add one objects to the SuperArray. An object is added to the SuperArray by allocating memory that corresponds to the volume of the circumscribing cuboid.
| E | The object |
| isAbsolute | true: Location/size information in absolute coordinates |
Definition at line 323 of file superarray.h.
| bool GOAT::raytracing::SuperArray< T >::addInc | ( | std::vector< ObjectShape * > | Obj, |
| int | numObj, | ||
| const bool | isAbsolute = false ) |
Summing up SuperArray Here, all cell contents are first added up. The absolute value is taken from the result and squared.
Add objects to SuperArray Adds a list of objects to the SuperArray. An object is added to the SuperArray by allocating memory that corresponds to the volume of the circumscribing cuboid.
| Obj | The object list |
| numObj | Number of objects to add |
| isAbsolute | true: Location/size information in absolute coordinates |
Definition at line 239 of file superarray.h.
| void GOAT::raytracing::SuperArray< T >::allockugel | ( | ) |
Definition at line 1014 of file superarray.h.
| void GOAT::raytracing::SuperArray< T >::arrangeGrids | ( | ) |
This method rearranges all grids after a change of r0 or the number of cells per direction
Definition at line 288 of file superarray.h.
| void GOAT::raytracing::SuperArray< T >::clear | ( | ) |
Clear the SuperArray and release the allocated memory.
Definition at line 684 of file superarray.h.
| void GOAT::raytracing::SuperArray< std::vector< GOAT::raytracing::gridEntry > >::clear | ( | ) |
| void GOAT::raytracing::SuperArray< T >::copy | ( | const SuperArray< T > & | S | ) |
Copies SuperArray object Here, S will be copied into the existing SuperArray and all elements will be overridden.
Definition at line 777 of file superarray.h.
| void GOAT::raytracing::SuperArray< T >::fill | ( | const T & | x | ) |
Fill the whole SuperArray with value x.
Definition at line 964 of file superarray.h.
| maths::Vector< INDEX_TYPE > GOAT::raytracing::SuperArray< T >::gitterpunkt | ( | maths::Vector< double > | P | ) |
Definition at line 267 of file superarray.h.
| bool GOAT::raytracing::SuperArray< T >::inObject | ( | INDEX_TYPE | ix, |
| INDEX_TYPE | iy, | ||
| INDEX_TYPE | iz, | ||
| int | i ) |
checks if a point indicated by its indices (ix, iy, iz) is inside the i -th object
Definition at line 427 of file superarray.h.
| bool GOAT::raytracing::SuperArray< T >::inObject | ( | maths::Vector< double > | P, |
| int | i ) |
checks if P is inside the i-th object (p in real coordinates)
Definition at line 417 of file superarray.h.
| bool GOAT::raytracing::SuperArray< T >::inObject | ( | maths::Vector< INDEX_TYPE > | Pi, |
| int | i ) |
checks if Pi is inside the i-th object (pi in indices)
Definition at line 422 of file superarray.h.
| maths::Vector< INDEX_TYPE > GOAT::raytracing::SuperArray< T >::kugelindex | ( | maths::Vector< INDEX_TYPE > | Pi | ) |
Checks if the point Pi (indicated by the indices) is inside the calculation sphere The function returns the Vector Pi, if it is inside the calculation sphere otherwise a the vector (-1,-1,-1) is returned (for internal use only)
for internal use only
Definition at line 1062 of file superarray.h.
| T GOAT::raytracing::SuperArray< T >::kugelwert | ( | int | ix, |
| int | iy, | ||
| int | iz ) |
for internal use only
Definition at line 1132 of file superarray.h.
| T GOAT::raytracing::SuperArray< T >::kugelwert | ( | maths::Vector< int > | Pi | ) |
for internal use only
Definition at line 1103 of file superarray.h.
| void GOAT::raytracing::SuperArray< T >::makeReal | ( | ) |
Definition at line 1001 of file superarray.h.
| T & GOAT::raytracing::SuperArray< T >::operator() | ( | INDEX_TYPE | ix, |
| INDEX_TYPE | iy, | ||
| INDEX_TYPE | iz ) |
gives the content of the cell[ix][iy][iz]
Definition at line 432 of file superarray.h.
| T & GOAT::raytracing::SuperArray< T >::operator() | ( | int | i, |
| INDEX_TYPE | ix, | ||
| INDEX_TYPE | iy, | ||
| INDEX_TYPE | iz, | ||
| bool | isObjectCoordinate = true ) |
returns the content of the i-th object, with the grid-coordinates ix,iy,iz
| i | number of the object |
| ix | gives back the contents of the cell from the i-th object with the indices (ix,iy,iz) (faster) |
Definition at line 523 of file superarray.h.
| T & GOAT::raytracing::SuperArray< T >::operator() | ( | int | i, |
| maths::Vector< double > | P ) |
gives back the contents of the cell at P from the i-th object (faster)
Definition at line 649 of file superarray.h.
| T & GOAT::raytracing::SuperArray< T >::operator() | ( | int | i, |
| maths::Vector< INDEX_TYPE > | Pi ) |
gives back the contents of the cell with indices stored in Pi from the i-th object (faster)
Definition at line 550 of file superarray.h.
| T & GOAT::raytracing::SuperArray< T >::operator() | ( | maths::Vector< double > | P | ) |
gives back the contents of the cell at P
Definition at line 598 of file superarray.h.
| T & GOAT::raytracing::SuperArray< T >::operator() | ( | maths::Vector< INDEX_TYPE > | Pi | ) |
gives back the contents of the cell with indices stored in Pi
Definition at line 476 of file superarray.h.
| SuperArray< T > & GOAT::raytracing::SuperArray< T >::operator= | ( | const SuperArray< T > & | S | ) |
Assignment operator.
Definition at line 801 of file superarray.h.
| bool GOAT::raytracing::SuperArray< T >::read | ( | std::string | fname | ) |
|
inline |
Definition at line 749 of file superarray.h.
| void GOAT::raytracing::SuperArray< T >::reinit | ( | double | r0, |
| INDEX_TYPE | nx, | ||
| INDEX_TYPE | ny, | ||
| INDEX_TYPE | nz ) |
Definition at line 755 of file superarray.h.
|
inline |
Definition at line 402 of file superarray.h.
|
inline |
Definition at line 387 of file superarray.h.
|
inline |
Definition at line 253 of file superarray.h.
|
inline |
Definition at line 247 of file superarray.h.
|
inline |
set the number of cells per direction
Definition at line 168 of file superarray.h.
| void GOAT::raytracing::SuperArray< T >::sub | ( | const SuperArray< T > & | S | ) |
Subtract another SuperArray object. In this function, all array elements from S are subtracted from the existing array elements.
Definition at line 908 of file superarray.h.
| bool GOAT::raytracing::SuperArray< T >::write | ( | std::string | fname | ) |
| bool GOAT::raytracing::SuperArray< GOAT::maths::Vector< std::complex< double > > >::write | ( | std::string | fname | ) |
| maths::Vector<double> GOAT::raytracing::SuperArray< T >::d |
Edge length of one cell in x-, y- and z-direction.
Definition at line 158 of file superarray.h.
| T GOAT::raytracing::SuperArray< T >::dummy |
Definition at line 153 of file superarray.h.
| int GOAT::raytracing::SuperArray< T >::Error |
Holds an error number.
Definition at line 145 of file superarray.h.
| std::vector<std::vector <std::vector <std::vector <T> > > > GOAT::raytracing::SuperArray< T >::G |
Here, the data is stored. G[i][ix][iy][iz], whereas i: index of the object, ix,iy,iz: indices of the grid around object i.
Definition at line 151 of file superarray.h.
| maths::Matrix<double> GOAT::raytracing::SuperArray< T >::H |
Definition at line 163 of file superarray.h.
| bool GOAT::raytracing::SuperArray< T >::iscleared = true |
Array is cleared (needed by the clear() function)
Definition at line 161 of file superarray.h.
| bool GOAT::raytracing::SuperArray< T >::isequal |
Definition at line 160 of file superarray.h.
| std::vector< std::vector < std::vector <T> > > GOAT::raytracing::SuperArray< T >::K |
Definition at line 152 of file superarray.h.
| std::vector<maths::Vector<INDEX_TYPE> > GOAT::raytracing::SuperArray< T >::n |
n[i]: Dimensions, i.e. number of subdivision in x-, y- and z-direction
Definition at line 155 of file superarray.h.
| maths::Vector<INDEX_TYPE> GOAT::raytracing::SuperArray< T >::nges |
Vector which contains the number of subdivisions in x-, y- and z-direction for the whole (virtual) array.
Definition at line 156 of file superarray.h.
| int GOAT::raytracing::SuperArray< T >::numObjs |
Number of objects.
Definition at line 147 of file superarray.h.
| std::vector<ObjectShape*> GOAT::raytracing::SuperArray< T >::Obj |
here are the objects
Definition at line 146 of file superarray.h.
| T GOAT::raytracing::SuperArray< T >::pc |
Definition at line 162 of file superarray.h.
| std::vector<maths::Vector<INDEX_TYPE> > GOAT::raytracing::SuperArray< T >::Pul |
Definition at line 154 of file superarray.h.
| maths::Matrix<double> GOAT::raytracing::SuperArray< T >::R |
Transformation matrices in the local array coordinate system and backwards.
Definition at line 163 of file superarray.h.
| double GOAT::raytracing::SuperArray< T >::r0 |
Radius of the calculation sphere.
Definition at line 159 of file superarray.h.
| int GOAT::raytracing::SuperArray< T >::type |
Mainly used for inelastic scattering. type=IN_HOST means the grid is stored in the whole volume, type=IN_OBJECT means grid is only used in the (active) objects.
Definition at line 148 of file superarray.h.
| std::vector<int> GOAT::raytracing::SuperArray< T >::ywerte |
Definition at line 149 of file superarray.h.
| std::vector<std::vector<int> > GOAT::raytracing::SuperArray< T >::zwerte |
Definition at line 150 of file superarray.h.