SPH
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
IJob Class Referenceabstract

Base class for all object performing an operation in a simulation hierarchy. More...

#include <Job.h>

Inheritance diagram for IJob:
Polymorphic ICameraJob IGeometryJob IMaterialJob INullJob IParticleJob FisheyeCameraJob OrthoCameraJob PerspectiveCameraJob BlockJob BooleanGeometryJob CylinderJob EllipsoidJob GaussianSphereJob HalfSpaceJob InvertGeometryJob MaclaurinSpheroidJob MeshGeometryJob ParticleGeometryJob SphereJob SpheresGeometryJob TransformGeometryJob DisableDerivativeCriterionJob MaterialJob AnimationJob VdbJob BatchJob CenterParticlesJob ChangeMaterialJob CollisionGeometrySetup CompareJob DifferentiatedBodyIc EmplaceComponentsAsFlagsJob EquilibriumIc ExtractComponentJob ExtractParticlesInDomainJob FileSequenceJob GalaxyIc IRunJob IsothermalSphereIc JoinParticlesJob LoadFileJob MergeComponentsJob ModifyQuantityIc MonolithicBodyIc MultiJoinParticlesJob NBodyIc NoiseQuantityIc OrbitParticlesJob PolytropicStarIc RemoveParticlesJob SaveFileJob SaveMeshJob SingleParticleIc SmoothedToSolidHandoff SubsampleJob TransformParticlesJob

Public Member Functions

 IJob (const std::string &name)
 
virtual std::string instanceName () const
 Unique name representing this job. More...
 
virtual std::string className () const =0
 Name representing the type of the job (e.e. "SPH"). More...
 
virtual UnorderedMap< std::string, ExtJobTyperequires () const
 List of slots that need to be connected to evaluate the job. More...
 
virtual UnorderedMap< std::string, ExtJobTypegetSlots () const =0
 Lists all potential inputs of the job. More...
 
virtual Optional< ExtJobTypeprovides () const =0
 Specifies the type of the job, i.e. what kind of data the job provides. More...
 
virtual VirtualSettings getSettings ()=0
 Returns a settings object which allows to query and modify the state of the job. More...
 
virtual void evaluate (const RunSettings &global, IRunCallbacks &callbacks)=0
 Runs the operation provided by the job. More...
 
virtual JobContext getResult () const =0
 Returns the result of the job. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Protected Member Functions

template<typename T >
SharedPtr< T > getInput (const std::string &name) const
 Convenient function to return input data for slot of given name. More...
 

Protected Attributes

std::string instName
 
UnorderedMap< std::string, JobContextinputs
 Contains all input data, identified by names of input slots. More...
 

Friends

class JobNode
 

Detailed Description

Base class for all object performing an operation in a simulation hierarchy.

There are currently three type of jobs: particle jobs, derived from class IParticleJob, represent all simulations, initial conditions, particle hand-offs and other particle transforms, etc. IGeometryJob provides generic geometric shapes, which can be used to define bodies, specify boundary conditions etc. Finally IMaterialJob provides material of bodies.

Each job defines a number of inputs, which are provided by other jobs. This number does not have to be fixed, it may depend on internal state of the job. The inputs should not be assigned by the jobs itself, this is provided by class JobNode, which connects the jobs in the job hierarchy.

Definition at line 96 of file Job.h.

Constructor & Destructor Documentation

◆ IJob()

IJob::IJob ( const std::string &  name)
inlineexplicit

Definition at line 106 of file Job.h.

Member Function Documentation

◆ className()

virtual std::string IJob::className ( ) const
pure virtual

◆ evaluate()

virtual void IJob::evaluate ( const RunSettings global,
IRunCallbacks callbacks 
)
pure virtual

Runs the operation provided by the job.

Function may be called only after required inputs are assigned; this is provided by class JobNode, the job should not be used directly.

Parameters
globalGlobal settings, shared by all jobs. Contains parameters like number of threads, etc.
callbacksInterface allowing to get notified about current progress of the job.
Exceptions
InvalidSetupif required input is missing or job encountered a problem in initialization.

Implemented in IRunJob, ICameraJob, EmplaceComponentsAsFlagsJob, ExtractParticlesInDomainJob, MergeComponentsJob, RemoveParticlesJob, ExtractComponentJob, ChangeMaterialJob, CenterParticlesJob, TransformParticlesJob, MultiJoinParticlesJob, OrbitParticlesJob, JoinParticlesJob, SaveFileJob, FileSequenceJob, LoadFileJob, BooleanGeometryJob, TransformGeometryJob, InvertGeometryJob, SpheresGeometryJob, ParticleGeometryJob, MeshGeometryJob, and SphereJob.

◆ getInput()

template<typename T >
SharedPtr< T > IJob::getInput ( const std::string &  name) const
protected

Convenient function to return input data for slot of given name.

Definition at line 45 of file Job.inl.h.

◆ getResult()

virtual JobContext IJob::getResult ( ) const
pure virtual

Returns the result of the job.

This can only be called after the job is evaluated. The result is cached by the job, so the function getResult can be called multiple times once the job finishes.

Implemented in ICameraJob, INullJob, IMaterialJob, IGeometryJob, and IParticleJob.

◆ getSettings()

virtual VirtualSettings IJob::getSettings ( )
pure virtual

◆ getSlots()

virtual UnorderedMap<std::string, ExtJobType> IJob::getSlots ( ) const
pure virtual

◆ instanceName()

virtual std::string IJob::instanceName ( ) const
inlinevirtual

Unique name representing this job.

Reimplemented in SaveFileJob, and LoadFileJob.

Definition at line 110 of file Job.h.

◆ provides()

virtual Optional<ExtJobType> IJob::provides ( ) const
pure virtual

Specifies the type of the job, i.e. what kind of data the job provides.

May be NOTHING for jobs like "save file", etc.

Implemented in ICameraJob, INullJob, IMaterialJob, IGeometryJob, and IParticleJob.

◆ requires()

virtual UnorderedMap<std::string, ExtJobType> IJob::requires ( ) const
inlinevirtual

List of slots that need to be connected to evaluate the job.

The returned map shall contain names of the slots and their types. No two slots can have the same name. This list can can be changed, based on internal state of the job.

Reimplemented in VdbJob, AnimationJob, SphJob, ChangeMaterialJob, ImpactorIc, and MonolithicBodyIc.

Definition at line 122 of file Job.h.

Friends And Related Function Documentation

◆ JobNode

friend class JobNode
friend

Definition at line 97 of file Job.h.

Member Data Documentation

◆ inputs

UnorderedMap<std::string, JobContext> IJob::inputs
protected

Contains all input data, identified by names of input slots.

Definition at line 103 of file Job.h.

◆ instName

std::string IJob::instName
protected

Definition at line 100 of file Job.h.


The documentation for this class was generated from the following files: