Skip to content

Commit

Permalink
Cosmetics: fix mixture of tabs and spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
Segev BenZvi committed Aug 16, 2024
1 parent 259bf5b commit bd5808b
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions src/BEMEWS/_ext/BEMEWS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ vector<vector<vector<vector<double> > > > Run(InputDataBEMEWS ID)
kV = vector<array<double,NF> >(NE);
HfV=vector<vector<MATRIX<complex<double>,NF,NF> > >(NM,vector<MATRIX<complex<double>,NF,NF> >(NE));

// vectors of energies at infinity and vacuum eigenvalues at infinity
// vectors of energies at infinity and vacuum eigenvalues at infinity
for(i=0;i<=NE-1;i++)
{ if(NE>1){ E[i] = ((NE-1.-i)*Emin + i*Emax) / (NE-1.);}
else{ E[i] = Emin;}
Expand All @@ -202,7 +202,7 @@ vector<vector<vector<vector<double> > > > Run(InputDataBEMEWS ID)

// vaccum mixing matrices and Hamiltonians at infinity
Evaluate_UV();
Evaluate_HfV();
Evaluate_HfV();

// *****************************************************
// quantities evaluated at inital point
Expand All @@ -223,7 +223,7 @@ vector<vector<vector<vector<double> > > > Run(InputDataBEMEWS ID)
U0 = vector<vector<MATRIX<complex<double>,NF,NF> > >(NM,vector<MATRIX<complex<double>,NF,NF> >(NE));

// mixing angles to MSW basis at initial point
for(i=0;i<=NE-1;i++)
for(i=0;i<=NE-1;i++)
{ Hf0=HfV[nu][i]+VfMSW0;
k0=k(Hf0);
deltak0=deltak(k0);
Expand Down Expand Up @@ -284,12 +284,12 @@ vector<vector<vector<vector<double> > > > Run(InputDataBEMEWS ID)
lasttime = false;

// take into account the density jump from vacuum into Earth
#pragma omp parallel for schedule(static)
#pragma omp parallel for schedule(static)
for(i=0;i<=NE-1;i++){
for(state m=nu;m<=antinu;m++){
Scumulative[m][i] = Adjoint(U0[m][i])*UV[m];
}
}
}

// loop through the domains
for(int d=0;d<=ND-1;d++)
Expand All @@ -303,25 +303,25 @@ vector<vector<vector<vector<double> > > > Run(InputDataBEMEWS ID)
// initialize at beginning of every domain
lambda=lambdamin; dlambda=1e-3*cgs::units::cm; deltalambdamin=4.*lambda*numeric_limits<double>::epsilon();

#pragma omp parallel for schedule(static)
#pragma omp parallel for schedule(static)
for(i=0;i<=NE-1;i++){
for(state m=nu;m<=antinu;m++){
Y[m][i][0]=M_PI/2.;
Y[m][i][1]=M_PI/2.;
Y[m][i][2]=M_PI/2.;
Y[m][i][3]=M_PI/2.;
Y[m][i][1]=M_PI/2.;
Y[m][i][2]=M_PI/2.;
Y[m][i][3]=M_PI/2.;
Y[m][i][4]=0.;
Y[m][i][5]=M_PI/2.;
Y[m][i][6]=M_PI/2.;
Y[m][i][6]=M_PI/2.;
Y[m][i][7]=0;

Y[m][i][8]=1.;

Y[m][i][9]=0.;
Y[m][i][10]=0.;
Y[m][i][11]=0.;
}
}
Y[m][i][10]=0.;
Y[m][i][11]=0.;
}
}

finish = false;
counterout=1;
Expand Down Expand Up @@ -361,8 +361,8 @@ vector<vector<vector<vector<double> > > > Run(InputDataBEMEWS ID)
for(i=0;i<=NE-1;i++){
for(state m=nu;m<=antinu;m++){
for(int j=0;j<=NY-1;j++){ Y[m][i][j] += BB[1][0] * Ks[0][m][i][j];}
}
}
}
}
K(lambda,dlambda,Y,Ks[1]);

// remaining steps
Expand All @@ -372,11 +372,11 @@ vector<vector<vector<vector<double> > > > Run(InputDataBEMEWS ID)
#pragma omp parallel for schedule(static)
for(i=0;i<=NE-1;i++){
for(state m = nu; m <= antinu; m++){
for(int j=0;j<=NY-1;j++){
for(int l=0;l<=k-1;l++){ Y[m][i][j] += BB[k][l] * Ks[l][m][i][j];}
}
}
}
for(int j=0;j<=NY-1;j++){
for(int l=0;l<=k-1;l++){ Y[m][i][j] += BB[k][l] * Ks[l][m][i][j];}
}
}
}
K(lambda,dlambda,Y,Ks[k]);
}

Expand All @@ -387,11 +387,11 @@ vector<vector<vector<vector<double> > > > Run(InputDataBEMEWS ID)
for(state m=nu;m<=antinu;m++){
for(int j=0;j<=NY-1;j++){
Y[m][i][j]=Y0[m][i][j];
Yerror[m][i][j]=0.;
for(int k=0;k<=NRK-1;k++){
Yerror[m][i][j]=0.;
for(int k=0;k<=NRK-1;k++){
Y[m][i][j]+=CC[k]*Ks[k][m][i][j];
Yerror[m][i][j]+=(CC[k]-DD[k])*Ks[k][m][i][j];
}
Yerror[m][i][j]+=(CC[k]-DD[k])*Ks[k][m][i][j];
}
}
}
}
Expand All @@ -401,7 +401,7 @@ vector<vector<vector<vector<double> > > > Run(InputDataBEMEWS ID)
for(state m=nu;m<=antinu;m++){
for(i=0;i<=NE-1;i++){
for(int j=0;j<=NY-1;j++){ maxerror = max( maxerror, fabs(Yerror[m][i][j]) );}
}
}
}

// decide whether to accept step, if not adjust step size
Expand All @@ -425,29 +425,29 @@ vector<vector<vector<vector<double> > > > Run(InputDataBEMEWS ID)
resetflag = false;

// test that the S matrix is close to diagonal
if( norm(SS[0][0])+0.1<norm(SS[0][1]) || norm(SS[0][0])+0.1<norm(SS[0][2]) ){ resetflag = true;}
if( norm(SS[0][1])+0.1<norm(SS[0][2]) ){ resetflag = true;}
if( norm(SS[2][2])+0.1<norm(SS[1][2]) ){ resetflag = true;}
if( norm(SS[0][0])+0.1<norm(SS[0][1]) || norm(SS[0][0])+0.1<norm(SS[0][2]) ){ resetflag = true;}
if( norm(SS[0][1])+0.1<norm(SS[0][2]) ){ resetflag = true;}
if( norm(SS[2][2])+0.1<norm(SS[1][2]) ){ resetflag = true;}

if(resetflag!=false)
if(resetflag!=false)
{ // reset the S matrices
Scumulative[m][i]=MATRIX<complex<double>,NF,NF>( SS*Scumulative[m][i] );

Y[m][i][0]=Y[m][i][1]=Y[m][i][2]=Y[m][i][3]=M_PI/2.; Y[m][i][4]=0.;
Y[m][i][5]=Y[m][i][6]=M_PI/2.; Y[m][i][7]=0.;
Y[m][i][8]=1.;
Y[m][i][8]=1.;
Y[m][i][9]=Y[m][i][10]=Y[m][i][11]=0.;
}
else{ // take modulo 2 pi of phase angles
Y[m][i][4]=fmod(Y[m][i][4],M_2PI);
Y[m][i][7]=fmod(Y[m][i][7],M_2PI);

double ipart;
Y[m][i][9]=modf(Y[m][i][9],&ipart);
Y[m][i][10]=modf(Y[m][i][10],&ipart);
Y[m][i][11]=modf(Y[m][i][11],&ipart);
}
}
Y[m][i][4]=fmod(Y[m][i][4],M_2PI);
Y[m][i][7]=fmod(Y[m][i][7],M_2PI);

double ipart;
Y[m][i][9]=modf(Y[m][i][9],&ipart);
Y[m][i][10]=modf(Y[m][i][10],&ipart);
Y[m][i][11]=modf(Y[m][i][11],&ipart);
}
}
}

if(counterout==step){ if(ID.outputflag==true){ output=true;} else{ output=false;}; counterout=1;} else{ counterout++;}
Expand Down

0 comments on commit bd5808b

Please sign in to comment.