STORMM Source Documentation
Loading...
Searching...
No Matches
combograph_ljmodel.h
1// -*-c++-*-
2#ifndef STORMM_COMBOGRAPH_LJMODEL_H
3#define STORMM_COMBOGRAPH_LJMODEL_H
4
5#include <string>
6#include <vector>
7#include "copyright.h"
8#include "DataTypes/stormm_vector_types.h"
9#include "Parsing/parse.h"
10#include "Potential/energy_enumerators.h"
11#include "Synthesis/atomgraph_synthesis.h"
12#include "atomgraph.h"
13#include "atomgraph_abstracts.h"
14#include "atomgraph_analysis.h"
15#include "lennard_jones_analysis.h"
16
17namespace stormm {
18namespace topology {
19
20using energy::getEnumerationName;
21using data_types::operator==;
22using synthesis::AtomGraphSynthesis;
23using topology::AtomGraph;
24
31public:
32
39 // interactions
41 ComboGraphLJModel(const AtomGraph *primary_ag_in, const AtomGraph *ag_secondary_in = nullptr,
42 VdwCombiningRule default_rule_in = VdwCombiningRule::LORENTZ_BERTHELOT,
43 const std::vector<PairLJInteraction> &edits = {});
44
45 ComboGraphLJModel(const AtomGraph &primary_ag_in, const AtomGraph &ag_secondary_in,
46 VdwCombiningRule default_rule_in = VdwCombiningRule::LORENTZ_BERTHELOT,
47 const std::vector<PairLJInteraction> &edits = {});
48
49 ComboGraphLJModel(const AtomGraph &primary_ag_in, const AtomGraphSynthesis &poly_ag_secondary,
50 VdwCombiningRule default_rule_in = VdwCombiningRule::LORENTZ_BERTHELOT,
51 const std::vector<PairLJInteraction> &edits = {});
52
53 ComboGraphLJModel(const AtomGraph *primary_ag_in, const std::vector<double> &lj_a_in,
54 const std::vector<double> &lj_b_in,
55 const std::vector<char4> &lj_type_names = {},
56 VdwCombiningRule default_rule_in = VdwCombiningRule::LORENTZ_BERTHELOT,
57 const std::vector<PairLJInteraction> &edits = {});
58
59 ComboGraphLJModel(const AtomGraph &primary_ag_in, const std::vector<double> &lj_a_in,
60 const std::vector<double> &lj_b_in,
61 const std::vector<char4> &lj_type_names = {},
62 VdwCombiningRule default_rule_in = VdwCombiningRule::LORENTZ_BERTHELOT,
63 const std::vector<PairLJInteraction> &edits = {});
65
67 int getSetCount() const;
68
70 VdwCombiningRule getDefaultCombiningRule() const;
71
73 VdwCombiningRule getPrimaryTopologyRule() const;
74
79 VdwCombiningRule getSecondaryTopologyRule(int index) const;
80
82
88 int2 getMatrixSize(int index) const;
89
96 const std::vector<double>& getACoefficients(int index) const;
97
104 const std::vector<double>& getBCoefficients(int index) const;
105
106 std::vector<int> computeConsensusParameters() const;
107
123 template <typename T>
124 void addCombination(const T* lja_in, const T* ljb_in, int lj_type_count,
125 const char4* lj_type_names = nullptr,
126 const std::vector<PairLJInteraction> &edits = {});
127
128 template <typename T>
129 void addCombination(const std::vector<T> &lja_in, const std::vector<T> &ljb_in,
130 const std::vector<char4> &lj_type_names = {},
131 const std::vector<PairLJInteraction> &edits = {});
132
133 void addCombination(const AtomGraph *ag_secondary,
134 const std::vector<PairLJInteraction> &edits = {});
135
136 void addCombination(const AtomGraph &ag_secondary,
137 const std::vector<PairLJInteraction> &edits = {});
139
144
147
148private:
149
152 int set_count;
153
155 VdwCombiningRule default_rule;
156
159 VdwCombiningRule primary_topology_rule;
160
162 int primary_atom_type_count;
163
165 std::vector<int> secondary_atom_type_counts;
166
169 std::vector<VdwCombiningRule> secondary_topology_rules;
170
172 std::vector<VdwCombiningRule> set_rules;
173
177 std::vector<std::vector<double>> set_lja;
178
180 std::vector<std::vector<double>> set_ljb;
181
184 std::vector<std::vector<PairLJInteraction>> set_edits;
185
188 AtomGraph *primary_ag_pointer;
189
192 std::vector<AtomGraph*> secondary_ag_pointers;
193
197 void validateSetIndex(int index) const;
198};
199
200} // namespace topology
201} // namespace stormm
202
203#include "combograph_ljmodel.tpp"
204
205#endif
ComboGraphLJModel(const AtomGraph *primary_ag_in, const AtomGraph *ag_secondary_in=nullptr, VdwCombiningRule default_rule_in=VdwCombiningRule::LORENTZ_BERTHELOT, const std::vector< PairLJInteraction > &edits={})
The constructor accepts two topologies or two Lennard-Jones parameter sets. Edits to the Lennard-Jone...
Definition combograph_ljmodel.cpp:10
A collection of one or more AtomGraph objects, with similar components arranged in contiguous arrays ...
Definition atomgraph_synthesis.h:55
A struct to hold information relating to an Amber topology. This struct's member functions are limite...
Definition atomgraph.h:50
int2 getMatrixSize(int index) const
Get the number of atom types in the primary topology.
Definition combograph_ljmodel.cpp:122
const std::vector< double > & getBCoefficients(int index) const
Get the matrix of Lennard-Jones B coefficients between the primary topology and another topology....
Definition combograph_ljmodel.cpp:134
int getAtomTypeUnionSize()
Compute the number of unique atom types across all topologies other than the primary....
int getSetCount() const
Get the number of Lennard-Jones parameter matrix sets.
Definition combograph_ljmodel.cpp:101
void addCombination(const T *lja_in, const T *ljb_in, int lj_type_count, const char4 *lj_type_names=nullptr, const std::vector< PairLJInteraction > &edits={})
Add an interaction matrix to the list of combinations.
VdwCombiningRule getPrimaryTopologyRule() const
Get the combining rule effective in the primary topology.
Definition combograph_ljmodel.cpp:111
const std::vector< double > & getACoefficients(int index) const
Get the matrix of Lennard-Jones A coefficients between the primary topology and another topology....
Definition combograph_ljmodel.cpp:128
ComboGraphLJModel(const AtomGraph *primary_ag_in, const AtomGraph *ag_secondary_in=nullptr, VdwCombiningRule default_rule_in=VdwCombiningRule::LORENTZ_BERTHELOT, const std::vector< PairLJInteraction > &edits={})
The constructor accepts two topologies or two Lennard-Jones parameter sets. Edits to the Lennard-Jone...
Definition combograph_ljmodel.cpp:10
VdwCombiningRule getDefaultCombiningRule() const
Get the default combining rule for mixing parameters of different topologies.
Definition combograph_ljmodel.cpp:106
VdwCombiningRule getSecondaryTopologyRule(int index) const
Get the combining rule effective in one of the secondary topologies.
Definition combograph_ljmodel.cpp:116
Definition stormm_vector_types.h:141
Definition stormm_vector_types.h:22