15 clonedData->
overrides = particleData->overrides;
16 clonedData->
stats = particleData->stats;
31 return sRegisteredJobs;
35 for (
auto& desc : sRegisteredJobs) {
36 if (desc->className() == name) {
45 cat.
connect(
"Name",
"name", instanceName);
50 std::string shortName,
53 std::string tooltip) {
55 class GenericDesc :
public IJobDesc {
58 std::string shortName;
64 GenericDesc(std::string longName,
65 std::string shortName,
69 : longName(std::move(longName))
70 , shortName(std::move(shortName))
72 , desc(std::move(desc))
75 virtual std::string className()
const override {
79 virtual std::string category()
const override {
83 virtual std::string tooltip()
const override {
94 sRegisteredJobs.emplaceBack(makeAuto<GenericDesc>(className, shortName, category, func, tooltip));
102 :
JobRegistrar(className, className, category, func,
std::move(tooltip)) {}
116 const std::string& jobName) {
117 for (
const auto& element : inputs) {
119 if (data !=
nullptr) {
123 throw InvalidSetup(
"No input particles found for job '" + jobName +
"'");
Helper functions to check the internal consistency of the code.
@ NO_THROW
Function cannot throw exceptions.
#define CHECK_FUNCTION(flags)
Container storing sorted unique values.
Basic interface defining a single run.
ArrayView< const AutoPtr< IJobDesc > > enumerateRegisteredJobs()
Returns a view of all currently registered jobs.
VirtualSettings::Category & addGenericCategory(VirtualSettings &connector, std::string &instanceName)
Adds a common settings category, used by all jobs.
RawPtr< IJobDesc > getJobDesc(const std::string &name)
Returns a job descriptor for given class name.
Domain represented by triangular mesh.
#define NAMESPACE_SPH_END
Holder of quantity values and their temporal derivatives.
Object providing safe access to continuous memory of data.
Generic dynamically allocated resizable storage.
Provides a descriptor of a job that allows to create new instances.
Base class for all object performing an operation in a simulation hierarchy.
UnorderedMap< std::string, JobContext > inputs
Contains all input data, identified by names of input slots.
Base class for all jobs providing particle data.
SharedPtr< ParticleData > result
Data filled by the job when it finishes.
IParticleJob(const std::string &name)
Callbacks executed by the simulation to provide feedback to the user.
IRunJob(const std::string &name)
virtual AutoPtr< IRun > getRun(const RunSettings &overrides) const =0
Returns the actual simulation object.
virtual void evaluate(const RunSettings &global, IRunCallbacks &callbacks) override final
Runs the operation provided by the job.
Thrown when components of the run are mutually incompatible.
JobContext clone() const
Duplicates the stored data.
void release()
Releases all allocated data.
INLINE Type valueOr(const TOther &other) const
Returns the stored value if the object has been initialized, otherwise returns provided parameter.
Non-owning wrapper of pointer.
void addEntries(const Settings &settings)
Adds entries from different Settings object into this one, overriding current entries.
Storage clone(const Flags< VisitorEnum > buffers) const
Clones specified buffers of the storage.
EntryControl & connect(const std::string &name, const std::string &key, TValue &value)
Connects to given reference.
Holds a map of virtual entries, associated with a unique name.
Category & addCategory(const std::string &name)
Creates a new category of entries.
Overload of std::swap for Sph::Array.
Helper class, allowing to register job into the global list of jobs.
JobRegistrar(std::string className, std::string category, CreateJobFunc func, std::string tooltip)
Registers a new job.
Storage storage
Holds all particle positions and other quantities.
Statistics stats
Final statistics of the simulation.
RunSettings overrides
Overrides associated with the particle state.