80 bool inObject(
int ix,
int iy,
int iz,
int i);
87 T&
operator () (
int i,
int ix,
int iy,
int iz,
bool isObjectCoordinate =
true);
93 void fill(
const T& x);
128 std::vector<ObjectShape*>
Obj;
134 std::vector<std::vector<std::vector<std::vector<T> > > >
G;
135 std::vector<std::vector<std::vector<T> > >
K;
137 std::vector<GOAT::maths::Vector<int> >
Pul;
138 std::vector<GOAT::maths::Vector<int> >
n;
221 int ix, iy, iz, jx, jy, jz, jxh, jyh, anzx;
241 if (abs(norm % GOAT::maths::ex) > 1E-5)
242 e1 = GOAT::maths::ex - (GOAT::maths::ex * norm) * norm;
244 e1 = GOAT::maths::ey - (GOAT::maths::ey * norm) * norm;
254 G = std::vector < std::vector < std::vector <std::vector> > >(1);
255 Pul = std::vector < GOAT::maths::Vector<int> >(1);
256 n = std::vector < GOAT::maths::Vector<int> >(1);
257 Obj = std::vector <ObjectShape*>(1);
261 G.push_back(std::vector<std::vector<std::vector<T> > >(1));
270 h = ceil(ediv(E->por,
d)) - floor(ediv(E->pul,
d));
275 for (
int ix = 0; ix <
n[
numObjs][0] + 1; ix++)
278 for (
int iy = 0; iy <
n[
numObjs][1] + 1; iy++)
303 h = ceil(ediv(E->
por,
d)) - floor(ediv(E->
pul,
d));
309 G = std::vector < std::vector < std:vector <std::vector> > >(1);
310 Pul = std::vector < GOAT::maths::Vector<int> >(1);
311 n = std::vector < GOAT::maths::Vector<int> >(1);
312 Obj = std::vector <ObjectShape*>(1);
316 G.push_back(std::vector<std::vector<std::vector<T> > >(1));
331 for (
int ix = 0; ix <
n[
numObjs][0] + 1; ix++)
334 for (
int iy = 0; iy <
n[
numObjs][1] + 1; iy++)
337 for (
int iz = 0; iz <
n[
numObjs][2] + 1; iz++)
352 return Obj[i]->isInside(P);
357 return (
Obj[i]->isInside(emult(Pi,
d)));
377 }
while ((i <
numObjs) && (!found));
379 if (!found)
return dummy;
385 return G[i][Pi[0]][Pi[1]][Pi[2]];
393 return K[Pi[0]][Pi[1]][Pi[2]];
409 }
while ((i <
numObjs) && (!found));
412 if (!found)
return dummy;
418 return G[i][Pi[0]][Pi[1]][Pi[2]];
427 return K[Pi[0]][Pi[1]][Pi[2]];
439 if (
G[i] == NULL)
return dummy;
440 if (!isEinKoord) Pi = Pi -
Pul[i];
441 return G[i][Pi[0]][Pi[1]][Pi[2]];
447 return K[Pi[0]][Pi[1]][Pi[2]];
460 if (
G[i] == NULL)
return dummy;
461 if (Pi[0] < 0)
return dummy;
462 if (Pi[1] < 0)
return dummy;
463 if (Pi[2] < 0)
return dummy;
482 return G[i][Pi[0]][Pi[1]][Pi[2]];
488 return K[Pi[0]][Pi[1]][Pi[2]];
501 for (i = 0; i < 3; i++)
512 }
while ((i <
numObjs) && (!found));
515 if (!found)
return dummy;
518 if (
G[i] == NULL)
return dummy;
520 return G[i][Pi[0]][Pi[1]][Pi[2]];
527 return K[Pi[0]][Pi[1]][Pi[2]];
539 for (
int j = 0; j < 3; j++)
544 if (
G[i] == NULL)
return dummy;
546 return G[i][Pi[0]][Pi[1]][Pi[2]];
552 return K[Pi[0]][Pi[1]][Pi[2]];
626 for (
int i = 0; i <
numObjs; i++)
629 for (
int ix = 0; ix <
n[i][0]; ix++)
630 for (
int iy = 0; iy <
n[i][1]; iy++)
631 for (
int iz = 0; iz <
n[i][2]; iz++)
632 G[i][ix][iy][iz] = S.
G[i][ix][iy][iz];
642 if (
this == &S)
return *
this;
649 anzx =
nges[0]; anzx2 =
nges[0] / 2;
658 for (
int ix = 0; ix <
n[i][0]; ix++)
659 for (
int iy = 0; iy <
n[i][1]; iy++)
660 for (
int iz = 0; iz <
n[i][2]; iz++)
661 G[i][ix][iy][iz] = S.
G[i][ix][iy][iz];
671 for (
int k = 0; k < anzx2; k++)
674 for (
int l = 0; l < S.
ywerte[k]; l++)
677 for (
int m = 0; m < S.
zwerte[k][l]; m++)
679 K[anzx2 - 1 - k][
ywerte[k] - 1 - l][m] = S.
K[anzx2 - 1 - k][
ywerte[k] - 1 - l][m];
680 K[anzx2 + k][
ywerte[k] - 1 - l][m] = S.
K[anzx2 + k][
ywerte[k] - 1 - l][m];
681 K[anzx2 - 1 - k][
ywerte[k] + l][m] = S.
K[anzx2 - 1 - k][
ywerte[k] + l][m];
682 K[anzx2 + k][
ywerte[k] + l][m] = S.
K[anzx2 + k][
ywerte[k] + l][m];
683 K[anzx2 - 1 - k][
ywerte[k] - 1 - l][2 *
zwerte[k][l] - 1 - m] = S.
K[anzx2 - 1 - k][
ywerte[k] - 1 - l][2 *
zwerte[k][l] - 1 - m];
698 int anzx2 =
nges[0] / 2;
704 for (
int i = 0; i < S.
numObjs; i++)
705 for (
int ix = 0; ix < S.
n[i][0]; ix++)
706 for (
int iy = 0; iy < S.
n[i][1]; iy++)
707 for (
int iz = 0; iz < S.
n[i][2]; iz++)
708 G[i][ix][iy][iz] += S.
G[i][ix][iy][iz];
712 for (
int k = 0; k < anzx2; k++)
714 for (
int l = 0; l <
ywerte[k]; l++)
717 for (
int m = 0; m <
zwerte[k][l]; m++)
719 K[anzx2 - 1 - k][
ywerte[k] - 1 - l][m] += S.
K[anzx2 - 1 - k][
ywerte[k] - 1 - l][m];
720 K[anzx2 + k][
ywerte[k] - 1 - l][m] += S.
K[anzx2 + k][
ywerte[k] - 1 - l][m];
721 K[anzx2 - 1 - k][
ywerte[k] + l][m] += S.
K[anzx2 - 1 - k][
ywerte[k] + l][m];
722 K[anzx2 + k][
ywerte[k] + l][m] += S.
K[anzx2 + k][
ywerte[k] + l][m];
723 K[anzx2 - 1 - k][
ywerte[k] - 1 - l][2 *
zwerte[k][l] - 1 - m] += S.
K[anzx2 - 1 - k][
ywerte[k] - 1 - l][2 *
zwerte[k][l] - 1 - m];
735 int anzx2 =
nges[0] / 2;
740 for (
int i = 0; i < S.
numObjs; i++)
741 for (
int ix = 0; ix < S.
n[i][0]; ix++)
742 for (
int iy = 0; iy < S.
n[i][1]; iy++)
743 for (
int iz = 0; iz < S.
n[i][2]; iz++)
744 G[i][ix][iy][iz] -= S.
G[i][ix][iy][iz];
748 for (
int k = 0; k < anzx2; k++)
750 for (
int l = 0; l <
ywerte[k]; l++)
753 for (
int m = 0; m <
zwerte[k][l]; m++)
755 K[anzx2 - 1 - k][
ywerte[k] - 1 - l][m] -= S.
K[anzx2 - 1 - k][
ywerte[k] - 1 - l][m];
756 K[anzx2 + k][
ywerte[k] - 1 - l][m] -= S.
K[anzx2 + k][
ywerte[k] - 1 - l][m];
757 K[anzx2 - 1 - k][
ywerte[k] + l][m] -= S.
K[anzx2 - 1 - k][
ywerte[k] + l][m];
758 K[anzx2 + k][
ywerte[k] + l][m] -= S.
K[anzx2 + k][
ywerte[k] + l][m];
759 K[anzx2 - 1 - k][
ywerte[k] - 1 - l][2 *
zwerte[k][l] - 1 - m] -= S.
K[anzx2 - 1 - k][
ywerte[k] - 1 - l][2 *
zwerte[k][l] - 1 - m];
789 anzx =
nges[0]; anzx2 =
nges[0] / 2;
793 for (
int i = 0; i <
numObjs; i++)
794 for (
int ix = 0; ix <
n[i][0]; ix++)
795 for (
int iy = 0; iy <
n[i][1]; iy++)
796 for (
int iz = 0; iz <
n[i][2]; iz++)
797 G[i][ix][iy][iz] = x;
801 for (
int k = 0; k < anzx2; k++)
803 for (
int l = 0; l <
ywerte[k]; l++)
805 for (
int m = 0; m <
zwerte[k][l]; m++)
807 K[anzx2 - 1 - k][
ywerte[k] - 1 - l][
zwerte[k][l] - 1 - m] = x;
825 double dx, dy, dz, hilf;
830 zwerte =
new int* [anzx2];
840 for (
int i = 0; i < anzx2; i++)
842 ywerte[i] = int(ceil(sqrt(1.0 - (i * dx) * (i * dx)) / dy));
843 zwerte[i] =
new int[anzx2];
844 for (
int j = 0; j < anzx2; j++)
846 hilf = 1.0 - (i * dx) * (i * dx) - (j * dy) * (j * dy);
850 zwerte[i][j] = ceil(sqrt(hilf) / dz);
This class represents a threedimensional (numeric) Matrix as a template.
Template class for threedimensional vectors.
This class represents an ellipsoid This class represents an ellipsoid, defined by its half axis a,...
Abstract base class for all volume objects This abstract class provides a template for all volume obj...
maths::Vector< double > por
corners of the circumferent cuboid (lower left corner and upper right corner)
maths::Vector< double > pul
bool isActive()
returns true if the object should be considered for inelastic calculation
int numObjs
Number of objects.
SuperGrid & operator=(const SuperGrid &S)
Assignment operator.
T & operator()(int ix, int iy, int iz)
gives the content of the cell[ix][iy][iz]
std::vector< std::vector< std::vector< std::vector< T > > > > G
void fill(const T &x)
Fill the whole SuperArray with value x.
int type
Type of grid (0: Field is stored only in the objects, 1: field is stored in the surroundings only,...
maths::Matrix< double > R
void add(const SuperGrid &S)
Adds another SuperGrid object. In this function, all array elements from S are added to the existing ...
maths::Vector< std::complex< double > > pc
void sub(const SuperGrid &S)
Subtract another SuperArray object. In this function, all array elements from S are subtracted from t...
maths::Matrix< double > H
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...
maths::Vector< double > d
friend std::ostream & operator<<(std::ostream &os, const SuperGrid &S)
T kugelwert(maths::Vector< int > Pi)
std::vector< std::vector< std::vector< T > > > K
std::vector< GOAT::maths::Vector< int > > Pul
T kugelwert(int ix, int iy, int iz)
void clear()
Clear the SuperGrid and release the allocated memory.
GOAT::maths::Vector< int > nges
maths::Vector< int > gitterpunkt(maths::Vector< double > P)
std::vector< GOAT::maths::Vector< int > > n
void copy(const SuperGrid &S)
Copies SuperArray object Here, S will be copied into the existing SuperArray and all elements will be...
std::vector< ObjectShape * > Obj
List of the objects.
bool addPlane(maths::Vector< double > P, maths::Vector< double > n, double d1, double d2, maths::Vector< double > cellSize)
maths::Vector< int > kugelindex(maths::Vector< int > Pi)
Checks if the point Pi (indicated by the indices) is inside the calculation sphere The function retur...
bool inObject(maths::Vector< double > P, int i)
checks if P is inside the i-th object (p in real coordinates)
void trafo(const Vector< double > &e0, const Vector< double > &e1, const Vector< double > &e2, Matrix< double > &H, Matrix< double > &R)
Calculates the transformation matrices from the laboratory coordinate system into a local system and ...
Matrix< double > unity()
unity matrix (double precision)
Raytracer used for ultrashort pulse calculation with raytracing only.
constexpr int SUPERGRID_NOERRORS
std::ostream & operator<<(std::ostream &os, Box B)
output operator for the Box class
void clear(GlobalParms parms, maths::Vector< std::complex< double > > **Gitter)
This class is used for the iray class. This class is intended for internal use only....
This file contains the Vector template class and some useful functions around this class.