src

BaseSim

class sme::simulate::BaseSim

Subclassed by sme::simulate::DuneSim, sme::simulate::PixelSim

Public Functions

virtual ~BaseSim() = default
virtual std::size_t run(double time, double timeout_ms, const std::function<bool()> &stopRunningCallback) = 0
virtual const std::vector<double> &getConcentrations(std::size_t compartmentIndex) const = 0
virtual std::size_t getConcentrationPadding() const = 0
virtual const std::string &errorMessage() const = 0
virtual const QImage &errorImage() const = 0
virtual void setStopRequested(bool stop) = 0

GridFunction

template<typename GV>
class sme::simulate::GridFunction : public Dune::PDELab::GridFunctionBase<Dune::PDELab::GridFunctionTraits<GV, double, 1, Dune::FieldVector<double, 1>>, GridFunction<GV>>

Public Types

using Traits = Dune::PDELab::GridFunctionTraits<GV, double, 1, Dune::FieldVector<double, 1>>

Public Functions

inline GridFunction(double xOrigin, double yOrigin, double pixelWidth, int imgWidth, const std::vector<double> &concentration)
inline void set_time([[maybe_unused]] double t)
template<typename Element, typename Domain>
inline void evaluate(const Element &elem, const Domain &localPos, typename Traits::RangeType &result) const

IniFile

class sme::simulate::IniFile

Public Functions

const QString &getText() const
void addSection(const QString &str)
void addSection(const QString &str1, const QString &str2)
void addSection(const QString &str1, const QString &str2, const QString &str3)
void addSection(const QString &str1, const QString &str2, const QString &str3, const QString &str4)
void addSection(const QString &str1, const QString &str2, const QString &str3, const QString &str4, const QString &str5)
void addSection(const QString &str1, const QString &str2, const QString &str3, const QString &str4, const QString &str5, const QString &str6)
void addValue(const QString &var, const QString &value)
void addValue(const QString &var, int value)
void addValue(const QString &var, double value, int precision)
void clear()

DuneSim

class sme::simulate::DuneSim : public sme::simulate::BaseSim

Public Functions

explicit DuneSim(const model::Model &sbmlDoc, const std::vector<std::string> &compartmentIds, const std::map<std::string, double, std::less<>> &substitutions = {})
~DuneSim() override
virtual std::size_t run(double time, double timeout_ms, const std::function<bool()> &stopRunningCallback) override
virtual const std::vector<double> &getConcentrations(std::size_t compartmentIndex) const override
virtual std::size_t getConcentrationPadding() const override
virtual const std::string &errorMessage() const override
virtual const QImage &errorImage() const override
virtual void setStopRequested(bool stop) override

DuneImpl

class sme::simulate::DuneImpl

Subclassed by sme::simulate::DuneImplCoupled< DuneFEMOrder >, sme::simulate::DuneImplIndependent< DuneFEMOrder >

Public Types

using HostGrid = Dune::UGGrid<DuneDimensions>
using MDGTraits = Dune::mdgrid::DynamicSubDomainCountTraits<DuneDimensions, 1>
using Grid = Dune::mdgrid::MultiDomainGrid<HostGrid, MDGTraits>
using GridView = Grid::LeafGridView
using SubGrid = Grid::SubDomainGrid
using SubGridView = SubGrid::LeafGridView
using Elem = decltype(*(elements(std::declval<SubGridView>()).begin()))

Public Functions

explicit DuneImpl(const simulate::DuneConverter &dc)
virtual ~DuneImpl()
virtual void setInitial(const simulate::DuneConverter &dc) = 0
virtual void run(double time) = 0
virtual void updateGridFunctions(std::size_t compartmentIndex, std::size_t nSpecies) = 0
virtual double evaluateGridFunction(std::size_t iSpecies, const Elem &e, const Dune::FieldVector<double, 2> &localPoint) const = 0

Public Members

std::vector<Dune::ParameterTree> configs
std::shared_ptr<Grid> grid

Public Static Attributes

static constexpr int DuneDimensions = 2

DuneImplCoupled

template<int DuneFEMOrder>
class sme::simulate::DuneImplCoupled : public sme::simulate::DuneImpl

Public Types

using ModelTraits = Dune::Copasi::ModelMultiDomainPkDiffusionReactionTraits<Grid, DuneFEMOrder>
using Model = Dune::Copasi::ModelMultiDomainDiffusionReaction<ModelTraits>
using GF = std::remove_reference_t<decltype(*std::declval<Model>().get_grid_function(0, 0).get())>

Public Functions

inline explicit DuneImplCoupled(const DuneConverter &dc, const DuneOptions &options)
~DuneImplCoupled() override = default
inline virtual void setInitial(const DuneConverter &dc) override
inline virtual void run(double time) override
inline virtual void updateGridFunctions(std::size_t compartmentIndex, std::size_t nSpecies) override
inline virtual double evaluateGridFunction(std::size_t iSpecies, const Elem &e, const Dune::FieldVector<double, 2> &localPoint) const override

Public Members

std::unique_ptr<Model> model
std::vector<std::shared_ptr<const GF>> gridFunctions
double t0 = {0.0}
double dt = {1e-3}
std::string vtkFilename = {}

DuneImplIndependent

template<int DuneFEMOrder>
class sme::simulate::DuneImplIndependent : public sme::simulate::DuneImpl

Public Types

using ModelTraits = Dune::Copasi::ModelPkDiffusionReactionTraits<Grid::SubDomainGrid, Grid::SubDomainGrid::Traits::LeafGridView, DuneFEMOrder>
using Model = Dune::Copasi::ModelDiffusionReaction<ModelTraits>
using GF = std::remove_reference_t<decltype(*std::declval<Model>().get_grid_function(0).get())>

Public Functions

inline explicit DuneImplIndependent(const DuneConverter &dc, const DuneOptions &options)
~DuneImplIndependent() override = default
inline virtual void setInitial(const DuneConverter &dc) override
inline virtual void run(double time) override
inline virtual void updateGridFunctions(std::size_t compartmentIndex, std::size_t nSpecies) override
inline virtual double evaluateGridFunction(std::size_t iSpecies, const Elem &e, const Dune::FieldVector<double, 2> &localPoint) const override

Public Members

std::vector<std::unique_ptr<Model>> models
std::vector<std::shared_ptr<const GF>> gridFunctions
double t0 = {0.0}
std::vector<double> dts
std::string vtkFilename = {}

PixelSim

class sme::simulate::PixelSim : public sme::simulate::BaseSim

Public Functions

explicit PixelSim(const model::Model &sbmlDoc, const std::vector<std::string> &compartmentIds, const std::vector<std::vector<std::string>> &compartmentSpeciesIds, const std::map<std::string, double, std::less<>> &substitutions = {})
~PixelSim() override
virtual std::size_t run(double time, double timeout_ms, const std::function<bool()> &stopRunningCallback) override
virtual const std::vector<double> &getConcentrations(std::size_t compartmentIndex) const override
virtual std::size_t getConcentrationPadding() const override
const std::vector<double> &getDcdt(std::size_t compartmentIndex) const
double getLowerOrderConcentration(std::size_t compartmentIndex, std::size_t speciesIndex, std::size_t pixelIndex) const
virtual const std::string &errorMessage() const override
virtual const QImage &errorImage() const override
virtual void setStopRequested(bool stop) override

PagmoUDP

class sme::simulate::PagmoUDP

Implements a Pagmo User Defined Problem to evolve.

Note

Needs to be (cheaply) copy-constructible, implement fitness() and get_bounds() functions, and be thread-safe, see https://esa.github.io/pagmo2/docs/cpp/problem.html

Public Functions

PagmoUDP() = default
explicit PagmoUDP(const OptConstData *optConstData, ThreadsafeModelQueue *modelQueue, Optimization *optimization)
pagmo::vector_double fitness(const pagmo::vector_double &dv) const
std::pair<pagmo::vector_double, pagmo::vector_double> get_bounds() const