34 maxL = std::max(potential.getL(), maxL);
53 const Eigen::Vector3d pos = mol[potential.atom_id].
getPos();
54 potential.center_ = {pos.x(), pos.y(), pos.z()};
60 for (libecpint::ECP potential : other) {
61 potential.atom_id += int(atomindex_offset);
74 std::vector<std::string> non_ecp_elements;
75 for (
QMAtom& atom : atoms) {
76 std::string name = atom.getElement();
78 bool element_exists =
true;
82 }
catch (std::runtime_error& error) {
83 element_exists =
false;
85 if (std::find(non_ecp_elements.begin(), non_ecp_elements.end(), name) !=
86 non_ecp_elements.end()) {
87 non_ecp_elements.push_back(name);
95 libecpint::ECP potential(atom.getPos().data());
96 for (
const ECPShell& shell : element) {
97 for (
const auto& gaussian : shell) {
98 potential.addPrimitive(
int(gaussian.power_),
int(shell.getL()),
99 gaussian.decay_, gaussian.contraction_);
112 return non_ecp_elements;
133 table.
addCol<
double>(
"posX", HOFFSET(
data, x));
134 table.
addCol<
double>(
"posY", HOFFSET(
data, y));
135 table.
addCol<
double>(
"posZ", HOFFSET(
data, z));
138 table.
addCol<
double>(
"coeff", HOFFSET(
data, coeff));
139 table.
addCol<
double>(
"decay", HOFFSET(
data, decay));
147 Index numofprimitives = 0;
149 numofprimitives += potential.getN();
154 std::vector<PotentialIO::data> dataVec;
155 dataVec.reserve(numofprimitives);
157 for (
const auto& contrib : potential.gaussians) {
164 d.
x = potential.center_[0];
165 d.
y = potential.center_[1];
166 d.
z = potential.center_[2];
167 dataVec.push_back(d);
171 table.
write(dataVec);
180 std::vector<PotentialIO::data> dataVec(table.
numRows());
182 Index atomindex = -1;
184 if (d.atomid > atomindex) {
185 Eigen::Vector3d pos(d.x, d.y, d.z);
188 atomindex = d.atomid;
191 aopotentials_.back().addPrimitive(
int(d.power) + 2,
int(d.l), d.decay,
196std::ostream&
operator<<(std::ostream& out,
const libecpint::ECP& potential) {
197 out <<
" AtomId: " << potential.atom_id <<
" Components: " << potential.getN()
199 for (
const auto& gaussian : potential.gaussians) {
200 out <<
" L: " << gaussian.l;
201 out <<
" Gaussian Decay: " << gaussian.a;
202 out <<
" Power: " << gaussian.n;
203 out <<
" Contractions: " << gaussian.d <<
"\n";
210 out <<
"Name:" << ecp.
Name() <<
"\n";
212 for (
const auto& potential : ecp) {
const Eigen::Vector3d & getPos() const
CptTable openTable(const std::string &name)
CptTable openTable(const std::string &name, std::size_t nRows, bool compact=false)
void write(void *buffer, const std::size_t &startIdx, const std::size_t &endIdx)
void read(void *buffer, const std::size_t &startIdx, const std::size_t &endIdx)
void addCol(const std::string &name, const size_t &offset)
Container to hold ECPs for all atoms.
void ReadFromCpt(CheckpointReader &r)
std::vector< libecpint::ECP > aopotentials_
const std::string & Name() const
void UpdatePotentialPositions(const QMMolecule &mol)
std::vector< std::string > Fill(const ECPBasisSet &bs, QMMolecule &atoms)
void WriteToCpt(CheckpointWriter &w) const
std::vector< Index > ncore_perAtom_
void AddECPChargeToMolecule(QMMolecule &mol) const
void add(const ECPAOBasis &other)
const std::string & Name() const
const ECPElement & getElement(std::string element_type) const
static void SetupCptTable(CptTable &table)
base class for all analysis tools