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/run_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void Run_lcao::lcao_line(void)

// * reading the localized orbitals/projectors
// * construct the interpolation tables.

hm.orb_con.set_orb_tables(
UOT,
ORB,
Expand Down
8 changes: 4 additions & 4 deletions ABACUS.develop/source/src_global/global_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,26 +189,26 @@ void WARNING_QUIT(const string &file,const string &description)
{
cout << " " << endl;
cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
cout << " !!!!!!!!!!!!!!!!! SOMETHING TO WARN YOU !!!!!!!!!!!!!!!!!" << endl;
cout << " NOTICE " << endl;
cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
cout << " " << endl;
cout << " " << description << endl;
cout << " CHECK IN FILE : " << global_out_dir << "warning.log" << endl;
cout << " " << endl;
cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
cout << " !!!!!!!!!!!!!!!!! SOMETHING TO WARN YOU !!!!!!!!!!!!!!!!!" << endl;
cout << " NOTICE " << endl;
cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;


ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
ofs_running << " !!!!!!!!!!!!!!!!! SOMETHING TO WARN YOU !!!!!!!!!!!!!!!!!" << endl;
ofs_running << " NOTICE " << endl;
ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
ofs_running << endl;
ofs_running << " " << description << endl;
ofs_running << " CHECK IN FILE : " << global_out_dir << "warning.log" << endl;
ofs_running << endl;
ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
ofs_running << " !!!!!!!!!!!!!!!!! SOMETHING TO WARN YOU !!!!!!!!!!!!!!!!!" << endl;
ofs_running << " NOTICE " << endl;
ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
}

Expand Down
246 changes: 106 additions & 140 deletions ABACUS.develop/source/src_io/read_atoms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ bool UnitCell_pseudo::read_atom_positions(ifstream &ifpos)
ofs_warning << " Cartesian_angstrom_center_xz" << endl;
ofs_warning << " Cartesian_angstrom_center_yz" << endl;
ofs_warning << " Cartesian_angstrom_center_xyz" << endl;
return 0;
return 0; // means something wrong
}

Vector3<double> v;
Expand All @@ -211,7 +211,9 @@ bool UnitCell_pseudo::read_atom_positions(ifstream &ifpos)
for(int it2=0; it2<ntype; it2++)
{
if( this->atoms[it].label == this->atom_label[it] )
found = true;
{
found = true;
}
}
if(!found)
{
Expand Down Expand Up @@ -262,146 +264,110 @@ bool UnitCell_pseudo::read_atom_positions(ifstream &ifpos)
// int atoms[it].nwl
// int* atoms[it].l_nchi;
//===========================================
/*READ_VALUE(ifpos, this->atoms[it].nwl);
assert(this->atoms[it].nwl<10);
OUT(ofs_running,"L max for local orbitals",atoms[it].nwl);

delete[] this->atoms[it].l_nchi;
this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1];
this->atoms[it].nw = 0;
for(int L=0; L<atoms[it].nwl+1; L++)
if (BASIS_TYPE == "lcao" || BASIS_TYPE == "lcao_in_pw")
{
ifstream ifs(ORB.orbital_file[it].c_str(), ios::in); // pengfei 2014-10-13

// mohan add return 2021-04-26
if (!ifs)
{
cout << " Element index " << it+1 << endl;
cout << " orbital file: " << ORB.orbital_file[it] << endl;
WARNING("read_atom_positions","ABACUS Cannot find the ORBITAL file (basis sets)");
return 0; // means something wrong
}

char word[80];
delete[] this->atoms[it].l_nchi;
this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1];
this->atoms[it].nw = 0;
int L =0;

while (ifs.good())
{
ifs >> word;
if (strcmp("Lmax", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].nwl);
}
assert(this->atoms[it].nwl<10);

if (strcmp("Cutoff(a.u.)", word) == 0) // pengfei Li 16-2-29
{
READ_VALUE(ifs, this->atoms[it].Rcut);
}

if (strcmp("Sorbital-->", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].l_nchi[L]);
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];
stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
L++;
}
if (strcmp("Porbital-->", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].l_nchi[L]);
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];
stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
L++;
}
if (strcmp("Dorbital-->", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].l_nchi[L]);
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];
stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
L++;
}
if (strcmp("Forbital-->", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].l_nchi[L]);
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];
stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
L++;
}
if (strcmp("Gorbital-->", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].l_nchi[L]);
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];
stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
L++;
}
}
ifs.close();
}
else
{
READ_VALUE(ifpos, this->atoms[it].l_nchi[L]);
delete[] this->atoms[it].l_nchi;
this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1];
this->atoms[it].nw = 0;

// calculate the number of local basis(3D)
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];

stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
}*/
if (BASIS_TYPE == "lcao" || BASIS_TYPE == "lcao_in_pw")
{
ifstream ifs(ORB.orbital_file[it].c_str(), ios::in); // pengfei 2014-10-13
if (!ifs)
{
cout << " Can't find the ORBITAL file." << endl;
}

char word[80];
delete[] this->atoms[it].l_nchi;
this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1];
this->atoms[it].nw = 0;
int L =0;

while (ifs.good())
{
ifs >> word;
if (strcmp("Lmax", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].nwl);
}
assert(this->atoms[it].nwl<10);

if (strcmp("Cutoff(a.u.)", word) == 0) // pengfei Li 16-2-29
{
READ_VALUE(ifs, this->atoms[it].Rcut);
}

//cout << "atoms[it].nwl = "<<atoms[it].nwl <<endl;
if (strcmp("Sorbital-->", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].l_nchi[L]);
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];
stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
L++;
}
if (strcmp("Porbital-->", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].l_nchi[L]);
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];
stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
L++;
}
if (strcmp("Dorbital-->", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].l_nchi[L]);
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];
stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
L++;
}
if (strcmp("Forbital-->", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].l_nchi[L]);
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];
stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
L++;
}
if (strcmp("Gorbital-->", word) == 0)
{
READ_VALUE(ifs, this->atoms[it].l_nchi[L]);
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];
stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
L++;
}
//cout <<" atoms[it].nw = "<<atoms[it].nw<<endl;


}
ifs.close();
}
else
{
delete[] this->atoms[it].l_nchi;
this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1];
this->atoms[it].nw = 0;

this->atoms[it].nwl = 2;
//cout << INPUT.lmaxmax << endl;
if ( INPUT.lmaxmax != 2 )
{
this->atoms[it].nwl = INPUT.lmaxmax;
}
for(int L=0; L<atoms[it].nwl+1; L++)
{
this->atoms[it].l_nchi[L] = 1;
// calculate the number of local basis(3D)
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];

stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
}

/* this->atoms[it].l_nchi[0] = 1;
this->atoms[it].nw += (2*0 + 1) * this->atoms[it].l_nchi[0];
// stringstream s0;
// s0 << "L=" << 0 << ", number of zeta";
// OUT(ofs_running,s0.str(),atoms[it].l_nchi[0]);

this->atoms[it].l_nchi[1] = 1;
this->atoms[it].nw += (2*1 + 1) * this->atoms[it].l_nchi[1];
// stringstream s1;
// s1 << "L=" << 1 << ", number of zeta";
// OUT(ofs_running,s1.str(),atoms[it].l_nchi[1]);

this->atoms[it].l_nchi[2] = 1;
this->atoms[it].nw += (2*2 + 1) * this->atoms[it].l_nchi[2];*/
// stringstream s2;
// s2 << "L=" << 2 << ", number of zeta";
// OUT(ofs_running,s2.str(),atoms[it].l_nchi[2]);*/

}
this->atoms[it].nwl = 2;
//cout << INPUT.lmaxmax << endl;
if ( INPUT.lmaxmax != 2 )
{
this->atoms[it].nwl = INPUT.lmaxmax;
}
for(int L=0; L<atoms[it].nwl+1; L++)
{
this->atoms[it].l_nchi[L] = 1;
// calculate the number of local basis(3D)
this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L];

stringstream ss;
ss << "L=" << L << ", number of zeta";
OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]);
}
} // end basis type

//OUT(ofs_running,"Total number of local orbitals",atoms[it].nw);

Expand Down
7 changes: 0 additions & 7 deletions ABACUS.develop/source/src_lcao/ORB_atomic.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
//=========================================================
//AUTHOR : liaochen
//DATE : 2008-11-12
//Last Update : 2009-4-23
//=========================================================
#ifndef NUMERICAL_ORBITAL_H
#define NUMERICAL_ORBITAL_H

Expand All @@ -11,8 +6,6 @@ using namespace std;

#include "../src_global/intarray.h"
#include "../src_global/vector3.h"

//#include "../src_pw/tools.h"
#include "ORB_atomic_lm.h"

//=========================================================
Expand Down
7 changes: 6 additions & 1 deletion ABACUS.develop/source/src_lcao/ORB_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ void ORB_control::set_orb_tables(
orb.dR = lcao_dr_in;
orb.Rmax = lcao_rmax_in;

orb.Read_Orbitals(ntype, lmax, out_descriptor, out_r_matrix, my_rank);
orb.Read_Orbitals(
ntype,
lmax,
out_descriptor,
out_r_matrix,
my_rank);

if(CALCULATION=="test")
{
Expand Down
Loading