World Builder  1.1.0-pre
A geodynamic initial conditions generator
wrapper_c.h File Reference
#include <stdbool.h>
Include dependency graph for wrapper_c.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void create_world (void **ptr_ptr_world, const char *world_builder_file, const bool *has_output_dir, const char *output_dir, const unsigned long random_number_seed)
 
unsigned int properties_output_size (void *ptr_ptr_world, const unsigned int properties[][3], const unsigned int n_properties)
 
void properties_2d (void *ptr_ptr_world, const double x, const double z, const double depth, const unsigned int properties[][3], const unsigned int n_properties, double values[])
 This function returns 2D properties. More...
 
void properties_3d (void *ptr_ptr_world, const double x, const double y, const double z, const double depth, const unsigned int properties[][3], const unsigned int n_properties, double values[])
 This function returns 3D properties. More...
 
void temperature_2d (void *ptr_ptr_world, double x, double z, double depth, double *temperature)
 
void temperature_3d (void *ptr_ptr_world, double x, double y, double z, double depth, double *temperature)
 
void composition_2d (void *ptr_ptr_world, double x, double z, double depth, unsigned int composition_number, double *composition)
 
void composition_3d (void *ptr_ptr_world, double x, double y, double z, double depth, unsigned int composition_number, double *composition)
 
void release_world (void *ptr_ptr_world)
 

Function Documentation

◆ composition_2d()

void composition_2d ( void *  ptr_ptr_world,
double  x,
double  z,
double  depth,
unsigned int  composition_number,
double *  composition 
)

This function return the composition at a specific location given x, z, depth and composition number.

Definition at line 147 of file wrapper_c.cc.

Here is the call graph for this function:

◆ composition_3d()

void composition_3d ( void *  ptr_ptr_world,
double  x,
double  y,
double  z,
double  depth,
unsigned int  composition_number,
double *  composition 
)

This function return the composition at a specific location given x, y, z, depth and composition number.

Definition at line 160 of file wrapper_c.cc.

Here is the call graph for this function:

◆ create_world()

void create_world ( void **  ptr_ptr_world,
const char *  world_builder_file,
const bool *  has_output_dir_,
const char *  output_dir_,
const unsigned long  random_number_seed 
)

This function creates an object of the world builder and returns a pointer to it. This pointer can then be used to call the temperature and composition functions. When done call the release world function to destroy the object.

Definition at line 32 of file wrapper_c.cc.

◆ properties_2d()

void properties_2d ( void *  ptr_ptr_world,
const double  x,
const double  z,
const double  depth,
const unsigned int  properties[][3],
const unsigned int  n_properties,
double  values[] 
)

This function returns 2D properties.

The properties input decides what each entry means, and the output is generated in the same order as the properties input. The properties input consists of a 3D array, where the first entry identifies the property and the last two entries provide extra information about that property.

Temperature is identified by 1 and no extra information is needed. So temperature input usually looks like {1,0,0}. A temperature query prodoces one entry in the output vector.

Composition is identified by 2. This produces one value in the output. The second entry identifies the composition number and the third number is not used. So a composition query asking about composition 1 looks like this: {2,1,0}. A composition query prodoces one entry in the output vector.

Grains are identified by 3. The second entry is the grain composition number and the third entry is the number of grains. A query about the grains, where it asks about composition 1 (for example enstatite) and 500 grains, looks like this: {3,1,500}. A composition query prodoces n_grains*10 entries in the output vector. The first n_grains entries are the sizes of all the grains, and the other 9 entries are sets of rotation matrices. The rotation matrix entries are ordered [0][0],[0][1],[0][2],[1][0],[1][1],etc.

The tag is identified by 4 and no extra information is needed. So the tag input usually looks like {4,0,0}. A tag query prodoces one entry in the output vector, representing the index of the tag of the last/dominant feature.

Parameters
ptr_ptr_worlda pointer to the world
xThe x position of the point
zThe z position of the point
depthThe depth of the point
propertiesan array of properties, which each property is an array of three integers.
n_propertiesnumber of properties.
valuesare the return values as a pointer to an array of doubles

Definition at line 71 of file wrapper_c.cc.

Here is the call graph for this function:

◆ properties_3d()

void properties_3d ( void *  ptr_ptr_world,
const double  x,
const double  y,
const double  z,
const double  depth,
const unsigned int  properties[][3],
const unsigned int  n_properties,
double  values[] 
)

This function returns 3D properties.

The properties input decides what each entry means, and the output is generated in the same order as the properties input. The properties input consists of a 3D array, where the first entry identifies the property and the last two entries provide extra information about that property.

Temperature is identified by 1 and no extra information is needed. So temperature input usually looks like {1,0,0}. A temperature query prodoces one entry in the output vector.

Composition is identified by 2. This produces one value in the output. The second entry identifies the composition number and the third number is not used. So a composition query asking about composition 1 looks like this: {2,1,0}. A composition query prodoces one entry in the output vector.

Grains are identified by 3. The second entry is the grain composition number and the third entry is the number of grains. A query about the grains, where it asks about composition 1 (for example enstatite) and 500 grains, looks like this: {3,1,500}. A composition query prodoces n_grains*10 entries in the output vector. The first n_grains entries are the sizes of all the grains, and the other 9 entries are sets of rotation matrices. The rotation matrix entries are ordered [0][0],[0][1],[0][2],[1][0],[1][1],etc.

The tag is identified by 4 and no extra information is needed. So the tag input usually looks like {4,0,0}. A tag query prodoces one entry in the output vector, representing the index of the tag of the last/dominant feature.

Parameters
ptr_ptr_worlda pointer to the world
xThe x position of the point
xThe y position of the point
zThe z position of the point
depthThe depth of the point
propertiesan array of properties, which each property is an array of three integers.
n_propertiesnumber of properties.
valuesare the return values as a pointer to an array of doubles

Definition at line 92 of file wrapper_c.cc.

Here is the call graph for this function:

◆ properties_output_size()

unsigned int properties_output_size ( void *  ptr_ptr_world,
const unsigned int  properties[][3],
const unsigned int  n_properties 
)

Return the size of the output vector returned by the properties function for a given properties vector.

Parameters
propertiesThe properties parameter from the properties function. See the documentation of that function for more info.
n_propertiesnumber of properties
Returns
unsigned int Return the size of the output vector returned by the properties function for a given properties vector.

Definition at line 56 of file wrapper_c.cc.

Here is the call graph for this function:

◆ release_world()

void release_world ( void *  ptr_ptr_world)

The destructor for the world builder class. Call this function when done with the world builder.

Definition at line 174 of file wrapper_c.cc.

◆ temperature_2d()

void temperature_2d ( void *  ptr_ptr_world,
double  x,
double  z,
double  depth,
double *  temperature 
)

This function return the temperature at a specific location given x, z, depth and gravity. Note: gravity value is no longer used, instead use the gravity model from the input file.

This function return the temperature at a specific location given x, z, depth and gravity.

Definition at line 121 of file wrapper_c.cc.

Here is the call graph for this function:

◆ temperature_3d()

void temperature_3d ( void *  ptr_ptr_world,
double  x,
double  y,
double  z,
double  depth,
double *  temperature 
)

This function return the temperature at a specific location given x, y, z, depth and gravity.

Definition at line 134 of file wrapper_c.cc.

Here is the call graph for this function: