votca 2026-dev
Loading...
Searching...
No Matches
fragmentsaturator.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2026 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_FRAGMENTSATURATOR_H
22#define VOTCA_XTP_FRAGMENTSATURATOR_H
23
24// Local VOTCA includes
25#include "qmmolecule.h"
26
27namespace votca {
28namespace xtp {
29
44 public:
45 // Generic C-H bond length [Angstrom], independent of hybridization.
46 // Only the starting point for RelaxNewAtoms.
47 static constexpr double kDefaultCHBondLengthAngstrom = 1.09;
48
49 // new_atom_parent_ids has size mol.size() and is indexed by atom id:
50 // -1 for original atoms, and for each added H the id of the original
51 // atom it saturates. Callers use it to assign added H atoms to the
52 // fragment of their parent (e.g. IPodCoupling::EvalJob); the saturator
53 // itself has no notion of fragments.
56 std::vector<Index> new_atom_parent_ids;
57 };
58
59 // Returns a copy of mol with one H atom appended for every atom with
60 // hasExternalBond(), placed at bond_length_angstrom along its external
61 // bond direction. Original atoms keep their indices, so atom indices
62 // computed before saturation remain valid.
64 const QMMolecule& mol,
65 double bond_length_angstrom = kDefaultCHBondLengthAngstrom);
66 // Returns a copy of mol after a constrained MMFF94 relaxation (UFF if
67 // MMFF94 setup fails): atoms with index < n_original_atoms are fixed,
68 // the appended H atoms move. Requires the bond connectivity
69 // (QMAtom::getBondedPartnerIds()), from which OpenBabel's
70 // PerceiveBondOrders() derives bond orders.
71 //
72 // n_steps is the maximum number of conjugate-gradient steps; the
73 // relaxation stops earlier once the energy has converged.
74 static QMMolecule RelaxNewAtoms(const QMMolecule& mol, Index n_original_atoms,
75 Index n_steps = 500);
76};
77
78} // namespace xtp
79} // namespace votca
80
81#endif // VOTCA_XTP_FRAGMENTSATURATOR_H
Saturates the external bonds of a mapped QMMolecule (bonds that exist at the MD level but cross the s...
static QMMolecule RelaxNewAtoms(const QMMolecule &mol, Index n_original_atoms, Index n_steps=500)
static constexpr double kDefaultCHBondLengthAngstrom
static SaturationResult SaturateExternalBonds(const QMMolecule &mol, double bond_length_angstrom=kDefaultCHBondLengthAngstrom)
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26