GOAT (Geometrical optics application tool) 0.1
Loading...
Searching...
No Matches
fft.h
Go to the documentation of this file.
1#pragma once
2#include <functional>
3#include <vector>
4#include "superarray.h"
5#include "raytrace_usp.h"
6#include "constants.h"
7
8namespace GOAT
9{
10 namespace raytracing
11 {
12#ifndef I
13#define I std::complex<double> (0.0,1.0)
14#endif
15 constexpr int N_INTEGRAL = 500;
16
24 typedef struct TrafoParms
25 {
26 int nI=4;
27 int nS=200;
29 double omegaStart;
30 double omegaEnd;
31 double omega0;
32 double wvl=1.0;
33 double dt=100;
34 std::vector<std::function<std::complex<double>(double) > > nList;
36 } ;
37
38
49 class Trafo
50 {
51 public:
60 void calc(std::vector < std::vector<SuperArray <std::vector<gridEntry> > > >& SA, double t);
68 void calc(std::vector<SuperArray <std::vector<gridEntry> > > & SA, double omegaStart, double omegaEnd, double t, bool do_clear=true);
75 void setRefractiveIndexFunctions(std::vector<std::function<std::complex<double>(double) > > nList);
79 void setReferenceTime(double tref);
83 void setTrafoParms(TrafoParms trafoparms);
84 void clear();
85 void empty();
90 void initResult(SuperArray<maths::Vector<std::complex<double> >>& SA);
101 void initResult(double r0, INDEX_TYPE nx, INDEX_TYPE ny, INDEX_TYPE nz, std::vector<ObjectShape*> Obj, int numObjs);
102 std::vector<std::function<std::complex<double>(double) > > nList;
103 double getD() { return D; }
104 void setNumberOfThreads(int n) {tp.number_of_threads=n;}
105 int getNumberOfThreads () {return tp.number_of_threads;}
106 private:
107 double pulseWeight(double omega);
115 void setCurrNList(double wvl)
116 {
117 for (int i = 0; i < nList.size(); i++)
118 currNList[i] = nList[i](wvl);
119 }
120 // void createLTexpo();
121 std::complex<double> calcPhase(std::vector<stepEntry> steps, double k0);
122 GOAT::maths::Vector<std::complex<double> > calcOne(std::vector<stepEntry> steps, double t);
123 GOAT::maths::Vector<std::complex<double> > integrate(double t, std::vector<gridEntry> ge, double omegastart, double omegastop);
124 double twoSigma2;
125 double sigma2;
126 double prefactor; // 1/(sigma * sqrt (2pi))
127 std::vector<double> freq;
128 double tref = 0.0;
130 std::vector<std::complex<double > > currNList;
131 double D = 0;
133 };
134 }
135}
Template class for threedimensional vectors.
Definition vector.h:57
Template class to store arbitrary information in a 3D-grid This template class provides a virtual 3D-...
Definition superarray.h:26
TrafoParms tp
Definition fft.h:129
std::vector< std::function< std::complex< double >(double) > > nList
List of the refractive index functions.
Definition fft.h:102
Trafo(TrafoParms)
Constructor for initialization Perform a calculation at the time t.
void setReferenceTime(double tref)
Sets the reference time (in fs).
double pulseWeight(double omega)
void calc(std::vector< std::vector< SuperArray< std::vector< gridEntry > > > > &SA, double t)
void empty()
fills the entire result array with zero vectors
void setTrafoParms(TrafoParms trafoparms)
Sets the parameters used in the calculation.
std::vector< std::complex< double > > currNList
here, the refractive indices for the current wavelength are stored (for faster calculation)
Definition fft.h:130
int getNumberOfThreads()
get number of threads which can be used by the program
Definition fft.h:105
void calc(std::vector< SuperArray< std::vector< gridEntry > > > &SA, double omegaStart, double omegaEnd, double t, bool do_clear=true)
calculation of the Fourier transformation. The calculation of the Fourier transformation is made in a...
SuperArray< maths::Vector< std::complex< double > > > SAres
Container for the last result.
Definition fft.h:69
std::vector< double > freq
Definition fft.h:127
void clear()
Deletes all arrays (frees the memory)
void setRefractiveIndexFunctions(std::vector< std::function< std::complex< double >(double) > > nList)
Set the refractive index functions. Here, the refractive index functions were given with help of a st...
GOAT::maths::Vector< std::complex< double > > calcOne(std::vector< stepEntry > steps, double t)
void initResult(SuperArray< maths::Vector< std::complex< double > > > &SA)
Resets and initialize the result array. The result array will be cleared and renewed according to the...
void setNumberOfThreads(int n)
set number of threads which can be used by the program
Definition fft.h:104
double sigma2
for a gaussian pulse, the electric field, the temporal behavior is:
Definition fft.h:125
void setCurrNList(double wvl)
sets current values for the refractive indices This method calculates the refractive indices of the d...
Definition fft.h:115
double getD()
relative change
Definition fft.h:103
GOAT::maths::Vector< std::complex< double > > integrate(double t, std::vector< gridEntry > ge, double omegastart, double omegastop)
void initResult(double r0, INDEX_TYPE nx, INDEX_TYPE ny, INDEX_TYPE nz, std::vector< ObjectShape * > Obj, int numObjs)
Resets and initialize the result array. The result array will be cleared and renewed according to the...
std::complex< double > calcPhase(std::vector< stepEntry > steps, double k0)
Raytracer used for ultrashort pulse calculation with raytracing only.
Definition asphericLens.h:6
constexpr int INEL_MAX_NREFLEX
long long int INDEX_TYPE
Definition superarray.h:16
constexpr int N_INTEGRAL
Definition fft.h:15
This class is used for the iray class. This class is intended for internal use only....
Definition fresnel.h:7
Structure, which acts as a container for all informations needed to process the calculation.
Definition fft.h:25
double omega0
main frequency (corresponds to wvl)
Definition fft.h:31
std::vector< std::function< std::complex< double >(double) > > nList
list of functions which describe the refractive index dependence on the wavelength (for each object o...
Definition fft.h:34
int nS
number of subdivision per spectral range
Definition fft.h:27
int nR
number of reflections considered in the raytracing part
Definition fft.h:28
double wvl
main wavelength (in µm)
Definition fft.h:32
double omegaEnd
highest wavelength considered in the calculation
Definition fft.h:30
int nI
defines the number of spectral ranges
Definition fft.h:26
double dt
width of the pulse (in femto seconds)
Definition fft.h:33
double omegaStart
lowest wavelength considered in the calculation
Definition fft.h:29
int number_of_threads
number of threads which should be used for calculation
Definition fft.h:35