Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ABACUS.develop/source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ sph_bessel_recursive-d1.o \
sph_bessel_recursive-d2.o \
global_variable.o \
global_function.o \
title.o\
global_file.o \
element_basis_index.o \
restart.o \
Expand Down
3 changes: 2 additions & 1 deletion ABACUS.develop/source/src_external/ORB_api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ OPTS_GDB = -g -W

FP_OBJS_0=main.o\
$(OBJS_TRY)\
$(OBJS_ORBITAL)\
$(OBJS_GLOBAL)\
#$(OBJS_ORBITAL)\

FP_OBJS=$(patsubst %.o, ${OBJ_DIR}/%.o, ${FP_OBJS_0})
PDIAG_OBJS=$(patsubst %.o, ${OBJ_DIR}/%.o, ${OBJS_PDIAG})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ ORB_gen_tables.o\
OBJS_GLOBAL=sph_bessel.o\
sph_bessel_recursive-d1.o\
sph_bessel_recursive-d2.o\
title.o\
timer.o\
37 changes: 0 additions & 37 deletions ABACUS.develop/source/src_global/global_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,6 @@
#include <iostream>
using namespace std;

//==========================================================
// GLOBAL FUNCTION :
// NAME : TITLE( title for each function )
//==========================================================
void TITLE(const string &class_function_name)
{
return;//no output
cout<<" ==> "<<class_function_name<<endl;
if(ofs_running) // mohan add 2009-08-25 in case the function called before allocate ofs_running
{
ofs_running<<" ==> "<<class_function_name<<endl;
}
}

void TITLE(const string &class_name,const string &function_name)
{
return;//no output
cout<<" ==> "<<class_name<<"::"<<function_name<<endl;
if(ofs_running) // mohan add 2009-08-25 in case the function called before allocate ofs_running
{
ofs_running<<" ==> "<<class_name<<"::"<<function_name<<endl;
}
return;
}

void TITLE(ofstream &ofs,const string &class_name,const string &function_name)
{
return;// no output
cout<<"\n\n ==> "<<class_name<<"::"<<function_name<<endl;
if(ofs_running)
{
ofs<<" ==> "<<class_name<<"::"<<function_name<<endl;
}

return;
}

void NOTE(const string &words)
{
return;
Expand Down
8 changes: 1 addition & 7 deletions ABACUS.develop/source/src_global/global_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,12 @@
#include <complex>
#include <cassert>

#include "title.h" // mohan add 2021-05-05
#include "global_variable.h"
#include "global_function-func_each_2.h" // Peize Lin add 2016-09-07

using namespace std;

//==========================================================
// GLOBAL FUNCTION :
// NAME : TITLE( title for each function )
//==========================================================
void TITLE(const string &class_function_name);
void TITLE(const string &class_name,const string &function_name);
void TITLE(ofstream &ofs,const string &class_name,const string &function_name);
void NOTE(const string &words);
void NEW_PART(const string &words);

Expand Down
7 changes: 4 additions & 3 deletions ABACUS.develop/source/src_global/mathzone_add1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
typedef fftw_complex FFTW_COMPLEX;

//#include <unistd.h>
//#include <fstream>
//#include <string>
#include <omp.h>

bool Mathzone_Add1::flag_jlx_expand_coef = false;
Expand Down Expand Up @@ -1421,14 +1419,17 @@ void Mathzone_Add1::Uni_Deriv_Phi
for (int ir = 0; ir < mesh; ir++)
{
if (is_re)
{
phind[ir] = fac * c_re(fft_ndphir[ir]) / FFT_NR;
}
else
{
phind[ir] = fac * c_im(fft_ndphir[ir]) / FFT_NR;
}
}

fftw_destroy_plan (p1);
fftw_destroy_plan (p2);

timer::tick("Mathzone_Add1", "Uni_Deriv_Phi");
}

28 changes: 13 additions & 15 deletions ABACUS.develop/source/src_global/mathzone_add1.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,21 @@ class Mathzone_Add1
double* phind
);



private:
const static int sph_lmax = 20;
static double** c_ln_c;
static double** c_ln_s;
static bool flag_jlx_expand_coef;
const static int sph_lmax = 20;
static double** c_ln_c;
static double** c_ln_s;
static bool flag_jlx_expand_coef;

static void expand_coef_jlx ();
static double pol_seg_int
(
const int& polint_order,
const double* coef,
const int& n,
const double* k,
const int& ik
);
static void expand_coef_jlx ();
static double pol_seg_int
(
const int& polint_order,
const double* coef,
const int& n,
const double* k,
const int& ik
);
};

#endif
24 changes: 18 additions & 6 deletions ABACUS.develop/source/src_global/sph_bessel.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "../src_pw/global.h"
//#include "../src_pw/global.h"
#include "sph_bessel.h"
#include "../src_parallel/parallel_reduce.h"
#include "timer.h"
#include "global_function.h"

Sph_Bessel::Sph_Bessel()
{
Expand Down Expand Up @@ -206,7 +208,9 @@ double Sph_Bessel::jlx7(const int &n, const double &x)
double order, rj, rjp, ry, ryp;
if (n < 0 || x <= 0.0)
{
WARNING_QUIT("Sph_Bessel::jlx7","bad arguments in sphbes");
cout << "Sph_Bessel::jlx7,bad arguments in sphbes" << endl;
//WARNING_QUIT("Sph_Bessel::jlx7","bad arguments in sphbes");
exit(0); // mohan add 2021-05-05
}
order = n + 0.5;
BESSJY(x, order, &rj, &ry, &rjp, &ryp);
Expand All @@ -224,7 +228,9 @@ void Sph_Bessel::BESSJY(double x, double xnu, double *rj, double *ry, double *rj
temp,w,x2,xi,xi2,xmu,xmu2;
if (x <= 0.0 || xnu < 0.0)
{
WARNING_QUIT("Sph_Bessel::BESSJY","bad arguments in bessjy");
cout << "Sph_Bessel::BESSJY, bad arguments in bessjy" << endl;
//WARNING_QUIT("Sph_Bessel::BESSJY","bad arguments in bessjy");
exit(0);
}
nl=(x < xmin ? (int)(xnu+0.5) : IMAX(0,(int)(xnu-x+1.5)));
xmu=xnu-nl;
Expand Down Expand Up @@ -252,7 +258,9 @@ void Sph_Bessel::BESSJY(double x, double xnu, double *rj, double *ry, double *rj
}
if (i > maxit)
{
WARNING_QUIT("Sph_Bessel::BESSJY","x too large in bessjy; try asymptotic expansion");
cout << "Sph_Bessel::BESSJY, x too large in bessjy; try asymptotic expansion" << endl;
//WARNING_QUIT("Sph_Bessel::BESSJY","x too large in bessjy; try asymptotic expansion");
exit(0);
}
rjl=isign*fpmin;
rjpl=h*rjl;
Expand Down Expand Up @@ -299,7 +307,9 @@ void Sph_Bessel::BESSJY(double x, double xnu, double *rj, double *ry, double *rj
}
if (i > maxit)
{
WARNING_QUIT("Sph_Bessel::BESSJY","bessy series failed to converge");
cout << "Sph_Bessel::BESSJY, bessy series failed to converge" << endl;
//WARNING_QUIT("Sph_Bessel::BESSJY","bessy series failed to converge");
exit(0); // mohan add 2021-05-05
}
rymu = -sum;
ry1 = -sum1*xi2;
Expand Down Expand Up @@ -344,7 +354,9 @@ void Sph_Bessel::BESSJY(double x, double xnu, double *rj, double *ry, double *rj
}
if (i > maxit)
{
WARNING_QUIT("Sph_Bessel::BESSJY","cf2 failed in bessjy");
cout << "Sph_Bessel::BESSJY, cf2 failed in bessjy" << endl;
//WARNING_QUIT("Sph_Bessel::BESSJY","cf2 failed in bessjy");
exit(0); // mohan add 2021-05-05
}
gam=(p-f)/q;
rjmu=sqrt(w/((p-f)*gam+q));
Expand Down
52 changes: 52 additions & 0 deletions ABACUS.develop/source/src_global/title.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include "title.h"

#ifdef __NORMAL
#else
#include "global_variable.h"
#endif

//==========================================================
// GLOBAL FUNCTION :
// NAME : TITLE( title for each function )
//==========================================================
void TITLE(const string &class_function_name)
{
return;//no output

#ifdef __NORMAL
cout<<" ==> "<<class_function_name<<endl;
#else
if(ofs_running) // mohan add 2009-08-25 in case the function called before allocate ofs_running
{
ofs_running<<" ==> "<<class_function_name<<endl;
}
#endif
}

void TITLE(const string &class_name,const string &function_name)
{
return;//no output
#ifdef __NORMAL
cout<<" ==> "<<class_name<<"::"<<function_name<<endl;
#else
if(ofs_running) // mohan add 2009-08-25 in case the function called before allocate ofs_running
{
ofs_running<<" ==> "<<class_name<<"::"<<function_name<<endl;
}
#endif
return;
}

void TITLE(ofstream &ofs,const string &class_name,const string &function_name)
{
return;// no output
#ifdef __NORMAL
cout<<"\n\n ==> "<<class_name<<"::"<<function_name<<endl;
#else
if(ofs_running)
{
ofs<<" ==> "<<class_name<<"::"<<function_name<<endl;
}
#endif
return;
}
21 changes: 21 additions & 0 deletions ABACUS.develop/source/src_global/title.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef TITLE_H
#define TITLE_H

#include <vector>
#include <valarray>
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <iomanip>

#include <complex>
#include <cassert>

using namespace std;

void TITLE(const string &class_function_name);
void TITLE(const string &class_name,const string &function_name);
void TITLE(ofstream &ofs,const string &class_name,const string &function_name);

#endif
11 changes: 0 additions & 11 deletions ABACUS.develop/source/src_io/read_pp_upf100.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,18 +292,7 @@ void Pseudopot_upf::read_pseudo_local(ifstream &ifs)
{
ifs >> this->vloc[ir];
}


// for test
/*
ofstream ofs("vloc_UPF.dat");
for(int ir=0; ir<mesh; ++ir)
{
ofs << r[ir] << " " << vloc[ir] << endl;
}
ofs.close();
*/

return;
}

Expand Down
5 changes: 0 additions & 5 deletions ABACUS.develop/source/src_lcao/ORB_control.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
//#include "../src_pw/tools.h"
#include "ORB_control.h"
//#include "src_global/sltk_atom_arrange.h"
#include "ORB_gen_tables.h"
#include "build_st_pw.h"
#include "../src_pdiag/pdiag_double.h"

//#include "../src_pw/global.h"

ORB_control::ORB_control()
{}
Expand Down
3 changes: 0 additions & 3 deletions ABACUS.develop/source/src_lcao/ORB_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#include <cstring> // Peize Lin fix bug about strcmp 2016-08-02
#include <cassert>
#include "../src_global/math_integral.h"
//#include <math.h>
//#include <cmath>
#include <algorithm>
using namespace std;

Expand Down Expand Up @@ -102,7 +100,6 @@ void LCAO_Orbitals::bcast_files(const int &ntype_in)
#endif


//#include "../src_pw/global.h"
void LCAO_Orbitals::Read_Orbitals(
const int &ntype_in,
const int &lmax_in,
Expand Down
1 change: 1 addition & 0 deletions ABACUS.develop/source/src_lcao/ORB_table_phi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "ORB_read.h"
#include "ORB_atomic_lm.h"
#include "../src_global/sph_bessel_recursive.h"
#include "../src_global/intarray.h"
#include <set>

class ORB_table_phi
Expand Down
6 changes: 4 additions & 2 deletions ABACUS.develop/source/src_pw/VL_in_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ void pseudopot_cell_vl::allocate(void)
ZEROS(numeric, ucell.ntype);

for (int it = 0; it < ucell.ntype; it++)
{ this->numeric[it] = true; }
{
this->numeric[it] = true;
}

// mohan change global variable 'npsx' to local variable,
// npsx( max number of different PPs)
Expand Down Expand Up @@ -120,7 +122,7 @@ void pseudopot_cell_vl::vloc_of_g(
// The local pseudopotential of the US case is always in
// numerical form, expressed in Ry units.
// ----------------------------------------------------------------
int igl0;// start from |G|=0 or not.
int igl0=0;// start from |G|=0 or not.
int ig=0;// counters on g-vectors;
int ir=0;// counter on mesh points

Expand Down