/** * Calculate the nuclear-nuclear potential energy of a problem * @param problem the problem to be solved */ double MxElem::NuclPotEn(input & problem){ double energy = 0; int Ncores = problem.gNcores(); for (int i=0; i<Ncores; i++){ R Ri(*(problem.gvector(i))); int Zi = problem.gcore(i); for (int j=i+1; j<Ncores; j++){ energy += Zi * problem.gcore(j) / sqrt(Ri.DistanceSquared(*(problem.gvector(j)))); } } return energy; }
/** * Copy constructor for the input class * @param lisa the input to be copied */ input::input(input & lisa){ initelements(); Charge = lisa.gCharge(); RotationSymm = lisa.gRotationSymm(); basisset = lisa.gbasisset(); Ncores = lisa.gNcores(); cores = new int[Ncores]; vectors = new R*[Ncores]; GaussInfo = new Gauss*[Ncores]; for (int cnt=0; cnt<Ncores; cnt++){ cores[cnt] = lisa.gcore(cnt); vectors[cnt] = new R(*(lisa.gvector(cnt))); GaussInfo[cnt] = new Gauss(*(lisa.gGaussInfo(cnt))); } }