Skip to content
Open
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
6 changes: 3 additions & 3 deletions src/b_tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void DirectDFPerturbedBlocks::for_each_pert(
static const int comp_atom[] = {2, 2, 2, 3, 3, 3, 0, 0, 0}; // 0=anuc, 2=inuc, 3=jnuc
static const int comp_xyz[] = {0, 1, 2, 0, 1, 2, 0, 1, 2};

const size_t Nsh_orb = cenv_->get_Nsh_orb();
const size_t Nsh_orb = cenv_->Nsh_orb();
for(size_t ia=0; ia<aux_shells_.size(); ia++) {
const size_t Na = aux_shells_[ia].get_Nbf();
const size_t a0 = aux_shells_[ia].get_first_ind();
Expand Down Expand Up @@ -269,7 +269,7 @@ DirectCDBlocks::DirectCDBlocks(size_t Nbf, size_t Naux,
cenv_(&cenv) {
// The pivot shells follow the orbital shells in the environment when
// they are not the same shells (a shared pivot basis)
piv_offset_ = (cenv_->get_Nsh_orb() == cenv_->get_Nsh()) ? 0 : cenv_->get_Nsh_orb();
piv_offset_ = (cenv_->Nsh_orb() == cenv_->Nsh()) ? 0 : cenv_->Nsh_orb();

if(pivot_X_.n_cols != Naux_)
throw std::logic_error("DirectCDBlocks: pivot_X cleaned-subspace dim does not match Naux");
Expand Down Expand Up @@ -387,7 +387,7 @@ arma::mat DirectDFBlocks::get_block(size_t ip) const {
// they go straight into our slice. Matches the cached
// compute_a_munu layout so the J/K kernels see identical blocks
// either way.
const size_t Nsh_orb = cenv_->get_Nsh_orb();
const size_t Nsh_orb = cenv_->Nsh_orb();
double * buf_ptr = buf.memptr();
for(size_t ia=0; ia<aux_shells_.size(); ia++) {
const size_t Na = aux_shells_[ia].get_Nbf();
Expand Down
12 changes: 6 additions & 6 deletions src/badergrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ BaderGrid::~BaderGrid() {

void BaderGrid::set(const BasisSet & basis, bool ver, bool lobatto) {
wrk=AngularGrid(lobatto);
wrk.set_basis(basis);
wrk.basis(basis);
basp=&basis;
// Only need function values
wrk.set_grad_tau_lapl(false,false,false);
Expand Down Expand Up @@ -111,13 +111,13 @@ void BaderGrid::construct_bader(const arma::mat & P, double otoler) {
size_t oldatom=-1;
for(size_t ig=0;ig<grids.size();ig++) {
// Construct the shell
wrk.set_grid(grids[ig]);
wrk.set_shell(grids[ig]);
grids[ig]=wrk.construct_becke(otoler/nrad[grids[ig].atind]);
// Form the grid again
wrk.form_grid();

// Extract the points on the shell
std::vector<gridpoint_t> shellpoints(wrk.get_grid());
std::vector<gridpoint_t> shellpoints(wrk.grid());
if(!shellpoints.size())
continue;

Expand Down Expand Up @@ -286,13 +286,13 @@ void BaderGrid::construct_voronoi(double otoler) {

for(size_t ig=0;ig<grids.size();ig++) {
// Construct the shell
wrk.set_grid(grids[ig]);
wrk.set_shell(grids[ig]);
grids[ig]=wrk.construct_becke(otoler/nrad[grids[ig].atind]);
// Form the grid again
wrk.form_grid();

// Extract the points on the shell
std::vector<gridpoint_t> shellpoints(wrk.get_grid());
std::vector<gridpoint_t> shellpoints(wrk.grid());

// Loop over the points on the shell
for(size_t ip=0;ip<shellpoints.size();ip++) {
Expand Down Expand Up @@ -375,7 +375,7 @@ arma::mat BaderGrid::regional_overlap(size_t ireg) {
arma::rowvec w(reggrid[ireg].size());
for(size_t ip=0;ip<reggrid[ireg].size();ip++) {
// Weight is
w(ip)=reggrid[ireg][ip].w;
w(ip)=reggrid[ireg][ip].w_;
// Basis function values are
bf.col(ip)=basp->eval_func(reggrid[ireg][ip].r.x,reggrid[ireg][ip].r.y,reggrid[ireg][ip].r.z);
}
Expand Down
4 changes: 2 additions & 2 deletions src/basistool/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ int main_guarded(int argc, char **argv) {
#endif

// Get the (a|b) integrals
arma::mat ab = dfit.get_ab();
arma::mat ab = dfit.ab();

// Form contractions
std::vector<arma::vec> exps(auxbasis.get_max_am()+1);
Expand Down Expand Up @@ -601,7 +601,7 @@ int main_guarded(int argc, char **argv) {
dfit.fill(orbbasis, auxbasis, direct, erithr, linthr, bmat);

// This matrix should be orthonormal, since the contracted functions are orthonormalized
arma::mat ab(dfit.get_ab());
arma::mat ab(dfit.ab());
ab -= arma::eye<arma::mat>(ab.n_rows,ab.n_cols);
double dnorm(arma::norm(ab,"fro"));
printf("%s aux basis non-orthonormality %e\n",element.c_str(),dnorm);
Expand Down
2 changes: 1 addition & 1 deletion src/casida/casida.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ void Casida::coulomb_fit(const BasisSet & basis, std::vector<arma::mat> & munu,
// Dummy shell, helper for computing ERIs
// libcint environment: orbital shells followed by the auxiliary ones
CintEnv cenv(basis,dfitbas);
const size_t Nsh_orb=cenv.get_Nsh_orb();
const size_t Nsh_orb=cenv.Nsh_orb();

// First, compute the two-center integrals
arma::mat ab(Naux,Naux);
Expand Down
54 changes: 27 additions & 27 deletions src/casida/casida_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ CasidaShell::~CasidaShell() {
}

void CasidaShell::compute_orbs(const std::vector<arma::mat> & C) {
if(C.size()==1 && polarized) {
if(C.size()==1 && polarized_) {
ERROR_INFO();
throw std::runtime_error("Trying to calculate restricted orbitals with unrestricted grid.\n");
} else if(C.size()>1 && !polarized) {
} else if(C.size()>1 && !polarized_) {
ERROR_INFO();
throw std::runtime_error("Trying to calculate unrestricted orbitals with restricted grid.\n");
}

orbs.resize(C.size());
for(size_t ispin=0;ispin<C.size();ispin++)
// Resize to number of grid points
orbs[ispin].resize(grid.size());
orbs[ispin].resize(grid_.size());

// Loop over grid points
for(size_t ip=0;ip<grid.size();ip++) {
for(size_t ip=0;ip<grid_.size();ip++) {
// Initialize orbital values
for(size_t ispin=0;ispin<C.size();ispin++) {
orbs[ispin][ip].resize(C[ispin].n_cols);
Expand All @@ -55,32 +55,32 @@ void CasidaShell::compute_orbs(const std::vector<arma::mat> & C) {

for(size_t ispin=0;ispin<C.size();ispin++) {
// Orbital values are
arma::mat Cval=arma::trans(C[ispin].rows(bf_ind))*bf;
arma::mat Cval=arma::trans(C[ispin].rows(bf_ind_))*bf_;
// Store values
for(size_t ip=0;ip<grid.size();ip++)
for(size_t ip=0;ip<grid_.size();ip++)
for(size_t io=0;io<Cval.n_rows;io++)
orbs[ispin][ip][io]=Cval(io,ip);
}
}

void CasidaShell::eval_fxc(int x_func, int c_func) {
int nspin;
if(!polarized)
if(!polarized_)
nspin=XC_UNPOLARIZED;
else
nspin=XC_POLARIZED;

// Allocate memory for fx and fc
if(!polarized) {
if(fx.size()!=grid.size())
fx.resize(grid.size());
if(fc.size()!=grid.size())
fc.resize(grid.size());
if(!polarized_) {
if(fx.size()!=grid_.size())
fx.resize(grid_.size());
if(fc.size()!=grid_.size())
fc.resize(grid_.size());
} else {
if(fc.size()!=3*grid.size())
fc.resize(3*grid.size());
if(fx.size()!=3*grid.size())
fx.resize(3*grid.size());
if(fc.size()!=3*grid_.size())
fc.resize(3*grid_.size());
if(fx.size()!=3*grid_.size())
fx.resize(3*grid_.size());
}

// Correlation and exchange functionals
Expand All @@ -99,7 +99,7 @@ void CasidaShell::eval_fxc(int x_func, int c_func) {
}

// Evaluate fx
xc_lda_fxc(&xfunc, grid.size(), &rho[0], &fx[0]);
xc_lda_fxc(&xfunc, grid_.size(), &rho_[0], &fx[0]);

// Free the functional
xc_func_end(&xfunc);
Expand All @@ -124,7 +124,7 @@ void CasidaShell::eval_fxc(int x_func, int c_func) {
}

// Evaluate fx and fc
xc_lda_fxc(&cfunc, grid.size(), &rho[0], &fc[0]);
xc_lda_fxc(&cfunc, grid_.size(), &rho_[0], &fc[0]);

// Free the functionals
xc_func_end(&cfunc);
Expand All @@ -138,10 +138,10 @@ void CasidaShell::eval_fxc(int x_func, int c_func) {
void CasidaShell::Kxc(const std::vector< std::vector<states_pair_t> > & pairs, arma::mat & K) const {
double wxc;

if(polarized && pairs.size()!=2) {
if(polarized_ && pairs.size()!=2) {
ERROR_INFO();
throw std::runtime_error("Running with polarized grid but non-polarized pairs!\n");
} else if(!polarized && pairs.size()==2) {
} else if(!polarized_ && pairs.size()==2) {
ERROR_INFO();
throw std::runtime_error("Running with unpolarized grid but polarized pairs!\n");
}
Expand All @@ -157,9 +157,9 @@ void CasidaShell::Kxc(const std::vector< std::vector<states_pair_t> > & pairs, a

if(ispin==jspin) {
// Loop over grid points
for(size_t ip=0;ip<grid.size();ip++) {
for(size_t ip=0;ip<grid_.size();ip++) {
// Factor in common for all orbitals. First case is polarized (up-up or down-down), second case is unpolarized
wxc=polarized ? grid[ip].w*(fx[3*ip+2*ispin]+fc[3*ip+2*ispin]) : grid[ip].w*(fx[ip]+fc[ip]);
wxc=polarized_ ? grid_[ip].w_*(fx[3*ip+2*ispin]+fc[3*ip+2*ispin]) : grid_[ip].w_*(fx[ip]+fc[ip]);

// Loop over pairs
for(size_t ipair=0;ipair<pairs[ispin].size();ipair++) {
Expand All @@ -176,9 +176,9 @@ void CasidaShell::Kxc(const std::vector< std::vector<states_pair_t> > & pairs, a
}
} else {
// Loop over grid points
for(size_t ip=0;ip<grid.size();ip++) {
for(size_t ip=0;ip<grid_.size();ip++) {
// Factor in common for all orbitals
wxc=grid[ip].w*(fx[3*ip+1]+fc[3*ip+1]); // up-down and down-up
wxc=grid_[ip].w_*(fx[3*ip+1]+fc[3*ip+1]); // up-down and down-up

// Cross-spin (ispin != jspin) block is rectangular: iterate
// jpair over the full pairs[jspin] range, not the lower
Expand Down Expand Up @@ -221,7 +221,7 @@ CasidaGrid::CasidaGrid(const BasisSet * bas, bool lobatto, bool ver) {
#endif

for(size_t i=0;i<wrk.size();i++)
wrk[i].set_basis(*bas);
wrk[i].basis(*bas);
}

CasidaGrid::~CasidaGrid() {
Expand Down Expand Up @@ -278,7 +278,7 @@ void CasidaGrid::construct(const std::vector<arma::mat> & P, double ftoler, int
#pragma omp for schedule(dynamic,1)
#endif
for(size_t i=0;i<grids.size();i++) {
wrk[ith].set_grid(grids[i]);
wrk[ith].set_shell(grids[i]);
if(P.size()==1)
grids[i]=wrk[ith].construct(P[0],ftoler/nrad[grids[i].atind],x_func,c_func);
else if(P.size()==2)
Expand Down Expand Up @@ -336,7 +336,7 @@ void CasidaGrid::Kxc(const std::vector<arma::mat> & P, double tol, int x_func, i
#endif
for(size_t i=0;i<grids.size();i++) {
// Change atom and create grid
wrk[ith].set_grid(grids[i]);
wrk[ith].set_shell(grids[i]);
wrk[ith].form_grid();

// Update the density
Expand Down
Loading
Loading