5 #include "gsl/gsl_fft_real.h"
24 for(
int i = 0; i < 4; ++i) {
40 double tmpDouble, tmpDouble2;
41 unsigned int skippedValues = 0;
42 bool passed = interpretLine<double, double>(file,
zbegin_m, tmpDouble);
45 while (!file.eof() && passed) {
46 passed = interpretLine<double, double>(file,
zend_m, tmpDouble,
false);
47 if (zend_m - tmpDouble2 > 1
e-10) {
57 return passed || file.eof();
68 if(zvals_m[nsp] - tmpDouble > 1
e-10) {
72 tmpDouble = zvals_m[nsp];
96 zvals[i] = zvals[i - 1] +
hz_m;
98 zvals[num_gridpz_m - 1] =
zvals_m[num_gridpz_m - 1];
114 realValues[num_gridpz_m - 1] =
onAxisField_m[num_gridpz_m - 1];
120 std::vector<double> &evenFieldSampling) {
121 std::vector<double> fourierCoefficients(2 * accuracy - 1);
126 RealValues[ii] = evenFieldSampling[i];
127 RealValues[iii] = evenFieldSampling[i];
130 gsl_fft_real_wavetable *
real = gsl_fft_real_wavetable_alloc(2 * num_gridpz_m);
131 gsl_fft_real_workspace *
work = gsl_fft_real_workspace_alloc(2 * num_gridpz_m);
133 gsl_fft_real_transform(&RealValues[0], 1, 2 * num_gridpz_m, real, work);
135 gsl_fft_real_workspace_free(work);
136 gsl_fft_real_wavetable_free(real);
139 fourierCoefficients[0] = RealValues[0] / (2 *
num_gridpz_m);
140 for(
int i = 1; i < 2 * accuracy - 1; i++) {
144 return fourierCoefficients;
148 double interiorDerivative, base;
149 double coskzl, sinkzl, z = 0.0;
151 std::vector<double> higherDerivatives[3];
160 for(
int l = 1; l < accuracy; ++l) {
161 int coefIndex = 2 * l - 1;
163 interiorDerivative = base;
164 coskzl =
cos(kz * l);
165 sinkzl =
sin(kz * l);
167 higherDerivatives[0][i] += interiorDerivative * (-fourierComponents[coefIndex] * sinkzl
168 - fourierComponents[coefIndex + 1] * coskzl);
169 interiorDerivative *= base;
170 higherDerivatives[1][i] += interiorDerivative * (-fourierComponents[coefIndex] * coskzl
171 + fourierComponents[coefIndex + 1] * sinkzl);
172 interiorDerivative *= base;
173 higherDerivatives[2][i] += interiorDerivative * (fourierComponents[coefIndex] * sinkzl
174 + fourierComponents[coefIndex + 1] * coskzl);
178 for(
int i = 1; i < 4; ++i) {
181 gsl_spline_init(
onAxisInterpolants_m[i], &zvals[0], &higherDerivatives[i - 1][0], num_gridpz_m);
constexpr double two_pi
The value of .
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
gsl_spline * onAxisInterpolants_m[4]
std::vector< double > interpolateFieldData(std::vector< double > &samplingPoints)
void normalizeFieldData(double maxEz)
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &F)
double readFieldData(std::ifstream &file)
std::vector< double > getEvenlyDistributedSamplingPoints()
Tps< T > cos(const Tps< T > &x)
Cosine.
_Astra1D_fast(const std::string &filename)
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or work
gsl_interp_accel * onAxisAccel_m[4]
constexpr double e
The value of .
void computeFieldDerivatives(std::vector< double > &fourierComponents, int accuracy)
std::vector< double > computeFourierCoefficients(int accuracy, std::vector< double > &evenSampling)
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.
bool determineNumSamplingPoints(std::ifstream &file)