4 #include "gsl/gsl_fft_real.h"
23 for(
int i = 0; i < 4; ++i) {
41 double tmpDouble, tmpDouble2;
42 unsigned int skippedValues = 0;
43 bool passed = interpretLine<double, double>(file,
zbegin_m, tmpDouble);
46 while (!file.eof() && passed) {
47 passed = interpretLine<double, double>(file,
zend_m, tmpDouble,
false);
48 if (
zend_m - tmpDouble2 > 1
e-10) {
58 return passed || file.eof();
69 if(
zvals_m[nsp] - tmpDouble > 1
e-10) {
97 zvals[i] = zvals[i - 1] +
hz_m;
121 std::vector<double> &evenFieldSampling) {
122 std::vector<double> fourierCoefficients(2 * accuracy - 1);
127 RealValues[ii] = evenFieldSampling[i];
128 RealValues[iii] = evenFieldSampling[i];
131 gsl_fft_real_wavetable *
real = gsl_fft_real_wavetable_alloc(2 *
num_gridpz_m);
132 gsl_fft_real_workspace *work = gsl_fft_real_workspace_alloc(2 *
num_gridpz_m);
136 gsl_fft_real_workspace_free(work);
137 gsl_fft_real_wavetable_free(
real);
140 fourierCoefficients[0] = RealValues[0] / (2 *
num_gridpz_m);
141 for(
int i = 1; i < 2 * accuracy - 1; i++) {
145 return fourierCoefficients;
149 double interiorDerivative, base;
150 double coskzl, sinkzl, z = 0.0;
152 std::vector<double> higherDerivatives[3];
161 for(
int l = 1; l < accuracy; ++l) {
162 int coefIndex = 2 * l - 1;
164 interiorDerivative = base;
165 coskzl =
cos(kz * l);
166 sinkzl =
sin(kz * l);
168 higherDerivatives[0][i] += interiorDerivative * (-fourierComponents[coefIndex] * sinkzl
169 - fourierComponents[coefIndex + 1] * coskzl);
170 interiorDerivative *= base;
171 higherDerivatives[1][i] += interiorDerivative * (-fourierComponents[coefIndex] * coskzl
172 + fourierComponents[coefIndex + 1] * sinkzl);
173 interiorDerivative *= base;
174 higherDerivatives[2][i] += interiorDerivative * (fourierComponents[coefIndex] * sinkzl
175 + fourierComponents[coefIndex + 1] * coskzl);
179 for(
int i = 1; i < 4; ++i) {
Tps< T > cos(const Tps< T > &x)
Cosine.
Tps< T > sin(const Tps< T > &x)
Sine.
FLieGenerator< T, N > real(const FLieGenerator< std::complex< T >, N > &)
Take real part of a complex generator.
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
Inform & level3(Inform &inf)
constexpr double two_pi
The value of.
constexpr double e
The value of.
bool determineNumSamplingPoints(std::ifstream &file)
Astra1D_fast(std::string aFilename)
double readFieldData(std::ifstream &file)
void computeFieldDerivatives(std::vector< double > &fourierComponents, int accuracy)
gsl_spline * onAxisInterpolants_m[4]
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &F)
std::vector< double > getEvenlyDistributedSamplingPoints()
void normalizeFieldData(double maxEz)
std::vector< double > computeFourierCoefficients(int accuracy, std::vector< double > &evenSampling)
gsl_interp_accel * onAxisAccel_m[4]
std::vector< double > interpolateFieldData(std::vector< double > &samplingPoints)
static std::string typeset_msg(const std::string &msg, const std::string &title)