void Cubic_spline::findCutoffs() { //Find the cutoff lengths for each function. rcut.Resize(nfunctions); int totfunc=0; for(int i=0; i < nsplines; i++) { int nrep=0; switch(symmetry(i)) { case sym_S: nrep=1; break; case sym_P: case sym_P_siesta: nrep=3; break; case sym_5D: case sym_D_siesta: nrep=5; break; case sym_6D: nrep=6; break; case sym_7F: case sym_7F_crystal://CRYSTAL F orbital case sym_F_siesta: nrep=7; break; case sym_10F: nrep=10; break; case sym_9G: nrep=9; break; case sym_15G: nrep=15; break; default: error("I don't have this symmetry:", symmetry(i)); } doublevar cutoff=splines(i).findCutoff(); for(int j=0; j< nrep; j++) { rcut(totfunc++)=cutoff; } } threshold=0; for(int i=0; i< rcut.GetDim(0); i++) { if(threshold < rcut(i)) threshold=rcut(i); } for(int i=0; i< nsplines; i++) { splines(i).pad(threshold); } }
void WMConstraints::addBasisGroup(xmlNodePtr cur) { string sourceOpt("e"); string elementType("e"); OhmmsAttributeSet aAttrib; aAttrib.add(sourceOpt,"source"); aAttrib.add(elementType,"elementType"); aAttrib.put(cur); RealType rcut(myGrid->rmax()); map<string,BasisSetType*>::iterator it(myBasisSet.find(elementType)); if(it == myBasisSet.end()) { BasisSetType* newBasis=new BasisSetType; cur=cur->children; while(cur != NULL) { string cname((const char*)(cur->name)); if(cname == "parameter") { //BasisType* a=new BasisType(1.0,rcut); WMFunctor<RealType>* a = new WMFunctor<RealType>(1.0,rcut); a->put(cur); newBasis->push_back(a); } cur=cur->next; } //add a new BasisSet myBasisSet[elementType]=newBasis; } }
int Cubic_spline::showinfo(string & indent, ostream & os) { os << indent << "Cubic spline for " << atomname << endl; if(zero_derivative) os << indent << "Zero derivative enforced at the orgin\n"; if(customspacing!=0.02) os << indent << "Using custom spacing of "<<customspacing<<endl; os << indent << nsplines << " radial functions\n"; os << indent << setw(10) << "function" << setw(10) << "symmetry" << setw(10) << "cutoff" << endl; int totfunc=0; for(int i=0; i< nsplines; i++) { os << indent << setw(10) << i << setw(10) << symmetry_lookup(symmetry(i)) << setw(10) << rcut(totfunc) << endl; totfunc+=nfuncspline(i); } return 1; }
doublevar Cubic_spline::cutoff(int n){ assert(n<nfunctions); return rcut(n); }