Gyoto
Classes | Typedefs | Functions | Variables
Gyoto::Metric Namespace Reference

Access to metrics. More...

Classes

class  BalasinGrumiller
 Balasin-Grumiller solution in spherical coordinates, under the suggested approximation =0. More...
 
class  ChernSimons
 
class  Complex
 Combine several metrics. More...
 
class  Generic
 Base class for metrics. More...
 
class  Hayward
 Metric of a regular rotating black hole or naked worm-hole. More...
 
class  KerrBL
 Metric around a Kerr black-hole in Boyer-Lindquist coordinates. More...
 
class  KerrKS
 Metric around a Kerr black-hole in Kerr-Schild coordinates Warning: this metric is seldom used and may be buggy. More...
 
class  KonoplyaRezzollaZhidenko
 
class  Minkowski
 The Minkowski flat-space metric. More...
 
class  NumericalMetricLorene
 
class  Python
 Metric coded in Python. More...
 
class  RezzollaZhidenko
 
class  RotStar3_1
 Numerical metric around a rotating star in 3+1 formalism. More...
 
class  SchwarzschildHarmonic
 
class  Shift
 The Shift flat-space metric. More...
 

Typedefs

typedef SmartPointer< Metric::GenericSubcontractor_t(FactoryMessenger *, std::vector< std::string > const &)
 A function to build instances of a specific Metric::Generic sub-class. More...
 

Functions

template<typename T >
SmartPointer< Metric::GenericSubcontractor (FactoryMessenger *fmp, std::vector< std::string > const &plugins)
 Subcontractor template. More...
 
Gyoto::Metric::Subcontractor_tgetSubcontractor (std::string name, std::vector< std::string > &plugin, int errmode=0)
 Query the Metric register Metric::Register_. More...
 
void Register (std::string kind, Gyoto::Metric::Subcontractor_t *scp)
 Make a Metric kind known to the Factory. More...
 
void initRegister ()
 Empty the Metric register Metric::Register_. More...
 

Variables

Register::EntryRegister_
 The Metric register. More...
 

Detailed Description

Access to metrics.

Objects which describe space-time geometry must inherit from the Gyoto::Metric::Generic class.

To be usable, a Metric::Generic sub-class should register a Metric::Subcontractor_t function using the Metric::Register() function. See also Writing plug-ins for Gyoto .

Typedef Documentation

◆ Subcontractor_t

typedef SmartPointer<Metric::Generic> Gyoto::Metric::Subcontractor_t(FactoryMessenger *, std::vector< std::string > const &)

A function to build instances of a specific Metric::Generic sub-class.

This is a more specific version of the SmartPointee::Subcontractor_t type. A Metric::Subcontrator_t is called by the Gyoto::Factory to build an instance of the kind of metric specified in an XML file (see Register()). The Factory and Subcontractor_t function communicate through a Gyoto::FactoryMessenger.

Function Documentation

◆ getSubcontractor()

Gyoto::Metric::Subcontractor_t* Gyoto::Metric::getSubcontractor ( std::string  name,
std::vector< std::string > &  plugin,
int  errmode = 0 
)

Query the Metric register Metric::Register_.

Query the Metric register to get the Metric::Subcontractor_t corresponding to a given kind name. This function is normally called only from the Factory. If plugin is not empty, all the plug-ins listed there will be first loaded using Gyoto::requirePlugin(), then a subcontractor matching both name and and one element of plugin will be searched for. If plugin is an empty vector, then the first subcontractor matching name will be returned, and the name of the plug-in it belongs to will be returned in plugin upon output.

This function is defined using the GYOTO_GETSUBCONTRACTOR macro.

Parameters
[in]namee.g. "KerrBL".
[in,out]pluginvector of strings listing plug-ins to look for name in.
[in]errmodeint=0. If errmode==0, failure to find a registered Metric by that name is an error. Else, simply return NULL pointer in that case.
Returns
pointer to the corresponding subcontractor.

◆ initRegister()

void Gyoto::Metric::initRegister ( )

Empty the Metric register Metric::Register_.

This must be called once. It is called by Gyoto::Register::init().

◆ Register()

void Gyoto::Metric::Register ( std::string  kind,
Gyoto::Metric::Subcontractor_t scp 
)

Make a Metric kind known to the Factory.

Register a new Metric::Generic sub-class so that the Gyoto::Factory knows it.

Parameters
kindThe kind name which identifies this object type in an XML file, as in <Metric kind="name">
scpA pointer to the subcontractor, which will communicate with the Gyoto::Factory to build an instance of the class from its XML description

◆ Subcontractor()

template<typename T >
SmartPointer<Metric::Generic> Gyoto::Metric::Subcontractor ( FactoryMessenger fmp,
std::vector< std::string > const &  plugins 
)

Subcontractor template.

Instead of reimplementing the wheel, your subcontractor can simply be Gyoto::Metric::Subcontractor<MyKind>

Template Parameters
TSub-class of Metric::Generic

Variable Documentation

◆ Register_

Register::Entry* Gyoto::Metric::Register_

The Metric register.

Use the Metric::initRegister() once in your program to initiliaze it, the Metric::Register() function to fill it, and the Metric::getSubcontractor() function to query it.