SPH
GradHSolver.h
Go to the documentation of this file.
1 #pragma once
2 
7 
9 
11 
18 public:
25  virtual void evalAsymmetric(const Size idx,
26  ArrayView<const Size> neighs,
28  ArrayView<const Vector> gradj) = 0;
29 };
30 
32 class IAsymmetricTerm : public Polymorphic {
33 public:
34  virtual void setAsymmetricDerivatives(Array<AutoPtr<IAsymmetricDerivative>>& asymmetricDerivatives) = 0;
35 };
36 
37 // class EquationHolder : public EquationHolder3
38 
39 
40 class GradHSolver : public AsymmetricSolver {
41 private:
42  Array<AutoPtr<IAsymmetricDerivative>> asymmetricDerivatives;
43 
45  struct SecondThreadData {
46  Array<Vector> grads;
47  };
48 
50 
51 public:
53  const RunSettings& settings,
54  const EquationHolder& basicTerms,
55  Array<AutoPtr<IAsymmetricTerm>>&& asymmetricTerms);
56 
57  virtual void create(Storage& storage, IMaterial& material) const override;
58 
59 protected:
60  virtual void loop(Storage& storage, Statistics& stats) override;
61 };
62 
63 
SPH solver with asymmetric particle evaluation.
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
uint32_t Size
Integral type used to index arrays (by default).
Definition: Globals.h:16
#define NAMESPACE_SPH_END
Definition: Object.h:12
Generic dynamically allocated resizable storage.
Definition: Array.h:43
Generic SPH solver, evaluating equations for each particle separately.
Wrapper of pointer that deletes the resource from destructor.
Definition: AutoPtr.h:15
Container holding equation terms.
Definition: EquationTerm.h:238
GradHSolver(IScheduler &scheduler, const RunSettings &settings, const EquationHolder &basicTerms, Array< AutoPtr< IAsymmetricTerm >> &&asymmetricTerms)
Definition: GradHSolver.cpp:72
virtual void create(Storage &storage, IMaterial &material) const override
Initializes all quantities needed by the solver in the storage.
Definition: GradHSolver.cpp:83
virtual void loop(Storage &storage, Statistics &stats) override
Definition: GradHSolver.cpp:89
Special derivative evaluated by GradHSolver.
Definition: GradHSolver.h:17
virtual void evalAsymmetric(const Size idx, ArrayView< const Size > neighs, ArrayView< const Vector > gradi, ArrayView< const Vector > gradj)=0
Compute a part of derivatives from interaction of particle pairs.
IScheduler & scheduler
Scheduler used to parallelize the solver.
virtual void setAsymmetricDerivatives(Array< AutoPtr< IAsymmetricDerivative >> &asymmetricDerivatives)=0
Derivative accumulated by summing up neighbouring particles.
Definition: Derivative.h:43
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
Object holding various statistics about current run.
Definition: Statistics.h:22
Container storing all quantities used within the simulations.
Definition: Storage.h:230
Base class for all polymorphic objects.
Definition: Object.h:88