commit 8ea0c65551aa3c9c1b004d5318ba0b336cbccf69
parent 521bd9d781a1323994c60945d89e75ef800a68fe
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 9 Mar 2022 16:37:24 +0100
First draft of the sln_tree creation API
Diffstat:
2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
@@ -5,7 +5,8 @@ Star-Line is a C library whose purpose is to manage spectral transitions
Star-Line relies on the [CMake](http://www.cmake.org) and the
[RCMake](https://gitlab.com/vaplv/rcmake/) packages to build. It also depends
-on the [RSys](https://gitlab.com/vaplv/rsys/), library.
+on the [RSys](https://gitlab.com/vaplv/rsys/) and
+[Star-HITRAN](https://gitlab.com/meso-star/star-hitran/) libraries.
First ensure that CMake is installed on your system. Then install the RCMake
package as well as the aforementioned prerequisites. Finally generate the
diff --git a/src/sln.h b/src/sln.h
@@ -42,6 +42,8 @@
/* Forwar declaration of external data structures */
struct logger;
struct mem_allocator;
+struct shtr_lines_list;
+struct shtr_isotope_metadata;
struct sln_device_create_args {
struct logger* logger; /* May be NULL <=> default logger */
@@ -52,10 +54,31 @@ struct sln_device_create_args {
static const struct sln_device_create_args SLN_DEVICE_CREATE_ARGS_DEFAULT =
SLN_DEVICE_CREATE_ARGS_DEFAULT__;
+struct sln_molecule {
+ double concentration;
+ double cutoff; /* in cm^1 */
+ int32_t molecule_id;
+};
+
+struct sln_tree_create_args {
+ /* Isotope metadata and overall list of spectral lines */
+ const struct shtr_isotope_metadata* metadata;
+ const struct shtr_lines_list* lines;
+
+ /* List of molecules to be taken into account with its associated
+ * concentration and cutoff */
+ const struct sln_molecule* molecules;
+ size_t nmolecules;
+
+ /* Thermodynamic properties */
+ double pressure; /* In atm */
+ double temperature; /* In K */
+};
+
/* Forward declarations of opaque data structures */
struct sln_device;
struct sln_tree;
-
+
/*******************************************************************************
* Device API
******************************************************************************/
@@ -72,4 +95,20 @@ SLN_API res_T
sln_device_ref_put
(struct sln_device* sln);
+/*******************************************************************************
+ * Tree API
+ ******************************************************************************/
+SLN_API res_T
+sln_tree_create
+ (struct sln_device* sln,
+ struct sln_tree** tree);
+
+SLN_API res_T
+sln_tree_ref_get
+ (struct sln_tree* tree);
+
+SLN_API res_T
+sln_tree_ref_put
+ (struct sln_tree* tree);
+
#endif /* SLN_H */