SPH
AggregateSolver.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "gravity/NBodySolver.h"
5 
7 
8 class AggregateHolder;
9 
14 public:
18  virtual Size count() const = 0;
19 };
20 
21 enum class AggregateEnum {
22  PARTICLES,
23  MATERIALS,
24  FLAGS,
25 };
26 
27 static RegisterEnum<AggregateEnum> sAggregate({
28  { AggregateEnum::PARTICLES, "particles", "Aggregate is created for each particles" },
29  { AggregateEnum::MATERIALS, "materials", "" },
30  { AggregateEnum::FLAGS, "flags", "" },
31 });
32 
34 private:
39 
40 public:
41  AggregateSolver(IScheduler& scheduler, const RunSettings& settings);
42 
44 
45  void createAggregateData(Storage& storage, const AggregateEnum source);
46 
47  virtual void integrate(Storage& storage, Statistics& stats) override;
48 
49  virtual void collide(Storage& storage, Statistics& stats, const Float dt) override;
50 
51  virtual void create(Storage& storage, IMaterial& material) const override;
52 };
53 
54 
AggregateEnum
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
Helper object for converting enums to string, listing all available values of enum,...
uint32_t Size
Integral type used to index arrays (by default).
Definition: Globals.h:16
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Definition: Globals.h:13
Solver performing N-body simulation.
#define NAMESPACE_SPH_END
Definition: Object.h:12
Holds a set of aggregates.
virtual void integrate(Storage &storage, Statistics &stats) override
Computes derivatives of all time-dependent quantities.
virtual void create(Storage &storage, IMaterial &material) const override
Initializes all quantities needed by the solver in the storage.
void createAggregateData(Storage &storage, const AggregateEnum source)
AggregateSolver(IScheduler &scheduler, const RunSettings &settings)
virtual void collide(Storage &storage, Statistics &stats, const Float dt) override
Checks and resolves particle collisions.
Solver computing gravitational interactions of hard-sphere particles.
Definition: NBodySolver.h:24
Holds aggregate data stored in the storage and used by the solver.
virtual Size count() const =0
Returns the number of aggregates in the storage.
Material settings and functions specific for one material.
Definition: IMaterial.h:110
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Definition: Scheduler.h:27
Base class for arbitrary data stored in the storage alongside particles.
Definition: Storage.h:122
Object holding various statistics about current run.
Definition: Statistics.h:22
Container storing all quantities used within the simulations.
Definition: Storage.h:230
Helper class for adding individual enums to the enum map.
Definition: EnumMap.h:175