rename fmt() macro to logfmt() to avoid clashes with fmtlib
This commit is contained in:
@ -273,7 +273,7 @@ public:
|
||||
};
|
||||
|
||||
/// format a string
|
||||
const char *fmt(const char *format,...);
|
||||
const char *logfmt(const char *format,...);
|
||||
|
||||
/// macros with common usage
|
||||
#define LOGFATAL(code,text,lineinfo) ((lineinfo) ? ::message(vblFATAL,(code)," %s at %s:%d",(text),__FILE__,__LINE__) : \
|
||||
|
||||
@ -170,7 +170,7 @@ int AWPMD::set_pbc(const Vector_3P pcell, int pbc_){
|
||||
int AWPMD::set_electrons(int s, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass, double *q)
|
||||
{
|
||||
if(s < 0 || s > 1)
|
||||
return LOGERR(-1,fmt("AWPMD.set_electrons: invaid s setting (%d)!",s),LINFO);
|
||||
return LOGERR(-1,logfmt("AWPMD.set_electrons: invaid s setting (%d)!",s),LINFO);
|
||||
|
||||
norm_matrix_state[s] = NORM_UNDEFINED;
|
||||
nwp[s]=ne[s]=n;
|
||||
@ -363,20 +363,20 @@ int AWPMD::interaction(int flag, Vector_3P fi, Vector_3P fe_x,
|
||||
//3. inverting the overlap matrix
|
||||
int info=0;
|
||||
if(nes){
|
||||
/*FILE *f1=fopen(fmt("matrO_%d.d",s),"wt");
|
||||
/*FILE *f1=fopen(logfmt("matrO_%d.d",s),"wt");
|
||||
fileout(f1,Y[s],"%15g");
|
||||
fclose(f1);8*/
|
||||
|
||||
ZPPTRF("L",&nes,Y[s].arr,&info);
|
||||
// analyze return code here
|
||||
if(info<0)
|
||||
return LOGERR(info,fmt("AWPMD.interacton: call to ZPTRF failed (exitcode %d)!",info),LINFO);
|
||||
return LOGERR(info,logfmt("AWPMD.interacton: call to ZPTRF failed (exitcode %d)!",info),LINFO);
|
||||
ZPPTRI("L",&nes,Y[s].arr,&info);
|
||||
if(info<0)
|
||||
return LOGERR(info,fmt("AWPMD.interacton: call to ZPTRI failed (exitcode %d)!",info),LINFO);
|
||||
return LOGERR(info,logfmt("AWPMD.interacton: call to ZPTRI failed (exitcode %d)!",info),LINFO);
|
||||
|
||||
|
||||
/*f1=fopen(fmt("matrY_%d.d",s),"wt");
|
||||
/*f1=fopen(logfmt("matrY_%d.d",s),"wt");
|
||||
fileout(f1,Y[s],"%15g");
|
||||
fclose(f1);*/
|
||||
}
|
||||
@ -758,7 +758,7 @@ void AWPMD::norm_factorize(int s) {
|
||||
int nes8 = ne[s]*8, info;
|
||||
DGETRF(&nes8, &nes8, Norm[s].arr, &nes8, &ipiv[0], &info);
|
||||
if(info < 0)
|
||||
LOGERR(info,fmt("AWPMD.norm_factorize: call to DGETRF failed (exitcode %d)!",info),LINFO);
|
||||
LOGERR(info,logfmt("AWPMD.norm_factorize: call to DGETRF failed (exitcode %d)!",info),LINFO);
|
||||
|
||||
norm_matrix_state[s] = NORM_FACTORIZED;
|
||||
}
|
||||
@ -773,7 +773,7 @@ void AWPMD::norm_invert(int s) {
|
||||
|
||||
DGETRI(&nes8, Norm[s].arr, &nes8, &ipiv[0], (double*)IDD.arr, &IDD_size, &info); // use IDD for work storage
|
||||
if(info < 0)
|
||||
LOGERR(info,fmt("AWPMD.norm_invert: call to DGETRI failed (exitcode %d)!",info),LINFO);
|
||||
LOGERR(info,logfmt("AWPMD.norm_invert: call to DGETRI failed (exitcode %d)!",info),LINFO);
|
||||
|
||||
norm_matrix_state[s] = NORM_INVERTED;
|
||||
}
|
||||
@ -829,7 +829,7 @@ int AWPMD::step(double dt){
|
||||
//e gets current electronic coordinates
|
||||
int AWPMD::get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, double mass){
|
||||
if(spin<0 || spin >1)
|
||||
return -1; // invalid spin: return LOGERR(-1,fmt("AWPMD.get_electrons: invaid spin setting (%d)!",spin),LINFO);
|
||||
return -1; // invalid spin: return LOGERR(-1,logfmt("AWPMD.get_electrons: invaid spin setting (%d)!",spin),LINFO);
|
||||
if(mass<0)
|
||||
mass=me;
|
||||
for(int i=0;i<ni;i++){
|
||||
|
||||
@ -54,7 +54,7 @@ int AWPMD_split::add_split(Vector_3 &x, Vector_3 &v, double &w, double &pw, Vect
|
||||
int AWPMD_split::set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* w, double* pw, Vector_2 *c, int *splits, double mass, double *q)
|
||||
{
|
||||
if(s < 0 || s > 1)
|
||||
return LOGERR(-1,fmt("AWPMD_split.set_electrons: invaid spin setting (%d)!",s),LINFO);
|
||||
return LOGERR(-1,logfmt("AWPMD_split.set_electrons: invaid spin setting (%d)!",s),LINFO);
|
||||
|
||||
// calculating the total n
|
||||
nvar[s]=0;
|
||||
@ -663,20 +663,20 @@ int AWPMD_split::interaction(int flag, Vector_3P fi, Vector_3P fe_x,
|
||||
//3. inverting the overlap matrix
|
||||
int info=0;
|
||||
if(nes && approx!=HARTREE){
|
||||
/*FILE *f1=fopen(fmt("matrO_%d.d",s),"wt");
|
||||
/*FILE *f1=fopen(logfmt("matrO_%d.d",s),"wt");
|
||||
fileout(f1,Y[s],"%15g");
|
||||
fclose(f1);8*/
|
||||
|
||||
ZPPTRF("L",&nes,Y[s].arr,&info);
|
||||
// analyze return code here
|
||||
if(info<0)
|
||||
return LOGERR(info,fmt("AWPMD.interacton: call to ZPTRF failed (exitcode %d)!",info),LINFO);
|
||||
return LOGERR(info,logfmt("AWPMD.interacton: call to ZPTRF failed (exitcode %d)!",info),LINFO);
|
||||
ZPPTRI("L",&nes,Y[s].arr,&info);
|
||||
if(info<0)
|
||||
return LOGERR(info,fmt("AWPMD.interacton: call to ZPTRI failed (exitcode %d)!",info),LINFO);
|
||||
return LOGERR(info,logfmt("AWPMD.interacton: call to ZPTRI failed (exitcode %d)!",info),LINFO);
|
||||
|
||||
|
||||
/*f1=fopen(fmt("matrY_%d.d",s),"wt");
|
||||
/*f1=fopen(logfmt("matrY_%d.d",s),"wt");
|
||||
fileout(f1,Y[s],"%15g");
|
||||
fclose(f1);*/
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ public:
|
||||
///\en Starts adding new electron: continue with \ref add_split functions.
|
||||
int add_electron(int s){
|
||||
if(s < 0 || s > 1)
|
||||
return LOGERR(-1,fmt("AWPMD_split.add_electron: invaid spin setting (%d)!",s),LINFO);
|
||||
return LOGERR(-1,logfmt("AWPMD_split.add_electron: invaid spin setting (%d)!",s),LINFO);
|
||||
s_add=s;
|
||||
spl_add=0;
|
||||
return ne[s_add];
|
||||
|
||||
@ -237,7 +237,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
|
||||
etmap[etag[i]].push_back(i);
|
||||
}
|
||||
else
|
||||
error->all(FLERR,fmt("Invalid spin value (%d) for particle %d !",spin[i],i));
|
||||
error->all(FLERR,logfmt("Invalid spin value (%d) for particle %d !",spin[i],i));
|
||||
}
|
||||
// ion force vector
|
||||
Vector_3 *fi=NULL;
|
||||
@ -254,7 +254,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
|
||||
for(size_t k=0;k<el.size();k++){
|
||||
int i=el[k];
|
||||
if(spin[el[0]]!=spin[i])
|
||||
error->all(FLERR,fmt("WP splits for one electron should have the same spin (at particles %d, %d)!",el[0],i));
|
||||
error->all(FLERR,logfmt("WP splits for one electron should have the same spin (at particles %d, %d)!",el[0],i));
|
||||
double m= atom->mass ? atom->mass[type[i]] : force->e_mass;
|
||||
Vector_3 xx=Vector_3(x[i][0],x[i][1],x[i][2]);
|
||||
Vector_3 rv=m*Vector_3(v[i][0],v[i][1],v[i][2]);
|
||||
|
||||
Reference in New Issue
Block a user