commit 596a6964a6c51bdcc422b48351bc8e1ff841a020
parent c2b78f7e3c85e0a1102878b3c8359d86b9bc5f5a
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 5 Oct 2015 12:27:20 +0200
Update the SAlgae API
Add a salgae_integrator_desc data structure that regroups the
integration data independently of the integrated wavelenght or the
number of realisations.
Diffstat:
| M | src/salgae.h | | | 66 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 66 insertions(+), 0 deletions(-)
diff --git a/src/salgae.h b/src/salgae.h
@@ -49,12 +49,46 @@
#define SALGAE(Func) salgae_ ## Func
#endif
+/* Forward declaration of external types */
struct mem_allocator;
struct logger;
struct s3d_device;
+struct s3d_shape;
+struct ssp_rng;
+
+struct salgae_refractive_index { double real, imag; };
+
+/* Material of an Algae */
+struct salgae_material {
+ /* Retrieve the refractive complex index of the material */
+ void (*get_refractive_index)
+ (void* material,
+ const double wavelength,
+ struct salgae_refractive_index* value);
+ void* material; /* Opaque user defined representation of the material */
+};
+
+struct salgae_integrator_desc {
+ void (*sample_geometry) /* Sample a geometry i.e. a shape and its material */
+ (struct ssp_rng* rng,
+ struct salgae_material* mtl, /* Sampled material */
+ struct s3d_shape* shape, /* Sampled shape */
+ void* sampler_context);
+ void* sampler_context;
+ const double scattering_angles_count; /* # of scattering angles to handle */
+};
+
+/* Result of the Monte Carlo estimation */
+struct salgae_estimator_status {
+ double E; /* Expected value */
+ double V; /* Variance */
+ double SE; /* Standard error */
+ size_t nsteps;
+};
/* Opaque types */
struct salgae_device;
+struct salgae_estimator;
/*******************************************************************************
* Star Algae API
@@ -77,6 +111,38 @@ SALGAE_API res_T
salgae_device_ref_put
(struct salgae_device* dev);
+SALGAE_API res_T
+salgae_integrate
+ (struct salgae_device* dev,
+ struct salgae_integrator_desc* desc,
+ const double wavelength, /* Wavelength to integrate */
+ const size_t steps_count, /* #realisations */
+ struct salgae_estimator** estimator);
+
+SALGAE_API res_T
+salgae_estimator_ref_get
+ (struct salgae_estimator* estimator);
+
+SALGAE_API res_T
+salgae_estimator_ref_put
+ (struct salgae_estimator* estimator);
+
+SALGAE_API res_T
+salgae_estimator_get_extinction_cross_section
+ (struct salgae_estimator* estimator,
+ struct salgae_estimator_status* status);
+
+SALGAE_API res_T
+salgae_estimator_get_absorption_cross_section
+ (struct salgae_estimator* estimator,
+ struct salgae_estimator_status* status);
+
+SALGAE_API res_T
+salgae_estimator_get_phase_function
+ (struct salgae_estimator* estimator,
+ const size_t iscattering_angle,
+ struct salgae_estimator_status* status);
+
END_DECLS
#endif /* SALGAE_H */