📄 plasma2.h
字号:
#ifndef PLASMA_H
#define PLASMA_H
#include <math.h>
#include <stdio.h>
#include <fstream.h>
#include <iostream.h>
class plasma{
private:
const double Pi;
double *data;
int nn;// must be 2^n; relation with ld
int n;// relation with rd
double wavelength;
double w0; //need w0>>wavelength; for being able to compute, wavelength/w0 < 1.0E-5 is best;
double nc;
double z; //range of the X-ray prope in z director
double ld;//range of the prope in x director
double rd;
double *databak;
double *nebak;
void four1(int isign);//one dimension Fourier Transform; isign=1, fft; isign=-1, inverse fft
double bessj1(double x);//computer 1st-Bessel function for hankel transform;
void linpropagate();//// linear propagation in linear media
void nonlinear(int step);//Propagation in nonlinear media
void hankel();//slowly hankel transform
double integ(double x);//integral for corrective term
double intcr(double x);// get the corrective term value by propagation eq. or theory solution.
double intam(double x);// get the theory value for amplitude;
void derivative(); //derivative of the electron density
double selfne(double x,double y) // profile of the electron density
{
double ne;
///double temp=(x*x+y*y)/(w0*w0);
//if (temp>1) ne=0;else ne=temp;
ne=exp(-pow(Pi*(x*x+y*y)/(w0*w0),1));
return ne;
}
public:
plasma();
plasma(double Z, double LD, int NN, int N,double NC, double W0=1.0,
double RD=2.0,double WL=15.5e-6);
~plasma();
void initvalue();
//// initial the data, real =1, imag=0; for plain wave too.
void nls();
//solve the nls schrodinger eq. by linear and nonlinear propagation
void phase();
//obtain the phase after propagation; two erro phase must is less Pi
void abel();
//// abel transform, need hankel transform
void printamp(char *fn="amp.dat",int nndot=1);
//put out the amplitude; *fn is file name;
//nndot is the interval dot. out dots number is nn/nndot;
void printphase(char *fn="phase.dat",int nndot=1,bool correct=false);
// put out the phase;*fn is file name; nndot is the interval dot.
// out dots number is nn/nndot; If correct== True,
//it will calculate the corrective term and will need much time.
void printreim(char* fn="ri.dat",int nndot=1);
// put out the real and image part of the electron density.
void printne(char *fn="ne.dat",int nndot=1);
//put out the electron density of simulation and assume;
//*fn is file name; nndot is the interval dot. out dots number is nn/nndot;
void correct();
//inte the derivative value of the electron density.
// obtain the value of the corrective term for the abel transform value.
bool judgene(double val);// By val to judge whether need loop for correct
void setw0(double W0=1)
{
w0=W0;
}
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -