31 #ifndef __GyotoMetric_H_ 32 #define __GyotoMetric_H_ 74 gg -> plugins(plugins);
75 #ifdef GYOTO_USE_XERCES 76 if (fmp) gg -> setParameters(fmp);
100 std::vector<std::string> &plugin,
205 void
kind(const std::string);
219 const std::string
kind() const;
224 Generic(const int coordkind, const std::string &name);
232 virtual void
mass(const double);
233 virtual void
mass(const double, const std::string &unit);
240 double
mass(const std::string &unit) const;
248 double
unitLength(const std::string &unit) const ;
255 virtual double
getRmb() const;
262 virtual double
getRms() const;
276 virtual double
getPotential(double const pos[4], double l_cst) const;
303 virtual double
deltaMax(double const pos[8], double delta_max_external) const;
324 virtual double
SysPrimeToTdot(const double coord[4], const double v[3]) const;
348 double dir=1.) const ;
361 virtual void
zamoVelocity(double const pos[4], double vel[4]) const ;
386 virtual void
nullifyCoord(double coord[8], double& tdot2) const;
411 virtual void
normalizeFourVel(double const pos[4], double fourvel[4]) const;
422 virtual double
ScalarProd(const double pos[4],
423 const double u1[4], const double u2[4]) const;
432 double
norm(const double pos[4],
433 const double u1[4]) const;
439 void
addFourVect(double u1[4], double const u2[4]) const;
442 void
projectFourVect(double const pos[4], double u1[4], double const u2[4]) const;
451 void
dualOneForm(double const IN_ARRAY1_1[4], double const IN_ARRAY1_2[4], double ARGOUT_ARRAY1[4]) const ;
464 double const pos[4], double fourvel[4],
465 double screen1[4], double screen2[4],
466 double screen3[4]) const ;
477 virtual void
observerTetrad(double const pos[4], double fourvel[4],
478 double screen1[4], double screen2[4],
479 double screen3[4]) const ;
493 void
GramSchmidt(double const pos[4], double u0[4],
494 double u1[4], double u2[4], double u3[4]) const;
507 virtual double
gmunu(double const x[4], int mu, int nu) const;
519 virtual void
gmunu(double ARGOUT_ARRAY2[4][4], double const IN_ARRAY1[4]) const;
531 virtual double
gmunu_up(double const x[4], int mu, int nu) const;
539 virtual void
gmunu_up(double ARGOUT_ARRAY2[4][4], const double IN_ARRAY1[4]) const;
549 virtual void
jacobian(double ARGOUT_ARRAY3[4][4][4], const double IN_ARRAY1[4]) const;
555 virtual void
gmunu_up_and_jacobian(double ARGOUT_ARRAY2[4][4], double ARGOUT_ARRAY3[4][4][4], const double IN_ARRAY1[4]) const;
561 virtual void
computeNBeta(const double coord[4],double &NN,double beta[3]) const;
571 const int alpha, const int mu, const int nu) const;
582 virtual int
christoffel(double dst[4][4][4], const double coord[4]) const ;
589 virtual int
myrk4(Worldline * line, state_t const &coord, double h, state_t &res) const;
591 virtual int
myrk4(Worldline * line, const double coord[8], double h, double res[8]) const = delete;
596 virtual int
myrk4_adaptive(Gyoto::Worldline* line, state_t const &coord,
597 double lastnorm, double normref,
598 state_t &coordnew, double h0, double& h1,
599 double deltamax=GYOTO_DEFAULT_DELTA_MAX) const;
601 virtual int
myrk4_adaptive(Gyoto::Worldline* line, const double coord[8],
602 double lastnorm, double normref,
603 double coordnew[8], double h0, double& h1,
604 double deltamax=GYOTO_DEFAULT_DELTA_MAX) const = delete;
622 virtual int
diff(state_t const &x, state_t &dxdt, double mass) const ;
624 virtual int
diff(state_t const &x, state_t &dxdt) const = delete;
625 virtual int
diff(const double y[8], double res[8]) const = delete ;
630 virtual int
diff31(state_t const &x, state_t &dxdt, double mass) const ;
636 double const coord[8]) const;
void multiplyFourVect(double vect[4], double a) const
multiply vector by scalar
virtual Generic * clone() const
Virtual copy constructor.
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
virtual void gmunu_up_and_jacobian(double ARGOUT_ARRAY2[4][4], double ARGOUT_ARRAY3[4][4][4], const double IN_ARRAY1[4]) const
gmunu_up() and jacobian() in one go
SmartPointer< Metric::Generic > Subcontractor_t(FactoryMessenger *, std::vector< std::string > const &)
A function to build instances of a specific Metric::Generic sub-class.
Definition: GyotoMetric.h:60
int coordkind_
Kind of coordinates (cartesian-like, spherical-like, unspecified)
Definition: GyotoMetric.h:167
double mass() const
Get mass used in unitLength()
virtual int diff31(state_t const &x, state_t &dxdt, double mass) const
F function such as dx/dt=F(x,cst) for 3+1 case.
Astronomical objects (light emitters)
Register::Entry * Register_
The Metric register.
Tellers tell Listeners when they mutate.
double delta_min_
Minimum integration step for the adaptive integrator.
Definition: GyotoMetric.h:179
virtual int diff(state_t const &x, state_t &dxdt, double mass) const
F function such as dx/dt=F(x,cst)
Base class for metrics.
Definition: GyotoMetric.h:158
Reference-counting pointers.
bool keplerian() const
Get keplerian_.
virtual void zamoVelocity(double const pos[4], double vel[4]) const
Yield ZAMO velocity at a given position.
int coordKind() const
Get coordinate kind.
double delta_max_
Maximum integration step for the adaptive integrator.
Definition: GyotoMetric.h:180
void projectFourVect(double const pos[4], double u1[4], double const u2[4]) const
project u1 orthogonally to u2 at pos
virtual void nullifyCoord(double coord[8]) const
Set tdot (coord[4]) such that coord is light-like. Everything is in geometrical units.
void addFourVect(double u1[4], double const u2[4]) const
add second vector to first one
Factory / SmartPointee::Subcontractor_t interface.
Definition: GyotoFactoryMessenger.h:92
void dualOneForm(double const IN_ARRAY1_1[4], double const IN_ARRAY1_2[4], double ARGOUT_ARRAY1[4]) const
Computes dual 1-form Compute the dual 1-form of 4-vector.
virtual int isStopCondition(double const coord[8]) const
Check whether integration should stop.
virtual double christoffel(const double coord[4], const int alpha, const int mu, const int nu) const
Chistoffel symbol.
virtual void observerTetrad(obskind_t obskind, double const pos[4], double fourvel[4], double screen1[4], double screen2[4], double screen3[4]) const
Computes the orthonormal local tetrad of the observer.
virtual double getSpecificAngularMomentum(double rr) const
bool keplerian_
1 if circularVelocity should return the Newtonian Keplerian velocity, in r^-3/2
Definition: GyotoMetric.h:196
virtual void normalizeFourVel(double coord[8]) const
Normalize fourvelvel to -1.
virtual double gmunu_up(double const x[4], int mu, int nu) const
Metric contravariant coefficients.
virtual int myrk4_adaptive(Gyoto::Worldline *line, state_t const &coord, double lastnorm, double normref, state_t &coordnew, double h0, double &h1, double deltamax=GYOTO_DEFAULT_DELTA_MAX) const
RK4 integrator with adaptive step.
virtual double gmunu(double const x[4], int mu, int nu) const
Metric coefficients.
double norm(const double pos[4], const double u1[4]) const
Scalar product.
Gyoto ubiquitous macros and typedefs.
double deltaMaxOverR() const
Get delta_max_over_r_.
void initRegister()
Empty the Metric register.
double delta_max_over_r_
Numerical tuning parameter.
Definition: GyotoMetric.h:194
virtual double SysPrimeToTdot(const double coord[4], const double v[3]) const
Compute tdot as a function of dr/dt, dtheta/dt and dphi/dt. Everything is in geometrical units...
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
virtual double ScalarProd(const double pos[4], const double u1[4], const double u2[4]) const
Scalar product.
Gyoto::Metric::Subcontractor_t * getSubcontractor(std::string name, std::vector< std::string > &plugin, int errmode=0)
Query the Metric register.
int __defaultfeatures
Whether some virtual methods are implemented.
Definition: GyotoMetric.h:176
virtual void cartesianVelocity(double const coord[8], double vel[3])
Compute xprime, yprime and zprime from 8-coordinates.
Pointers performing reference counting.
Definition: GyotoProperty.h:45
Can be pointed to by a SmartPointer.
Definition: GyotoSmartPointer.h:80
virtual int myrk4(Worldline *line, state_t const &coord, double h, state_t &res) const
RK4 integrator.
const std::string kind() const
Get kind_.
double mass_
Mass yielding geometrical unit (in kg).
Definition: GyotoMetric.h:166
double unitLength() const
M * G / c^2, M is in kg, unitLength in meters.
virtual void computeNBeta(const double coord[4], double &NN, double beta[3]) const
Computes lapse scalar and shift vector at coord.
Object with properties.
Definition: GyotoObject.h:151
virtual void setParticleProperties(Gyoto::Worldline *line, double const coord[8]) const
Set Metric-specific constants of motion. Used e.g. in KerrBL.
SmartPointer< Metric::Generic > Subcontractor(FactoryMessenger *fmp, std::vector< std::string > const &plugins)
Subcontractor template.
Definition: GyotoMetric.h:72
void GramSchmidt(double const pos[4], double u0[4], double u1[4], double u2[4], double u3[4]) const
Apply Gram-Schmidt orthonormalization to a basis.
virtual void jacobian(double ARGOUT_ARRAY3[4][4][4], const double IN_ARRAY1[4]) const
Derivatives of the metric covariant coefficients.
virtual double getPotential(double const pos[4], double l_cst) const
Listen to me and I'll warn you when I change.
Definition: GyotoHooks.h:82
virtual void circularVelocity(double const pos[4], double vel[4], double dir=1.) const
Yield circular velocity at a given position.
virtual double getRms() const
virtual double getRmb() const
void Register(std::string kind, Gyoto::Metric::Subcontractor_t *scp)
Make a Metric kind known to the Factory.
Entry in a register (or a full register)
Definition: GyotoRegister.h:117