18 #ifndef BUBBLEPROFILER_ALGEBRAIC_POTENTIAL_HPP_INCLUDED 19 #define BUBBLEPROFILER_ALGEBRAIC_POTENTIAL_HPP_INCLUDED 24 #include <ginac/ginac.h> 47 const std::string& expr);
56 virtual double operator()(
const Eigen::VectorXd& coords)
const override;
57 virtual double partial(
const Eigen::VectorXd& coords,
int i)
const override;
58 virtual double partial(
const Eigen::VectorXd& coords,
int i,
int j)
const override;
60 return fields.size(); }
74 std::vector<std::string> fields{};
78 std::vector<GiNaC::symbol>
syms{};
82 double eval(
const GiNaC::ex&,
const Eigen::VectorXd&)
const;
virtual void add_constant_term(double) override
Add a constant offset to the potential.
virtual void apply_basis_change(const Eigen::MatrixXd &) override
Apply a change of basis matrix.
virtual std::size_t get_number_of_fields() const override
virtual double partial(const Eigen::VectorXd &coords, int i) const override
Partial derivative WRT coordinate i at a point.
virtual ~Algebraic_potential()=default
Algebraic_potential * clone() const
Get a fresh copy of this potential.
GiNaC::ex v
GiNaC expression to hold potential.
std::vector< GiNaC::symbol > syms
GiNaC symbols matched to fields vec.
Algebraic_potential(const std::vector< std::string > &fields, const std::string &expr)
Construct from list of fields and GiNaC potential string.
std::vector< std::vector< GiNaC::ex > > second_partials
Second partials.
virtual double operator()(const Eigen::VectorXd &coords) const override
Evaluate potential at point.
double eval(const GiNaC::ex &, const Eigen::VectorXd &) const
virtual void translate_origin(const Eigen::VectorXd &) override
Shift the location of the origin by a specified vector.
std::vector< std::string > fields
std::vector< GiNaC::ex > first_partials
First partials.
friend std::ostream & operator<<(std::ostream &os, const Algebraic_potential &p)
Implements a multi dimensional scalar field potential, which may be expressed as almost any algerbrai...
Abstract base class for a generic potential.
logging::Basic_logger logger