SPH
MaterialJobs.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "run/Job.h"
4 
6 
8 protected:
10 
11 public:
12  explicit MaterialProvider(const BodySettings& overrides = EMPTY_SETTINGS);
13 
14 protected:
15  void addMaterialEntries(VirtualSettings::Category& category, Function<bool()> enabler);
16 };
17 
18 class MaterialJob : public IMaterialJob, public MaterialProvider {
19 public:
20  MaterialJob(const std::string& name, const BodySettings& overrides = EMPTY_SETTINGS);
21 
22  virtual std::string className() const override {
23  return "material";
24  }
25 
27  return {};
28  }
29 
30  virtual VirtualSettings getSettings() override;
31 
32  virtual void evaluate(const RunSettings& global, IRunCallbacks& UNUSED(callbacks)) override;
33 };
34 
36 public:
37  DisableDerivativeCriterionJob(const std::string& name)
38  : IMaterialJob(name) {}
39 
40  virtual std::string className() const override {
41  return "optimize timestepping";
42  }
43 
45  return { { "material", JobType::MATERIAL } };
46  }
47 
48  virtual VirtualSettings getSettings() override;
49 
50  virtual void evaluate(const RunSettings& global, IRunCallbacks& UNUSED(callbacks)) override;
51 };
52 
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
@ MATERIAL
Job providing a material.
#define UNUSED(x)
Definition: Object.h:37
#define NAMESPACE_SPH_END
Definition: Object.h:12
virtual UnorderedMap< std::string, ExtJobType > getSlots() const override
Lists all potential inputs of the job.
Definition: MaterialJobs.h:44
virtual std::string className() const override
Name representing the type of the job (e.e. "SPH").
Definition: MaterialJobs.h:40
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
DisableDerivativeCriterionJob(const std::string &name)
Definition: MaterialJobs.h:37
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
Base class for jobs providing a material.
Definition: Job.h:303
Callbacks executed by the simulation to provide feedback to the user.
Definition: IRun.h:27
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
MaterialJob(const std::string &name, const BodySettings &overrides=EMPTY_SETTINGS)
virtual std::string className() const override
Name representing the type of the job (e.e. "SPH").
Definition: MaterialJobs.h:22
virtual UnorderedMap< std::string, ExtJobType > getSlots() const override
Lists all potential inputs of the job.
Definition: MaterialJobs.h:26
void addMaterialEntries(VirtualSettings::Category &category, Function< bool()> enabler)
MaterialProvider(const BodySettings &overrides=EMPTY_SETTINGS)
BodySettings body
Definition: MaterialJobs.h:9
Holds a map of virtual entries, associated with a unique name.
const EmptySettingsTag EMPTY_SETTINGS
Definition: Settings.h:32