Commit a08b08a4 authored by Alain O' Miniussi's avatar Alain O' Miniussi
Browse files

put viscosity and velocity step in private base of Simulation so that they can...

put viscosity and velocity step in private base of Simulation so that they can be declared public and still be protected.
This is required by CUDA thos kernels needs to be in accessible functions.
refs #597
parent d73ee7f6
......@@ -51,13 +51,20 @@ namespace fargOCA {
std::string myODir;
int myNbSteps;
int myStep;
/// \brief The manipulated disk.
Disk& disk() { return *myDisk; }
Disk const& disk() const { return *myDisk; }
SimulationPrivate(shptr<Disk> disk,
shptr<TrackingConfig const> trackingConfig,
std::string odir);
SimulationPrivate(SimulationPrivate&& simu);
void velocityStep(ScalarField const& systemPotential, real dt);
void adiabaticStep(real dt);
void viscosityStep(real dt);
// Cuda want's plain functions.
void ctor();
};
......@@ -65,6 +72,7 @@ namespace fargOCA {
/// \brief Drive the evolution of a planetary disk through time.
class Simulation : private SimulationPrivate {
public:
typedef SimulationPrivate super;
template<class T> using opt = std::optional<T>;
public:
......@@ -81,16 +89,16 @@ namespace fargOCA {
Simulation(Simulation&& simu);
~Simulation();
/// \brief The manipulated disk.
Disk& disk() { return super::disk(); }
Disk const& disk() const { return super::disk(); }
/// \brief Initiate the simulation.
void start();
/// \brief Execute one time step of the simulaton.
void doStep();
/// \brief The manipulated disk.
Disk& disk() { return *myDisk; }
Disk const& disk() const { return *myDisk; }
CompoundTracker& tracker() { return *myTracker; }
CompoundTracker const& tracker() const { return *myTracker; }
......@@ -123,8 +131,6 @@ namespace fargOCA {
std::string odir() const { return myODir; };
private:
void velocityStep(ScalarField const& systemPotential, real dt);
void viscosityStep(real dt);
void adiabaticStep(real dt) { SimulationPrivate::adiabaticStep(dt); }
void energyStep(real dt);
......
......@@ -320,7 +320,7 @@ namespace fargOCA {
}
void
Simulation::velocityStep(ScalarField const& systemPotential, real dt) {
SimulationPrivate::velocityStep(ScalarField const& systemPotential, real dt) {
GridDispatch const& grid = disk().grid();
int const nr = grid.nbRadius();
......@@ -424,7 +424,7 @@ namespace fargOCA {
}
void
Simulation::viscosityStep(real dt)
SimulationPrivate::viscosityStep(real dt)
{
GridDispatch const& grid = disk().grid();
int const nr = grid.nbRadius();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment