GOAT (Geometrical optics application tool) 0.1
Loading...
Searching...
No Matches
GOAT::raytracing::SuperGrid< T > Class Template Reference

#include <supergrid.h>

Public Member Functions

void add (const SuperGrid &S)
 Adds another SuperGrid object. In this function, all array elements from S are added to the existing array elements.
bool addObject (ObjectShape **Obj, int numObj, const bool isAbsolute=false)
 Add objects to SuperGrid Adds a list of objects to the SuperGrid. An object is added to the SuperGrid by allocating memory that corresponds to the volume of the circumscribing cuboid.
bool addObject (ObjectShape *E, const bool isAbsolute=false)
 Add object to SuperGrid Add one objects to the SuperGrid. An object is added to the SuperGrid by allocating memory that corresponds to the volume of the circumscribing cuboid.
bool addPlane (maths::Vector< double > P, maths::Vector< double > n, double d1, double d2, maths::Vector< double > cellSize)
void allockugel ()
void clear ()
 Clear the SuperGrid and release the allocated memory.
void copy (const SuperGrid &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< int > gitterpunkt (maths::Vector< double > P)
bool inObject (int ix, int iy, int 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< int > Pi, int i)
 checks if Pi is inside the i-th object (pi in indices)
maths::Vector< int > kugelindex (maths::Vector< int > 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)
kugelwert (int ix, int iy, int iz)
kugelwert (maths::Vector< int > Pi)
T & operator() (int i, int ix, int iy, int 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)
T & operator() (int i, maths::Vector< int > Pi)
T & operator() (int ix, int iy, int iz)
 gives the content of the cell[ix][iy][iz]
T & operator() (maths::Vector< double > P)
T & operator() (maths::Vector< int > Pi)
SuperGridoperator= (const SuperGrid &S)
 Assignment operator.
void sub (const SuperGrid &S)
 Subtract another SuperArray object. In this function, all array elements from S are subtracted from the existing array elements.
 SuperGrid ()
 SuperGrid (double r0, int nx, int ny, int nz, const int typ=IN_HOST)
 Constructor for SuperArray.
 SuperGrid (double r0, int nx, int ny, int nz, ObjectShape **Obj, int numObjs, const bool isAbsolute=false, const int typ=0)
 ~SuperGrid ()

Public Attributes

maths::Vector< double > d
dummy
int Error
std::vector< std::vector< std::vector< std::vector< T > > > > G
maths::Matrix< double > H
bool iscleared
bool isequal
std::vector< std::vector< std::vector< T > > > K
std::vector< GOAT::maths::Vector< int > > n
GOAT::maths::Vector< int > nges
int numObjs
 Number of objects.
std::vector< ObjectShape * > Obj
 List of the objects.
maths::Vector< std::complex< double > > pc
std::vector< GOAT::maths::Vector< int > > Pul
maths::Matrix< double > R
double r0
int type
 Type of grid (0: Field is stored only in the objects, 1: field is stored in the surroundings only, 2: field is stored in the whole volume.
int * ywerte
int ** zwerte

Friends

std::ostream & operator<< (std::ostream &os, const SuperGrid &S)

Detailed Description

template<class T>
class GOAT::raytracing::SuperGrid< T >

This class provides a virtual 3D-grid of complex vectors 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 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 22 of file supergrid.h.

Constructor & Destructor Documentation

◆ SuperGrid() [1/3]

template<class T>
GOAT::raytracing::SuperGrid< T >::SuperGrid ( )

Definition at line 155 of file supergrid.h.

◆ SuperGrid() [2/3]

template<class T>
GOAT::raytracing::SuperGrid< T >::SuperGrid ( double r0,
int nx,
int ny,
int nz,
const int typ = IN_HOST )

Constructor for SuperArray.

Parameters
r0Radius of the circumscribed sphere nx, ny, nz number of cells in the x-, y-, z- direction
typedescribes wether the whole space of the grid is allocated (IN_HOST) or in the objects only (IN_OBJECT)

Definition at line 169 of file supergrid.h.

◆ SuperGrid() [3/3]

template<class T>
GOAT::raytracing::SuperGrid< T >::SuperGrid ( double r0,
int nx,
int ny,
int nz,
ObjectShape ** Obj,
int numObjs,
const bool isAbsolute = false,
const int typ = 0 )

Definition at line 192 of file supergrid.h.

◆ ~SuperGrid()

template<class T>
GOAT::raytracing::SuperGrid< T >::~SuperGrid ( )
inline

Definition at line 34 of file supergrid.h.

Member Function Documentation

◆ add()

template<class T>
void GOAT::raytracing::SuperGrid< T >::add ( const SuperGrid< T > & S)

Adds another SuperGrid object. In this function, all array elements from S are added to the existing array elements.

Definition at line 696 of file supergrid.h.

◆ addObject() [1/2]

template<class T>
bool GOAT::raytracing::SuperGrid< T >::addObject ( ObjectShape ** Obj,
int numObj,
const bool isAbsolute = false )

Add objects to SuperGrid Adds a list of objects to the SuperGrid. An object is added to the SuperGrid by allocating memory that corresponds to the volume of the circumscribing cuboid.

Parameters
ObjThe object list
numObjNumber of objects to add
isAbsolutetrue: Location/size information in absolute coordinates

Definition at line 212 of file supergrid.h.

◆ addObject() [2/2]

template<class T>
bool GOAT::raytracing::SuperGrid< T >::addObject ( ObjectShape * E,
const bool isAbsolute = false )

Add object to SuperGrid Add one objects to the SuperGrid. An object is added to the SuperGrid by allocating memory that corresponds to the volume of the circumscribing cuboid.

Parameters
EThe object
isAbsolutetrue: Location/size information in absolute coordinates add new object to the grid

Definition at line 290 of file supergrid.h.

◆ addPlane()

template<class T>
bool GOAT::raytracing::SuperGrid< T >::addPlane ( maths::Vector< double > P,
maths::Vector< double > n,
double d1,
double d2,
maths::Vector< double > cellSize )

Definition at line 238 of file supergrid.h.

◆ allockugel()

template<class T>
void GOAT::raytracing::SuperGrid< T >::allockugel ( )

Definition at line 822 of file supergrid.h.

◆ clear()

template<class T>
void GOAT::raytracing::SuperGrid< T >::clear ( )

Clear the SuperGrid and release the allocated memory.

Definition at line 557 of file supergrid.h.

◆ copy()

template<class T>
void GOAT::raytracing::SuperGrid< T >::copy ( const SuperGrid< T > & S)

Copies SuperArray object Here, S will be copied into the existing SuperArray and all elements will be overridden.

Definition at line 624 of file supergrid.h.

◆ fill()

template<class T>
void GOAT::raytracing::SuperGrid< T >::fill ( const T & x)

Fill the whole SuperArray with value x.

Definition at line 786 of file supergrid.h.

◆ gitterpunkt()

template<class T>
maths::Vector< int > GOAT::raytracing::SuperGrid< T >::gitterpunkt ( maths::Vector< double > P)

Definition at line 219 of file supergrid.h.

◆ inObject() [1/3]

template<class T>
bool GOAT::raytracing::SuperGrid< T >::inObject ( int ix,
int iy,
int iz,
int i )

checks if a point indicated by its indices (ix, iy, iz) is inside the i -th object

Definition at line 360 of file supergrid.h.

◆ inObject() [2/3]

template<class T>
bool GOAT::raytracing::SuperGrid< T >::inObject ( maths::Vector< double > P,
int i )

checks if P is inside the i-th object (p in real coordinates)

Definition at line 350 of file supergrid.h.

◆ inObject() [3/3]

template<class T>
bool GOAT::raytracing::SuperGrid< T >::inObject ( maths::Vector< int > Pi,
int i )

checks if Pi is inside the i-th object (pi in indices)

Definition at line 355 of file supergrid.h.

◆ kugelindex()

template<class T>
maths::Vector< int > GOAT::raytracing::SuperGrid< T >::kugelindex ( maths::Vector< int > 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)

◆ kugelwert() [1/2]

template<class T>
T GOAT::raytracing::SuperGrid< T >::kugelwert ( int ix,
int iy,
int iz )

◆ kugelwert() [2/2]

template<class T>
T GOAT::raytracing::SuperGrid< T >::kugelwert ( maths::Vector< int > Pi)

◆ operator()() [1/6]

template<class T>
T & GOAT::raytracing::SuperGrid< T >::operator() ( int i,
int ix,
int iy,
int iz,
bool isObjectCoordinate = true )

returns the content of the i-th object, with the grid-coordinates ix,iy,iz

Parameters
inumber of the object
ix

Definition at line 433 of file supergrid.h.

◆ operator()() [2/6]

template<class T>
T & GOAT::raytracing::SuperGrid< T >::operator() ( int i,
maths::Vector< double > P )

Definition at line 532 of file supergrid.h.

◆ operator()() [3/6]

template<class T>
T & GOAT::raytracing::SuperGrid< T >::operator() ( int i,
maths::Vector< int > Pi )

Definition at line 453 of file supergrid.h.

◆ operator()() [4/6]

template<class T>
T & GOAT::raytracing::SuperGrid< T >::operator() ( int ix,
int iy,
int iz )

gives the content of the cell[ix][iy][iz]

Definition at line 365 of file supergrid.h.

◆ operator()() [5/6]

template<class T>
T & GOAT::raytracing::SuperGrid< T >::operator() ( maths::Vector< double > P)

Definition at line 494 of file supergrid.h.

◆ operator()() [6/6]

template<class T>
T & GOAT::raytracing::SuperGrid< T >::operator() ( maths::Vector< int > Pi)

Definition at line 398 of file supergrid.h.

◆ operator=()

template<class T>
SuperGrid< T > & GOAT::raytracing::SuperGrid< T >::operator= ( const SuperGrid< T > & S)

Assignment operator.

Definition at line 636 of file supergrid.h.

◆ sub()

template<class T>
void GOAT::raytracing::SuperGrid< T >::sub ( const SuperGrid< T > & S)

Subtract another SuperArray object. In this function, all array elements from S are subtracted from the existing array elements.

Definition at line 733 of file supergrid.h.

◆ operator<<

template<class T>
std::ostream & operator<< ( std::ostream & os,
const SuperGrid< T > & S )
friend

Definition at line 769 of file supergrid.h.

Member Data Documentation

◆ d

template<class T>
maths::Vector<double> GOAT::raytracing::SuperGrid< T >::d

Definition at line 140 of file supergrid.h.

◆ dummy

template<class T>
T GOAT::raytracing::SuperGrid< T >::dummy

Definition at line 136 of file supergrid.h.

◆ Error

template<class T>
int GOAT::raytracing::SuperGrid< T >::Error

Definition at line 145 of file supergrid.h.

◆ G

template<class T>
std::vector<std::vector<std::vector<std::vector<T> > > > GOAT::raytracing::SuperGrid< T >::G

Definition at line 134 of file supergrid.h.

◆ H

template<class T>
maths::Matrix<double> GOAT::raytracing::SuperGrid< T >::H

Definition at line 146 of file supergrid.h.

◆ iscleared

template<class T>
bool GOAT::raytracing::SuperGrid< T >::iscleared

Definition at line 143 of file supergrid.h.

◆ isequal

template<class T>
bool GOAT::raytracing::SuperGrid< T >::isequal

Definition at line 142 of file supergrid.h.

◆ K

template<class T>
std::vector<std::vector<std::vector<T> > > GOAT::raytracing::SuperGrid< T >::K

Definition at line 135 of file supergrid.h.

◆ n

template<class T>
std::vector<GOAT::maths::Vector<int> > GOAT::raytracing::SuperGrid< T >::n

Definition at line 138 of file supergrid.h.

◆ nges

template<class T>
GOAT::maths::Vector<int> GOAT::raytracing::SuperGrid< T >::nges

Definition at line 139 of file supergrid.h.

◆ numObjs

template<class T>
int GOAT::raytracing::SuperGrid< T >::numObjs

Number of objects.

Definition at line 129 of file supergrid.h.

◆ Obj

template<class T>
std::vector<ObjectShape*> GOAT::raytracing::SuperGrid< T >::Obj

List of the objects.

Definition at line 128 of file supergrid.h.

◆ pc

template<class T>
maths::Vector<std::complex<double> > GOAT::raytracing::SuperGrid< T >::pc

Definition at line 144 of file supergrid.h.

◆ Pul

template<class T>
std::vector<GOAT::maths::Vector<int> > GOAT::raytracing::SuperGrid< T >::Pul

Definition at line 137 of file supergrid.h.

◆ R

template<class T>
maths::Matrix<double> GOAT::raytracing::SuperGrid< T >::R

Definition at line 146 of file supergrid.h.

◆ r0

template<class T>
double GOAT::raytracing::SuperGrid< T >::r0

Definition at line 141 of file supergrid.h.

◆ type

template<class T>
int GOAT::raytracing::SuperGrid< T >::type

Type of grid (0: Field is stored only in the objects, 1: field is stored in the surroundings only, 2: field is stored in the whole volume.

Definition at line 130 of file supergrid.h.

◆ ywerte

template<class T>
int* GOAT::raytracing::SuperGrid< T >::ywerte

Definition at line 131 of file supergrid.h.

◆ zwerte

template<class T>
int** GOAT::raytracing::SuperGrid< T >::zwerte

Definition at line 132 of file supergrid.h.


The documentation for this class was generated from the following file: