27#ifndef __GyotoScenery_H_
28#define __GyotoScenery_H_
45#include <boost/mpi/environment.hpp>
46#include <boost/mpi/communicator.hpp>
226 boost::mpi::communicator * mpi_team_;
264 enum
mpi_tag {give_task, read_scenery, terminate,
265 raytrace, raytrace_done, ready,
266 impactcoords, noimpactcoords};
325 double delta(
const std::string &unit)
const ;
327 void delta(
double,
const std::string &unit);
329 void initCoord(std::vector<double> c);
330 std::vector<double> initCoord()
const;
367 double tMin(
const std::string &unit)
const ;
371 void tMin(
double,
const std::string &unit);
488#ifdef GYOTO_SWIGIMPORTED
494 double * impactcoords=NULL);
505 double * impactcoords = NULL,
Photon * ph = NULL);
518#ifdef GYOTO_USE_XERCES
Astronomical objects (light emitters)
#define size_t
If not defined in <sys/types.h>.
Definition: GyotoConfig.h:390
Gyoto ubiquitous macros and typedefs.
Base class for metric description.
#define GYOTO_OBJECT_THREAD_SAFETY
Declare virtual bool isThreadSafe() const.
Definition: GyotoObject.h:99
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
Description of the observer screen.
Reference-counting pointers.
Observable properties of an Astronomical object.
Definition: GyotoAstrobj.h:654
Factory / SmartPointee::Subcontractor_t interface.
Definition: GyotoFactoryMessenger.h:92
Object with properties.
Definition: GyotoObject.h:152
A null geodesic transporting light.
Definition: GyotoPhoton.h:56
Property that can be set and got using standard methods.
Definition: GyotoProperty.h:608
Ray-tracing scene.
Definition: GyotoScenery.h:165
void delta(double)
set default step in geometrical units
size_t nThreads() const
Get nthreads_;.
Scenery * clone() const
Cloner.
void tMin(double, const std::string &unit)
Set ph_.tmin_ in specified unit.
double relTol() const
Passed to ph_.
SmartPointer< Metric::Generic > metric() const
Get ph_.Worldline::metric_.
void mpiTerminate()
Terminate worker processes.
bool adaptive() const
Get ph_.adaptive_.
void secondary(bool sec)
Set ph_.secondary_.
void adaptive(bool mode)
Set ph_.adaptive_.
void requestedQuantitiesString(std::string const &squant)
Set Scenery::quantities_ from string.
void operator()(size_t i, size_t j, Astrobj::Properties *data, double *impactcoords=NULL, Photon *ph=NULL)
Ray-trace a single pixel in Scenery::screen_.
void deltaMax(double h1)
Passed to ph_.
bool parallelTransport() const
Get ph_.parallel_transport_.
void astrobj(SmartPointer< Astrobj::Generic >)
Set ph_.obj_.
Scenery(const Scenery &o)
Copy constructor.
int nprocesses_
Number of parallel processes to use in rayTrace()
Definition: GyotoScenery.h:207
SmartPointer< Photon > clonePhoton() const
Clone the internal Photon.
void nThreads(size_t)
Set nthreads_;.
void deltaMaxOverR(double t)
Passed to ph_.
void screen(SmartPointer< Screen >)
Set Scenery::screen_.
std::string integrator() const
Passed to ph_.
double deltaMaxOverR() const
Passed to ph_.
SmartPointer< Photon > clonePhoton(double a, double d)
Clone the internal Photon.
double absTol() const
Passed to ph_.
Scenery()
Set everything to defaults.
double delta_
Definition: GyotoScenery.h:182
void relTol(double)
Passed to ph_.
void fillElement(FactoryMessenger *fmp) const
Fill the XML element for this Object.
static void mpiWorker()
Become an MPI worker.
void binSpectrumConverter(std::string unit)
Set Scenery::binspectrum_converter_.
void delta(double, const std::string &unit)
set default step in specified units
size_t nthreads_
Number of parallel threads to use in rayTrace()
Definition: GyotoScenery.h:205
size_t maxiter() const
Get ph_.maxiter_.
void mpiSpawn(int nbchildren)
Spawn gyoto-mpi-worker processes.
void mpiClone()
Send a copy of self to the mpi workers.
void absTol(double)
Passed to ph_.
void setPropertyConverters(Gyoto::Astrobj::Properties *prop)
Copy converters to Astrobj::Properties instance.
std::string requestedQuantitiesString() const
Get a string representation of Scenery::quantities_.
Quantity_t getRequestedQuantities() const
Get Scenery::quantities_.
SmartPointer< Astrobj::Generic > astrobj() const
Get ph_.obj_.
void nProcesses(size_t)
Set nprocesses_;.
static SmartPointer< Scenery > Subcontractor(Gyoto::FactoryMessenger *)
Instanciate Scenery from an XML description.
void fillProperty(FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
void updatePhoton()
Update values in cached Photon.
mpi_tag
Tags that may be sent to communicate with workers using MPI_Send()
Definition: GyotoScenery.h:264
static bool am_worker
True in instance of gyoto-mpi-worker, otherwise false.
Definition: GyotoScenery.h:229
SmartPointer< Screen > screen() const
Get Scenery::screen_.
double tMin(const std::string &unit) const
Get ph_.tmin_ in specified unit.
double deltaMin() const
Passed to ph_.
Gyoto::Photon ph_
Template Photon.
Definition: GyotoScenery.h:198
double delta() const
Get default step in geometrical units.
SmartPointer< Photon > clonePhoton(size_t i, size_t j)
Clone the internal Photon.
Scenery(SmartPointer< Metric::Generic >, SmartPointer< Screen >, SmartPointer< Astrobj::Generic >)
Constructor setting Scenery::gg_, Scenery::screen_, and Scenery::obj_.
bool secondary() const
Get ph_.secondary_.
void intensityConverter(std::string unit)
Set Scenery::intensity_converter_.
void integrator(std::string type)
Passed to ph_.
double tMin() const
Get ph_.tmin_.
void spectrumConverter(std::string unit)
Set Scenery::spectrum_converter_.
void setRequestedQuantities(Quantity_t quant)
Set Scenery::quantities_.
double delta(const std::string &unit) const
Get default step in specified units.
double deltaMax() const
Passed to ph_.
void parallelTransport(bool pt)
Set ph_.parallel_transport_.
void tMin(double)
Set ph_.tmin_.
size_t nProcesses() const
Get nprocesses_;.
void maxiter(size_t miter)
Set ph_.maxiter_.
SmartPointer< Screen > screen_
Definition: GyotoScenery.h:176
size_t getSpectralQuantitiesCount(Quantity_t *q=NULL) const
Get number of requested quantities of spectral nature.
Gyoto::Quantity_t quantities_
Quantities to compute.
Definition: GyotoScenery.h:191
void deltaMin(double h1)
Passed to ph_.
void rayTrace(Screen::Coord2dSet &ij, Astrobj::Properties *data, double *impactcoords=NULL)
Perform ray-tracing.
void mpiTask(mpi_tag &tag)
Send a tag to workers.
void metric(SmartPointer< Metric::Generic >)
Set Scenery::gg_.
size_t getScalarQuantitiesCount(Quantity_t *q=NULL) const
Get number of requested quantities of scalar nature.
Class to specify a set of points on the Screen.
Definition: GyotoScreen.h:669
Can be pointed to by a SmartPointer.
Definition: GyotoSmartPointer.h:81
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:135
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
unsigned int Quantity_t
Type for observabke quantities.
Definition: GyotoDefs.h:76