SPH
SimulationJobs.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "run/Job.h"
4 
6 
7 class SphJob : public IRunJob, public SharedToken {
8 protected:
10  bool isResumed = false;
11 
12 public:
13  explicit SphJob(const std::string& name, const RunSettings& overrides = EMPTY_SETTINGS);
14 
15  static RunSettings getDefaultSettings(const std::string& name);
16 
17  virtual std::string className() const override {
18  return "SPH run";
19  }
20 
22  return { { "particles", JobType::PARTICLES }, { "boundary", JobType::GEOMETRY } };
23  }
24 
26  requires() const override {
29  map.insert("boundary", JobType::GEOMETRY);
30  }
31  return map;
32  }
33 
34  virtual VirtualSettings getSettings() override;
35 
36  virtual AutoPtr<IRun> getRun(const RunSettings& overrides) const override;
37 };
38 
39 class SphStabilizationJob : public SphJob {
40 public:
41  using SphJob::SphJob;
42 
43  virtual std::string className() const override {
44  return "SPH stabilization";
45  }
46 
47  virtual VirtualSettings getSettings() override;
48 
49  virtual AutoPtr<IRun> getRun(const RunSettings& overrides) const override;
50 };
51 
52 class NBodyJob : public IRunJob, public SharedToken {
53 private:
54  RunSettings settings;
55  bool useSoft = false;
56  bool isResumed = false;
57 
58 public:
59  explicit NBodyJob(const std::string& name, const RunSettings& overrides = EMPTY_SETTINGS);
60 
61  static RunSettings getDefaultSettings(const std::string& name);
62 
63  virtual std::string className() const override {
64  return "N-body run";
65  }
66 
68  return { { "particles", JobType::PARTICLES } };
69  }
70 
71  virtual VirtualSettings getSettings() override;
72 
73  virtual AutoPtr<IRun> getRun(const RunSettings& overrides) const override;
74 };
75 
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
@ GEOMETRY
Job providing geometry.
@ PARTICLES
Job providing particles.
#define NAMESPACE_SPH_END
Definition: Object.h:12
Wrapper of pointer that deletes the resource from destructor.
Definition: AutoPtr.h:15
Base class for jobs running a simulation.
Definition: Job.h:266
static RunSettings getDefaultSettings(const std::string &name)
virtual std::string className() const override
Name representing the type of the job (e.e. "SPH").
virtual UnorderedMap< std::string, ExtJobType > getSlots() const override
Lists all potential inputs of the job.
virtual AutoPtr< IRun > getRun(const RunSettings &overrides) const override
Returns the actual simulation object.
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
NBodyJob(const std::string &name, const RunSettings &overrides=EMPTY_SETTINGS)
TValue get(const TEnum idx, std::enable_if_t<!std::is_enum< std::decay_t< TValue >>::value, int >=0) const
Returns a value of given type from the settings.
Definition: Settings.h:326
virtual AutoPtr< IRun > getRun(const RunSettings &overrides) const override
Returns the actual simulation object.
bool isResumed
RunSettings settings
Definition: SimulationJobs.h:9
virtual UnorderedMap< std::string, ExtJobType > getSlots() const override
Lists all potential inputs of the job.
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
virtual UnorderedMap< std::string, ExtJobType > requires() const override
List of slots that need to be connected to evaluate the job.
static RunSettings getDefaultSettings(const std::string &name)
virtual std::string className() const override
Name representing the type of the job (e.e. "SPH").
SphJob(const std::string &name, const RunSettings &overrides=EMPTY_SETTINGS)
virtual std::string className() const override
Name representing the type of the job (e.e. "SPH").
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
virtual AutoPtr< IRun > getRun(const RunSettings &overrides) const override
Returns the actual simulation object.
Holds a map of virtual entries, associated with a unique name.
const EmptySettingsTag EMPTY_SETTINGS
Definition: Settings.h:32
BoundaryEnum
Definition: Settings.h:604
@ NONE
Do not use any boundary conditions (= vacuum conditions)
@ DOMAIN_BOUNDARY
Type of boundary conditions.