Commit da39bbd0 authored by Phillip Lino Rall's avatar Phillip Lino Rall
Browse files

trilinear interpolator now workinggit reset program2D/program.pro.user!

parent eadd7402
......@@ -374,7 +374,7 @@ class Variable : public Expr<Variable< DTyp > >, public Object_based_on_ug {
Blockgrid* blockgrid;
Unstructured_grid* ug;
// own data
// own data
DTyp** data_hexahedra; // num_hexahedra
DTyp** data_quadrangles; // num_quadrangles
DTyp** data_edges; // num_edges
......
This diff is collapsed.
......@@ -81,6 +81,7 @@ class Interpolate_on_structured_grid {
void interpolate(Variable<DTyp>& u, DTyp* data, DTyp defaultInterpolation);
void update_Interpolate_on_structured_grid(Blockgrid& blockgrid_, bool onlyOnSurfaceZ = false);
void findLambdaForInterpolation(int id_hex,int i,int j,int k);
void setInterpolateDirect(Interpolate_direct *id_){id = id_;}
int getNx(){return nx;}
......@@ -382,6 +383,7 @@ private:
double rotationx{0}, rotationy{0}, rotationz{0};
Interpolate_on_structured_grid* interpolatorStructured;
public:
double* data;
bool dataCounterFlag{false};
int* dataCounter;
......@@ -575,19 +577,8 @@ DTyp Interpolate_direct::evaluate(Variable<DTyp> &u)
if(typ==6) returnVal = interpolate_in_tet_trilinear(lambda,du.END(),du.ESD(),du.WSD(),du.WND(),
du.WNT(),du.WST(),du.EST(),du.ENT());
}
// D3vector cWSD = {1,1,0}; // 1,1,0 : x2
// D3vector cESD = {2,0,-1}; // 1,0,0 : x1
// D3vector cWND = {0,1,0}; // 0,1,0 : x3
// D3vector cEND = {-1,0,-1.0}; // 0,0,0 : x0
// D3vector cWST = {1,1,1}; // 1,1,1 : x5
// D3vector cEST = {2,0,2}; // 1,0,1 : x6
// D3vector cWNT = {0,1,1}; // 0,1,1 : x4
// D3vector cENT = {-1,0,2}; // 0,0,1 : x7
return returnVal;
}
};
template<class DTyp>
......@@ -625,20 +616,9 @@ DTyp Interpolate_direct::evaluateSurface(Variable<DTyp> &u)
if(typ==14) returnVal = interpolate_in_tet_bilinear(lambda,du.ENT(),du.WNT(),du.WST(),du.EST());
}
// D3vector cWSD = {1,1,0}; // 1,1,0 : x2
// D3vector cESD = {2,0,-1}; // 1,0,0 : x1
// D3vector cWND = {0,1,0}; // 0,1,0 : x3
// D3vector cEND = {-1,0,-1.0}; // 0,0,0 : x0
// D3vector cWST = {1,1,1}; // 1,1,1 : x5
// D3vector cEST = {2,0,2}; // 1,0,1 : x6
// D3vector cWNT = {0,1,1}; // 0,1,1 : x4
// D3vector cENT = {-1,0,2}; // 0,0,1 : x7
return returnVal;
};
}
......
......@@ -187,24 +187,29 @@ void amplification(double dz,
VariableFFT inversion(temp);
VariableFFT pumpPhotons(temp);
Function2d1<double, std::complex<double> > absolute(ABS);
// photonDensity : Intensity / energie_photon / dz , unit: 1 / (s mm^3), dz richtig hier?
photonDensity = absolute(varIn) * absolute(varIn)/ (planck * c / lambda) / dz;
// pumpPhotons : pumppower / energie_photon , unit: 1 / (s mm^3)
pumpPhotons = pumppower / (planck * c / lambda); // N / s mm³
// falsch : alle pumpphotonen werden zur verstärkung genutzt -> anpassen
std::cout << "pumppower "<< L_infty(pumppower) << std::endl;
std::cout << "inversion "<< L_infty(temp) << std::endl;
std::cout << "photonDensity "<< L_infty(photonDensity) << std::endl;
// exp complex: normale exp funktion, die aber den realteil des arguments in den exponenten packe, also exp(real(arg)) und einen complexen wert (imag = 0) zurückgibt
//noetig, weil multipliziert mit komplexer variable
Function2d1<std::complex<double>,std::complex<double>> Exp(expComplex);
//inversion : stimmt das so?
inversion = pumpPhotons / (emissionCrosssection * pumpPhotons * photonDensity * c + 1.0 / upperLevelLifetime + pumpPhotons / Ntot);
std::cout << "pumppower "<< L_infty(pumppower) << std::endl;
std::cout << "photonDensity "<< L_infty(photonDensity) << std::endl;
std::cout << "inversion "<< L_infty(inversion) << std::endl;
std::cout << "pumpPhotons "<< L_infty(pumpPhotons) << std::endl;
//temp : argument, welches in den exponenten zur verstärkung kommt
temp= emissionCrosssection * inversion * photonDensity * dz ;
std::cout << "arg exp temp "<< L_infty(temp) << std::endl;
// e^(verstärkung)
temp = Exp(temp);
std::cout << "exp temp "<< L_infty(temp) << std::endl;
......@@ -212,7 +217,7 @@ void amplification(double dz,
DATEIC.open("varGAIN.vtk");
temp.Print_VTK(DATEIC);
DATEIC.close();
//verstärkungsschritt. hier eventuell sqrt(temp), da es sich hier nicht um die intensität, sondern sqrt(intensität) handelt?
varIn = varIn * temp;
......@@ -756,9 +761,9 @@ int main(int argc, char** argv) {
varE = Aperture(X,Y);
double power = 1.0;
double power = 1.0; // unit : Watt
double amp = sqrt(2.0 * power / M_PI / radiusGauss / radiusGauss);
double amp = sqrt(2.0 * power / M_PI / radiusGauss / radiusGauss); // unit = Watt / mm^2
varE = varE * amp;
std::ofstream DATEIG;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment