5 #include "aux/timers.h" 6 #include "aux/equidistant_table.h" 24 enum class MonteCarloState
30 MonteCarloState state = MonteCarloState::NONE;
59 bool act_on_mass_center =
false;
60 std::set<int> molecule_ids;
61 std::vector<std::string> molecule_names;
62 double groupEnergy(
const Group& group)
const;
92 std::unique_ptr<ExprFunction<double>> expr;
96 double charge = 0, x = 0, y = 0, z = 0;
99 ParticleData particle_data;
100 json json_input_backup;
123 std::string filename;
124 bool fixed_potential =
false;
125 unsigned int nstep = 0;
126 unsigned int phi_update_interval = 0;
127 unsigned int num_rho_updates = 0;
128 unsigned int num_density_updates = 0;
129 double dielectric_constant;
131 double bjerrum_length;
132 double half_box_length_z;
137 static double evalPotential(
double z,
double a);
138 void updateChargeDensity();
139 void updatePotential();
140 void saveChargeDensity();
141 void loadChargeDensity();
169 Point origo = {0.0, 0.0, 0.0};
170 Point dir = {1.0, 1.0, 1.0};
174 double spring_constant = 0.0;
176 std::map<std::string, Variant> m = {
177 {
"sphere", sphere}, {
"cylinder", cylinder}, {
"cuboid", cuboid}};
nlohmann::json json
JSON object.
Definition: json_support.h:10
Eigen::Vector3d Point
3D vector used for positions, velocities, forces etc.
Definition: coordinates.h:7
virtual void init()
reset and initialize
Definition: externalpotential.cpp:28
std::vector< Point > PointVector
Vector of 3D vectors.
Definition: core.h:24
Geometry class for spheres, cylinders, cuboids, hexagonal prism, truncated octahedron, slits.
Definition: geometry.h:342
std::string citation_information
Possible reference; may be left empty.
Definition: externalpotential.h:32
std::string name
Meaningful name.
Definition: externalpotential.h:31
Base class for external potentials.
Definition: externalpotential.h:56
Used to add self energies to atoms from i.e.
Definition: externalpotential.h:194
virtual double energy(const Change &change)=0
energy due to change
std::function< double(const Particle &)> createGouyChapmanPotential(const json &j, const Geometry::Chameleon &)
Returns a functor for a Gouy-Chapman electric potential.
Definition: externalpotential.h:83
virtual void force(PointVector &forces)
update forces on all particles
Definition: externalpotential.cpp:30
virtual void sync(EnergyTerm *other_energy, const Change &change)
Sync (copy from) another energy instance.
Definition: externalpotential.cpp:23
std::function< double(const Particle &)> externalPotentialFunc
energy of single particle
Definition: externalpotential.h:65
Custom external potential on molecules.
Definition: externalpotential.h:89
Particle class for storing positions, id, and other properties.
Definition: particle.h:220
TimeRelativeOfTotal< std::chrono::microseconds > timer
Timer for measuring speed.
Definition: externalpotential.h:33
virtual void updateState(const Change &change)
Update internal state to reflect change in e.g. Space.
Definition: externalpotential.cpp:37
Since parser<T> is non-copyable we instantiate it with a shared pointer, allowing ExprFunction to be ...
Definition: externalpotential.h:9
Cell list class templates.
Definition: actions.cpp:11
End of Group class.
Definition: group.h:177
All energies inherit from this class.
Definition: externalpotential.h:21
Specify changes made to a system.
Definition: space.h:29
Mean field electric potential from outside rectangular simulation box.
Definition: externalpotential.h:120
const Space & space
reference to simulation space
Definition: externalpotential.h:64
Placeholder for atoms and molecules.
Definition: space.h:92
Confines molecules inside geometric shapes Confine particles to a sub-region of the simulation contai...
Definition: externalpotential.h:155
virtual void to_json(json &j) const
json output
Definition: externalpotential.cpp:17