Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Dec 20, 2023
1 parent 5a937e5 commit f6179ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/script_interface/system/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct System::Leaves {
Leaves() = default;
std::shared_ptr<CellSystem::CellSystem> cell_system;
std::shared_ptr<Integrators::IntegratorHandle> integrator;
std::shared_ptr<Thermostats::Thermostats> thermostats;
std::shared_ptr<Analysis::Analysis> analysis;
std::shared_ptr<Galilei::ComFixed> comfixed;
std::shared_ptr<Galilei::Galilei> galilei;
Expand All @@ -84,7 +85,6 @@ struct System::Leaves {
#ifdef DIPOLES
std::shared_ptr<Dipoles::Container> magnetostatics;
#endif
std::shared_ptr<Thermostats::Thermostats> thermostats;
};

System::System() : m_instance{}, m_leaves{std::make_shared<Leaves>()} {
Expand Down
8 changes: 8 additions & 0 deletions src/script_interface/thermostat/thermostats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ std::shared_ptr<T> make_new_thermostat(char const* so_name, VariantMap const &pa
}

public:
Thermostats() {
add_parameters({
{"langevin",
AutoParameter::read_only,
[this]() { return langevin? Variant{langevin} : Variant{None{}}; }},
});
}

Variant do_call_method(std::string const &name,
VariantMap const &params) override {
if (name == "set_brownian") {
Expand Down
2 changes: 2 additions & 0 deletions testsuite/python/propagation_langevin.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ def test_07__virtual(self):

system.thermostat.set_langevin(
kT=0, gamma=1, gamma_rotation=1., seed=41)
print(system.thermostat)
print(system.thermostats.langevin.get_params())

system.integrator.run(0)

Expand Down

0 comments on commit f6179ec

Please sign in to comment.