added B 2nd moment
This commit is contained in:
parent
9f52014d73
commit
50e3838a5f
@ -248,7 +248,7 @@ void PPippard::CalculateFieldSpecular()
|
||||
}
|
||||
}
|
||||
|
||||
cout << endl << "fShift = " << fShift;
|
||||
cout << endl << "debug> fShift = " << fShift;
|
||||
|
||||
for (Int_t i=0; i<PippardFourierPoints; i++) {
|
||||
fFieldB[i][1] /= norm;
|
||||
@ -379,24 +379,25 @@ void PPippard::SaveField()
|
||||
// write header
|
||||
fprintf(fp, "%% Header ------------------------------------\n");
|
||||
fprintf(fp, "%% Parameters:\n");
|
||||
fprintf(fp, "%% Reduced Temperature = %lf\n", fParams.t);
|
||||
fprintf(fp, "%% LambdaL(0) = %lf (nm), LambdaL(t) = %lf (nm)\n", fParams.lambdaL, LambdaL_T(fParams.t));
|
||||
fprintf(fp, "%% Reduced Temperature = %lf\n", fParams.t);
|
||||
fprintf(fp, "%% LambdaL(0) = %lf (nm), LambdaL(t) = %lf (nm)\n", fParams.lambdaL, LambdaL_T(fParams.t));
|
||||
if (fParams.specularIntegral > 0.0)
|
||||
fprintf(fp, "%% int_x=0^infty B(x) dx / Bext = %lf (nm)\n", fParams.specularIntegral);
|
||||
fprintf(fp, "%% xiP(0) = %lf (nm), xiP(t) = %lf (nm)\n", fParams.xi0, XiP_T(fParams.t));
|
||||
fprintf(fp, "%% Mean Free Path = %lf (nm)\n", fParams.meanFreePath);
|
||||
fprintf(fp, "%% Film Thickness = %lf (nm)\n", fParams.filmThickness);
|
||||
fprintf(fp, "%% xiP(0) = %lf (nm), xiP(t) = %lf (nm)\n", fParams.xi0, XiP_T(fParams.t));
|
||||
fprintf(fp, "%% Mean Free Path = %lf (nm)\n", fParams.meanFreePath);
|
||||
fprintf(fp, "%% Film Thickness = %lf (nm)\n", fParams.filmThickness);
|
||||
if (fParams.specular)
|
||||
fprintf(fp, "%% Boundary Conditions: Specular\n");
|
||||
else
|
||||
fprintf(fp, "%% Boundary Conditions: Diffuse\n");
|
||||
fprintf(fp, "%% Bext = %lf (G)\n", fParams.b_ext);
|
||||
fprintf(fp, "%% deadLayer = %lf (nm)\n", fParams.deadLayer);
|
||||
fprintf(fp, "%% Bext = %lf (G)\n", fParams.b_ext);
|
||||
fprintf(fp, "%% deadLayer = %lf (nm)\n", fParams.deadLayer);
|
||||
if (fParams.rgeFileName.Length() > 0)
|
||||
fprintf(fp, "%% rge file name : %s\n", fParams.rgeFileName.Data());
|
||||
if (fParams.meanB != 0.0) {
|
||||
fprintf(fp, "%% Mean Distance = %lf\n", fParams.meanX);
|
||||
fprintf(fp, "%% Mean Field/Bext = %lf\n", fParams.meanB);
|
||||
fprintf(fp, "%% Mean Distance = %lf\n", fParams.meanX);
|
||||
fprintf(fp, "%% Mean Field/Bext = %lf\n", fParams.meanB);
|
||||
fprintf(fp, "%% 2nd Moment Field/Bext^2 = %lf\n", fParams.secondMomentB);
|
||||
}
|
||||
fprintf(fp, "%%\n");
|
||||
|
||||
|
@ -32,6 +32,7 @@ typedef struct {
|
||||
TString rgeFileName;
|
||||
TString outputFileName;
|
||||
Double_t meanB; // int_x=0^infty B(x) n(x) dx / int_x=0^infty n(x) dx / Bext
|
||||
Double_t secondMomentB; // int_x=0^infty B^2(x) n(x) dx / int_x=0^infty n(x) dx / Bext^2
|
||||
Double_t meanX; // int_x=0^infty x n(x) dx / int_x=0^infty n(x) dx
|
||||
} PippardParams;
|
||||
|
||||
@ -49,6 +50,7 @@ class PPippard
|
||||
virtual void SetSpecular(Bool_t specular) { fParams.specular = specular; }
|
||||
virtual void SetMeanX(Double_t meanX) { fParams.meanX = meanX; }
|
||||
virtual void SetMeanB(Double_t meanB) { fParams.meanB = meanB; }
|
||||
virtual void SetSecondMomentB(Double_t BB) { fParams.secondMomentB = BB; }
|
||||
|
||||
virtual void CalculateField();
|
||||
|
||||
|
@ -365,16 +365,25 @@ int main(int argc, char *argv[])
|
||||
meanX *= (x[1]-x[0]);
|
||||
|
||||
Double_t meanB = 0.0;
|
||||
Double_t secondMomentB = 0.0;
|
||||
Double_t BB = 0.0;
|
||||
for (unsigned int i=0; i<x.size()-1; i++) {
|
||||
if (x[i] <= params.deadLayer)
|
||||
if (x[i] <= params.deadLayer) {
|
||||
meanB += 1.0 * n[i];
|
||||
else
|
||||
meanB += pippard->GetMagneticField(x[i]-params.deadLayer) * n[i];
|
||||
secondMomentB += 1.0 * n[i];
|
||||
} else {
|
||||
BB = pippard->GetMagneticField(x[i]-params.deadLayer);
|
||||
meanB += BB * n[i];
|
||||
secondMomentB += BB * BB * n[i];
|
||||
}
|
||||
}
|
||||
meanB *= (x[1]-x[0]);
|
||||
secondMomentB *= (x[1]-x[0]);
|
||||
|
||||
cout << endl << ">> mean x = " << meanX << ", mean field = " << params.b_ext * meanB;
|
||||
cout << endl << ">> mean x = " << meanX << " (nm), mean field = " << params.b_ext * meanB << " (G)";
|
||||
cout << " 2nd Moment B = " << secondMomentB << " (G^2)";
|
||||
pippard->SetMeanX(meanX);
|
||||
pippard->SetSecondMomentB(secondMomentB);
|
||||
pippard->SetMeanB(meanB);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user