33 std::function<double(Geometry::DistanceFunction)>
energyFunc =
nullptr;
36 std::pair<int, Point>;
41 virtual void from_json(
const json&) = 0;
42 virtual void to_json(
json&)
const = 0;
43 [[nodiscard]]
virtual int numindex()
const = 0;
44 [[nodiscard]]
virtual Variant
type()
const = 0;
45 [[nodiscard]]
virtual std::shared_ptr<BondData>
53 explicit BondData(
const std::vector<int>& indices);
58 {{BondData::Variant::INVALID,
nullptr},
59 {BondData::Variant::HARMONIC,
"harmonic"},
60 {BondData::Variant::FENE,
"fene"},
61 {BondData::Variant::FENEWCA,
"fene+wca"},
62 {BondData::Variant::HARMONIC_TORSION,
"harmonic_torsion"},
63 {BondData::Variant::GROMOS_TORSION,
"gromos_torsion"},
64 {BondData::Variant::PERIODIC_DIHEDRAL,
"periodic_dihedral"},
65 {BondData::Variant::HARMONIC_DIHEDRAL,
"harmonic_dihedral"}})
69 [[nodiscard]]
int numindex()
const override;
70 StretchData() =
default;
71 explicit StretchData(
const std::vector<int>&
indices);
76 [[nodiscard]]
int numindex()
const override;
88 double half_force_constant = 0.0;
89 double equilibrium_distance = 0.0;
90 [[nodiscard]] Variant
type()
const override;
91 [[nodiscard]] std::shared_ptr<BondData>
clone()
const override;
92 void from_json(
const json& j)
override;
93 void to_json(
json& j)
const override;
107 double half_force_constant = 0.0;
108 double max_squared_distance = 0.0;
109 [[nodiscard]] Variant
type()
const override;
110 [[nodiscard]] std::shared_ptr<BondData>
clone()
const override;
111 void from_json(
const json& j)
override;
112 void to_json(
json& j)
const override;
123 double half_force_constant = 0.0;
124 double max_distance_squared = 0.0;
125 double epsilon = 0.0;
126 double sigma_squared = 0.0;
127 std::array<double, 4> k = {{0.0, 0.0, 0.0, 0.0}};
128 [[nodiscard]] Variant
type()
const override;
129 [[nodiscard]] std::shared_ptr<BondData>
clone()
const override;
130 void from_json(
const json& j)
override;
131 void to_json(
json& j)
const override;
134 FENEWCABond(
double k,
double rmax,
double epsilon,
double sigma,
135 const std::vector<int>&
indices);
145 double half_force_constant = 0.0;
146 double equilibrium_angle = 0.0;
147 [[nodiscard]] std::shared_ptr<BondData>
clone()
const override;
148 void from_json(
const json& j)
override;
149 void to_json(
json& j)
const override;
150 [[nodiscard]] Variant
type()
const override;
163 double half_force_constant = 0.0;
164 double cosine_equilibrium_angle = 0.0;
165 [[nodiscard]] std::shared_ptr<BondData>
clone()
const override;
166 void from_json(
const json& j)
override;
167 void to_json(
json& j)
const override;
168 [[nodiscard]] Variant
type()
const override;
181 double force_constant = 0.0;
182 double phase_angle = 0.0;
183 double periodicity = 1.0;
184 [[nodiscard]]
int numindex()
const override;
185 [[nodiscard]] std::shared_ptr<BondData>
clone()
const override;
186 void from_json(
const json& j)
override;
187 void to_json(
json& j)
const override;
188 [[nodiscard]] Variant
type()
const override;
201 double half_force_constant = 0.0;
202 double equilibrium_dihedral = 0.0;
203 [[nodiscard]]
int numindex()
const override;
204 [[nodiscard]] std::shared_ptr<BondData>
clone()
const override;
205 void from_json(
const json& j)
override;
206 void to_json(
json& j)
const override;
207 [[nodiscard]] Variant
type()
const override;
213 void from_json(
const json& j, std::shared_ptr<BondData>& bond);
214 void to_json(
json& j,
const std::shared_ptr<const BondData>& bond);
nlohmann::json json
JSON object.
Definition: json_support.h:10
bool hasEnergyFunction() const
test if energy function has been set
Definition: bonds.cpp:77
Gromos torsion.
Definition: bonds.h:161
void shiftIndices(int offset)
Add offset to particle indices.
Definition: bonds.cpp:70
std::function< Point(const Point &, const Point &)> DistanceFunction
Function to calculate the (minimum) distance between two points.
Definition: core.h:32
std::vector< int > indices
Absolute indiced of participating particles.
Definition: bonds.h:30
Periodic dihedral.
Definition: bonds.h:179
Harmonic Bond.
Definition: bonds.h:86
virtual Variant type() const =0
Returns bond type (sett Variant enum)
FENE+WCA bond.
Definition: bonds.h:121
std::vector< Particle > ParticleVector
Storage type for collections of particles.
Definition: particle.h:253
Base class for bonded potentials.
Definition: bonds.h:17
FENE bond.
Definition: bonds.h:105
Finite Extensible Nonlinear Elastic (FENE) potential.
Definition: potentials.h:551
std::function< double(Geometry::DistanceFunction)> energyFunc
Calculates potential energy of bonded atoms(kT)
Definition: bonds.h:33
std::pair< int, Point > IndexAndForce
Force (second) on particle w. absolute index (first)
Definition: bonds.h:36
bool hasForceFunction() const
test if force function has been set
Definition: bonds.cpp:82
virtual int numindex() const =0
Required number of atom indices for bond.
Namespace for particle pair-potentials.
Definition: analysis.h:18
Harmonic torsion.
Definition: bonds.h:143
virtual void setEnergyFunction(const ParticleVector &particles)=0
Set energy function; store particles ref.
NLOHMANN_JSON_SERIALIZE_ENUM(SpheroCylinderData::PatchType, {{SpheroCylinderData::PatchType::Invalid, nullptr}, {SpheroCylinderData::PatchType::Full, "full"}, {SpheroCylinderData::PatchType::Capped, "capped"}, {SpheroCylinderData::PatchType::None, "none"}}) class AtomData
General properties for atoms.
Definition: atomdata.h:61
Harmonic dihedral.
Definition: bonds.h:199
virtual std::shared_ptr< BondData > clone() const =0
Make shared pointer copy of data.
std::function< std::vector< IndexAndForce >Geometry::DistanceFunction)> forceFunc
Calculates forces on bonded atoms (kT/Å)
Definition: bonds.h:39