SPH
SymmetricSolver.h
Go to the documentation of this file.
1 #pragma once
2 
7 
10 #include "sph/kernel/Kernel.h"
11 #include "thread/ThreadLocal.h"
12 #include "timestepping/ISolver.h"
13 
15 
16 class IBoundaryCondition;
17 class ISymmetricFinder;
18 
30 template <Size Dim>
31 class SymmetricSolver : public ISolver {
32 protected:
33  struct ThreadData {
36 
39 
42 
45  };
46 
49 
52 
55 
58 
61 
64 
65 public:
74  const RunSettings& settings,
75  const EquationHolder& eqs,
77 
79  SymmetricSolver(IScheduler& scheduler, const RunSettings& settings, const EquationHolder& eqs);
80 
82 
83  virtual void integrate(Storage& storage, Statistics& stats) override;
84 
85  virtual void create(Storage& storage, IMaterial& material) const override;
86 
87 protected:
88  virtual void loop(Storage& storage, Statistics& stats);
89 
92  virtual void beforeLoop(Storage& storage, Statistics& stats);
93 
94  virtual void afterLoop(Storage& storage, Statistics& stats);
95 
97 
102  virtual void sanityCheck(const Storage& storage) const;
103 };
104 
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
Spatial derivatives to be computed by SPH discretization.
Right-hand side term of SPH equations.
Base interface for all solvers.
SPH kernels.
#define NAMESPACE_SPH_END
Definition: Object.h:12
Template for thread-local storage.
Object providing safe access to continuous memory of data.
Definition: ArrayView.h:17
Container holding derivatives and the storage they accumulate to.
Definition: Derivative.h:173
Container holding equation terms.
Definition: EquationTerm.h:238
Base object for boundary conditions.
Definition: Boundary.h:29
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 all solvers.
Definition: ISolver.h:20
Extension of IBasicFinder, allowing to search only particles with lower rank in smoothing length.
Non-owning wrapper of pointer.
Definition: RawPtr.h:19
Object holding various statistics about current run.
Definition: Statistics.h:22
Container storing all quantities used within the simulations.
Definition: Storage.h:230
Basic solver for integration of SPH equations.
virtual void create(Storage &storage, IMaterial &material) const override
Initializes all quantities needed by the solver in the storage.
LutKernel< Dim > kernel
Selected SPH kernel.
IScheduler & scheduler
Scheduler to parallelize the solver.
virtual void sanityCheck(const Storage &storage) const
Used to check internal consistency of the solver.
ThreadLocal< ThreadData > threadData
Thread-local structure caching all buffers needed to compute derivatives.
virtual void afterLoop(Storage &storage, Statistics &stats)
AutoPtr< ISymmetricFinder > finder
Structure used to search for neighbouring particles.
EquationHolder equations
Holds all equation terms evaluated by the solver.
virtual RawPtr< const IBasicFinder > getFinder(ArrayView< const Vector > r)
virtual void integrate(Storage &storage, Statistics &stats) override
Computes derivatives of all time-dependent quantities.
SymmetricSolver(IScheduler &scheduler, const RunSettings &settings, const EquationHolder &eqs, AutoPtr< IBoundaryCondition > &&bc)
Creates a symmetric solver, given the list of equations to solve.
virtual void beforeLoop(Storage &storage, Statistics &stats)
virtual void loop(Storage &storage, Statistics &stats)
AutoPtr< IBoundaryCondition > bc
Boundary condition used by the solver.
Array< NeighbourRecord > neighs
Cached array of neighbours, to avoid allocation every step.
Array< Size > idxs
Indices of real neighbours.
Array< Vector > grads
Cached array of gradients.
DerivativeHolder derivatives
Holds all derivatives this thread computes.