15 [[nodiscard]]
bool canSwapAtoms(
const ReactionData& reaction)
const;
16 [[nodiscard]]
bool canReduceImplicitGroups(
const ReactionData& reaction)
const;
17 [[nodiscard]]
bool canReduceMolecularGroups(
const ReactionData& reaction)
const;
18 [[nodiscard]]
bool canProduceMolecularGroups(
const ReactionData& reaction)
const;
19 [[nodiscard]]
bool canReduceAtomicGroups(
const ReactionData& reaction)
const;
20 [[nodiscard]]
bool canProduceAtomicGroups(
const ReactionData& reaction)
const;
34 using OptionalInt = std::optional<int>;
35 virtual ChangeAndBias activate(
Group& group, OptionalInt num_particles = std::nullopt) = 0;
36 virtual ChangeAndBias deactivate(
Group& group, OptionalInt num_particles = std::nullopt) = 0;
73 const bool apply_bond_bias;
74 [[nodiscard]]
double getBondEnergy(
const Group& group)
const;
76 setPositionAndOrientation(
Group& group)
const;
80 ChangeAndBias activate(
Group& group, OptionalInt num_particles = std::nullopt)
override;
81 ChangeAndBias deactivate(
Group& group, OptionalInt num_particles = std::nullopt)
override;
96 void update(ReactionData::Direction direction,
bool accept);
99 std::map<reaction_iterator, AcceptanceData> acceptance;
102 AcceptanceData& operator[](reaction_iterator iter);
103 void to_json(
json& j)
const;
135 reaction_iterator reaction;
136 double bias_energy = 0.0;
139 std::unique_ptr<Speciation::GroupDeActivator>
140 molecular_group_bouncer;
141 std::unique_ptr<Speciation::GroupDeActivator>
142 atomic_group_bouncer;
144 std::map<MoleculeData::index_type, Average<double>>
145 average_reservoir_size;
147 void _to_json(
json& j)
const override;
148 void _from_json(
const json& j)
override;
149 void _move(
Change& change)
override;
150 void _accept(
Change& change)
override;
151 void _reject(
Change& change)
override;
153 void setRandomReactionAndDirection();
154 void atomicSwap(
Change& change);
155 void deactivateReactants(
Change& change);
156 void activateProducts(
Change& change);
157 void deactivateAtomicGroups(
Change& change);
158 void activateAtomicGroups(
Change& change);
159 void deactivateMolecularGroups(
Change& change);
160 void activateMolecularGroups(
Change& change);
162 updateGroupMassCenters(
const Change& change)
const;
167 double bias(
Change& change,
double old_energy,
double new_energy)
override;
168 static void swapParticleProperties(
Particle& particle,
int new_atomid);
nlohmann::json json
JSON object.
Definition: json_support.h:10
Random random
global instance of Random
Definition: random.cpp:62
General properties of reactionsEnd of class.
Definition: molecule.h:420
Random number generator.
Definition: random.h:34
Base class for all moves (MC, Langevin, ...)
Definition: move.h:38
bool isPossible(const ReactionData &reaction) const
Enough reactants and product capacity?
Definition: speciation.cpp:59
Definition: chainmove.cpp:6
Helper class to check if a reaction is possible, i.e.
Definition: speciation.h:11
Particle class for storing positions, id, and other properties.
Definition: particle.h:220
Generalised Grand Canonical Monte Carlo Move.
Definition: speciation.h:130
End of Group class.
Definition: group.h:177
Specify changes made to a system.
Definition: space.h:29
std::pair< Change::GroupChange, double > ChangeAndBias
Group change and bias energy.
Definition: speciation.h:33
Helper base class for (de)activating groups in speciation move.
Definition: speciation.h:30
Helper class for contracting and expanding atomic groups.
Definition: speciation.h:43
Placeholder for atoms and molecules.
Definition: space.h:92
Helper class to (de)activate a single molecular group.
Definition: speciation.h:68
std::vector< ReactionData > reactions
List of reactions.
Definition: molecule.cpp:23
Helper class to keep track of acceptance in left or right direction.
Definition: speciation.h:87