This HTML file contains information about the internal LELUYA's structure.
_global_constants.h
_debugger_flags.h
_data_calc_output_flags.h
_global_structures.h
_global_extern_variables.h
BJESOMAR.h
DAZhBOG.h
MATH_LIB.h
PAUK.h
RADGOST.h
SVAROG.h
VESNA.h
ZMAJ.h



_global_constants.h

#define TRUE 1 .
#define FALSE 0 .
#define PI 3.141592653589793 .
#define SQRT3 1.732050808 .
#define RAD1 0.01745329252 .
#define _Temperature_Accuracy 0.01 accuracy in the search for a new temperature used in _MATH_LIB_Ridder_Root
#define _DUST_COMPONENT_NAME_SIZE_ 25 length of a name of a dust component
#define _DUST_DENSITY_TYPE_NAME_SIZE_ 50 length of a name of a dust density type
#define _SUBLIMATION_RADIUS_ACCURACY_ 0.05 accuracy of the initial sublimation distances used in _VESNA_Find_Initial_Eta_Denominator
#define _SUBLIMATION_TOLERANCE_ 0.001 accuracy of the sublimation temperature
#define _INITIAL_GRID_ARRAY_theta_min 0.0 .
#define _INITIAL_GRID_ARRAY_theta_max (PI/2.0) min and max angle used in the initial grid array
#define _MIN_VERTEX_DISTANCE_ 0.2 minimal distance between two vertices in the units of _PAUK_size_limit. This is used in _PAUK_clean_the_vertex_list


_debugger_flags.h

struct _Debugger_Flags {
   int SCREEN_MESSAGE; -d : debug : run-time messages on the screen about the program status
   int STOP; -s n: stop : stop the running code at a position specified by the number "n"
   int CONTINUE; -c n: continue : start the program at the point where it has been stopped by "-s n" flag
};


_data_calc_output_flags.h

struct _Input_Data_Flags {
  int LAMBDA_TYPE; flag in the global input file which gives us information how the lambda grid is specified
  int SOURCE_TYPE; flag in the global input which gives us information how the source flux is specified
   int *DUST_TYPE; flag in the global input file which gives us information how the dust chemical and physical properties are specified. It will be an array from 0 to Max_Dust_Type-1. This will be used for calculation of the dust cross sections.
  int *DUST_DENSITY_TYPE; flag in the global input file which gives us information how the dust densities are specified
  char **DUST_DENSITY_TYPE_NAME; name of the models
};

/******** LIST OF THE DUST DENSITY MODELS *************/

DUST_DENSITY_TYPE=1
DUST_DENSITY_TYPE_NAME='Trinity Model'
     This model is used by Dejan Vinkovic for testing of the code and it doesn't have a fixed structure. DO NOT USE THIS MODEL!
----------------------
DUST_DENSITY_TYPE=2
DUST_DENSITY_TYPE_NAME='Smooth Sphere Model'
     This model is 1D and it is used by Dejan Vinkovic for testing of the code. The dust density is propotional to r -p.
----------------------
DUST_DENSITY_TYPE=3
DUST_DENSITY_TYPE_NAME='Ellipsoid Model'
     This model has the dust density = 1/(x2+ey2)n/2 and if e=1 then it is just a 1D sphere. By changing e, one can make ellipsoidal density profiles (introduced by Zeljko Ivezic & Dejan Vinkovic)
----------------------
DUST_DENSITY_TYPE=101
DUST_DENSITY_TYPE_NAME='CIT3 (Bonn2001)'
     CIT3 is an oxygen-rich AGB star. This model is created by Dejan Vinkovic during his visit to the Max Planck Istitute fuer Radioastronomie, Bonn (http://www.mpifr-bonn.mpg.de/)


_global_structures.h


struct _3DVector {
     double x,y,z;
};

/* dust density structure: it is defined by the list of parameters for each dust component */
struct density_parameters{
     struct density_parameters *next;
     double param;
};

/* structure of the grid vertices */
struct _vertex_structure {
     struct _vertex_structure *next, *prev;
     int identification_number;
     struct _vertex_structure *v1,*v2,*v3,*v4,*v5,*v6;
     int level;
     int type;
     double x, z;
     double *T_dust;
     double *T_error;
     double Eta;
     struct _vertex_triangles *triangles;
};

struct _vertex_triangles {
     struct _vertex_triangles *next;
     struct _triangle_structure *triangle;
     double nu;
};

/* structure of the grid triangles */
struct _triangle_structure {
     struct _triangle_structure *next, *prev;
     int ID_number;
     struct _vertex_structure *v1,*v2,*v3;
     int level;
     double bound_box_down_left_x, bound_box_down_left_z;
     double bound_box_up_right_x, bound_box_up_right_z;
     double integral_step;
};

/* structure of a polygon: they are used in a process of connecting the grid vertices into a triangle structure */
struct _polygon_structure {
     struct _polygon_structure *next,*prev;
     struct _vertex_structure *vertex;
     double optimal_angle;
     struct _polygon_structure *optimal_vertex;
};

/* structure of a quadrangle: they are used for corrections of the sublimation surfaces */
struct _quadrangle_structure {
     struct _quadrangle_structure *next;
     struct _vertex_structure *edge_vertex;
     struct _vertex_structure *next_edge_vertex;
     struct _vertex_structure *new_next_edge_vertex;
     struct _vertex_structure *new_edge_vertex;
     int dust_component;
     double bound_box_down_left_x, bound_box_down_left_z;
     double bound_box_up_right_x, bound_box_up_right_z;
};

/* structure of an integration direction: */
struct _integral_ray_structure {
     struct _integral_ray_structure *next;
     struct _3DVector direction;
     double weight;
};

/* the integration rays are build from spherical triangles (see _SVAROG_create_integral_directions for details): */
struct _spherical_triangle_structure {
     struct _spherical_triangle_structure *next;
     int parent_triangle_ID_number;
     int ID_number;
     int ray_counter;
     struct _3DVector v1,v2,v3;
};

/* structure of a list of grids: each wavelengths has its own grid, this list shows which grid belongs to which wavelength */
struct _grid_per_lambda_structure {
     double lambda;
     double tau;
     double *Ustar, *Usca, *Uem, *Utot_new;
     int TOTAL_NUMBER_OF_VERTICES;
     struct _vertex_structure *start_vertex;
     int TOTAL_NUMBER_OF_TRIANGLES;
     struct _triangle_structure *start_triangle;
};

/* structure of an image: image has many cells, each cell contains info about its location (polar coordinates) and the intensity */
struct _image_cell_structure {
     struct _image_cell_structure *next, *prev;
     double r1, r2, phi1, phi2;
     double *Intensity_em, *Intensity_sca, *Intensity_star;
     double *tau;
     int number_of_visible_points;
     int old_number_of_visible_points;
};

/* structure of luminosity cells (on spherical shells) */
struct _luminosity_cell_structure {
     struct _luminosity_cell_structure *next, *prev;
     int ID;
     double theta, theta_minus, theta_plus;
     double *Fstar;
     double *Fsca_plus, *Fsca_minus;
     double *Fem_plus, *Fem_minus;
};


_global_extern_variables.h


struct _Debugger_Flags DEBUG; .
struct _Input_Data_Flags INPUT; .
.
/*** lambda grid variables ***/
double *Lambda_Grid; vector with the wavelenghts at the grid points
int lambda_Max; total number of grid points: index of the last wavelength in the grid
.
/*** total optical depth variables ***/
double Tau_Total; total optical depth toward the central energy source at azimuthal angle Theta_Total_Value and wavelength Lambda_Total_Value. This optical depth is used for scaling of all other optical depths used in the program
double Theta_Total_Value; azimuthal angle which defines the line of total optical depth Tau_Total
int Theta_Total; integer representation of Theta_Total_Value in the angular grid of the central energy source
double Tau_Min_Grid; optical depth below which we do not calculate the radiative transfer matrix, but rather use the approximate solution of optically thin dust (used in combination with Lambda_Min_Grid)
double Lambda_Min_Grid; the shortest wavelength for which we can use the approximate solution of optically thin dust and avoid calculation of radiative transfer matrix (used in combination with Tau_Min_Grid)
double Grid_Tolerance_Tau_Factor; if we have already built a grid for an optical depth tau, then we will use the same grid for the optical depths between "tau*Grid_Tolerance_Tau_Factor" and "tau" (this also means that Grid_Tolerance_Tau_Factor has to be smaller than 1)
double Lambda_Total_Value; wavelength at which the total optical depth Tau_Total is specified
int Lambda_Total; integer representation of Lambda_Total_Value in Lambda_Grid
double *Source_Flux; the central 'point' source flux
double Rout; Outer radius of the dust envelope
double Source_Radius; The scaled radius of the source
double Source_Teff; The effective source temperature
.
/*** dust properties *********/
char **Dust_Component_Name; names of the dust components
double *Dust_Sublim_Temp; sublimation temperatures
int Max_Dust_Type; Total number of different dust type in the multigrain mixture
double **Sigma_Dust_Abs; dust absorption cross sections
double **Sigma_Dust_Sca; dust scattering cross sections
struct density_parameters *Dust_Density_Param; list of lists to all necessary parameters required for calculation of the dust density profiles for each of the dust components.
double Eta_Denominator; denominator in the Eta function
.
/*** radiative transfer variables ******/
double Psi; 'Psi' variable (see equations for definition)
struct _integral_ray_structure *integral_directions; angular integral in the radiative transfer. This is the list of integral rays. It has to be created for each grid point separately.
.
/*** triangular grid variables *********/
struct _vertex_structure *start_vertex_list; that is a pointer to the grid vertices which form a grid
struct _triangle_structure *start_triangle_list; when the vertices are connected into a mesh, they create triangles. This triangles are the mesh cells.
struct _grid_per_lambda_structure *grid_per_lambda; list of grids, one grid at each wavelength
struct _vertex_structure *start_old_vertex_list; vertex list from a previous iteration
struct _triangle_structure *start_old_triangle_list; triangle list form a previous iteration
struct _quadrangle_structure *start_quadrangle_list; these quadrangles are corrections of the sublimation surfaces. They are created in _PAUK_sublimation_extension and destroyed in _PAUK_main
int _INITIAL_GRID_ARRAY_r; total number of the radial grid steps
int _INITIAL_GRID_ARRAY_theta; total number of the angular grid steps in the array of intital approximation used for generation of the initial grid.
float ***initial_energy_array; array of the initial energy density and ...
float ***initial_temperature_array; ...initial dust temperature. This array is used for generation of the initial triangular grid
int START_LEVEL; the grid cell with their level number smaller or equal then START_LEVEL will be created for sure
double CELL_SIZE_LIMIT; the smallest geometrical size od a grid cell (at r=1)
double ETA_RATIO_LIMIT; ratio between eta values at two grid points has to be bigger than ETA_RATIO_LIMIT or 1/ETA_RATIO_LIMIT
int TOTAL_NUMBER_OF_VERTICES; total number of the grid vrtices
int TOTAL_NUMBER_OF_TRIANGLES; total number of the grid triangles
double epsilon_GRID_ERROR; tolerance in the optical depth criterium for a new grid point
.
/***** Luminosity/Flux calculation ************/
double Output_Lambda_Image; the wavelength at which we need an image (comes with the flag -L )
double Output_Theta_Image; the inclination angle at which we need an image (comes with the flag -A)
.
/*** Image plotting variables (output) ********/
int PLOT_IMAGE_SIZE_X; size of the plotted image (the GIF image will be lager. This is just the part with the data)
int PLOT_IMAGE_SIZE_Y; size of the plotted image (the GIF image will be lager. This is just the part with the data)
.
/*********** MPI variables *************/
int my_MPI_rank; rank of my process
int total_MPI_process; total number of processes
MPI_Comm MPI_communicator; .


BJESOMAR.h

void _BJESOMAR__Error_Message (int err_location, int err);
void _BJESOMAR__Debugger_Message (int message_location, int message);
int _BJESOMAR_Dump_Data_STOP2 ( void );
void _BJESOMAR_Dump_Data_STOP202 (FILE *DUMP_FILE);


DAZhBOG.h

int _DAZhBOG__Read_Input_Data (FILE *GLOBAL_FILE, char Global_File_Name[]);
int _DAZhBOG__Search_for_char (FILE *INPUT_FILE, char *SEARCH_CHAR);
int _DAZhBOG__Read_Lambda_Grid (FILE *GLOBAL_FILE);
int _DAZhBOG__Read_Tau_Total (FILE *GLOBAL_FILE);
int _DAZhBOG__Read_Dust_Sigmas (FILE *GLOBAL_FILE, int dust_counter);
int _DAZhBOG__Read_Abs_Sca (FILE *INPUT_FILE, double *Absorption, double *Scattering);
int _DAZhBOG__Read_Source_Flux (FILE *GLOBAL_FILE);
int _DAZhBOG__Read_Density_Type (FILE *GLOBAL_FILE, int dust_counter);


MATH_LIB.h

int _MATH_LIB_linear_interpolation (double x1, double y1, double x2, double y2, double x, double *y);
int _MATH_LIB_log_interpolation (double x1, double y1, double x2, double y2, double x, double *y);
double _MATH_LIB_simpson (int N, int N1, int N2, double *x, double *y);
double _MATH_LIB_Planck (double T, double lambda);
double _MATH_LIB_Ridder_Root ( double (*equilibrium)(double, double, double, int, double), double x, double z, int dust_component, double Function2, double T1, double T2, double T_acc, int *err);
double _MATH_LIB_distance (double x1, double y1, double x2, double y2);
int _MATH_LIB_intersecting_lines (double Ax, double Ay, double Bx, double By, double Cx, double Cy, double Dx, double Dy);
double _MATH_LIB_nu_value (double x0, double y0, double x1, double y1, double x2, double y2);
double _MATH_LIB_plane_interpolation (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x , double y);
struct _3DVector _MATH_LIB_3D_vector_product (struct _3DVector v1, struct _3DVector v2) ;
double _MATH_LIB_3Ddistance (struct _3DVector p1, struct _3DVector p2);


PAUK.h

int _PAUK_main (int status);
int _PAUK_initialize_initial_arrays (int status);
struct _vertex_structure *_PAUK_create_vertex (int *error);
int _PAUK_destroy_vertex (struct _vertex_structure *v);
struct _triangle_structure *_PAUK_create_triangle (int *error);
int _PAUK_destroy_triangle (struct _triangle_structure *t);
int _PAUK_create_initial_array (void);
double _PAUK_initial_temperature (double x, double z, int dust_i);
double _PAUK_initial_energy_density (double x, double z, int lambda_k);
double _PAUK_temperature (double x, double z, int dust_i, int status);
double _PAUK_optical_depth_distance (double Ax, double Az, double Bx, double Bz, int lambda_computational_grid, int status, short int *split_flag);
int _PAUK_analyze_triangle (struct _triangle_structure *parent_triangle, int lambda_computational_grid, int status);
double _PAUK_distance_to_edge (struct _vertex_structure *point, double edge_point_x, double edge_point_z, int lambda_computational_grid, double *edge_point_distance, int status);
int _PAUK_edge_triangles_removal (int lambda_computational_grid, int status);
struct _polygon_structure *_PAUK_create_polygon_point (struct _polygon_structure *polygon, int *error);
int _PAUK_split_polygon (struct _polygon_structure *polygon);
struct _vertex_structure *_PAUK_adjacent_vertex_in_triangle (struct _vertex_structure *v, struct _triangle_structure *t);
struct _vertex_structure *_PAUK_adjacent_antivertex_in_triangle (struct _vertex_structure *v, struct _triangle_structure *t);
int _PAUK_clean_the_vertex_list (void);
struct _triangle_structure *_PAUK_adjacent_triangle (struct _vertex_structure *vertex, struct _triangle_structure *triangle);
int _PAUK_sublimation_extension (void);
int _PAUK_locate_point_in_old_grid (double x, double z, int dust_i, struct _triangle_structure **old_triangle, struct _quadrangle_structure **old_quadrangle);
struct _vertex_triangles *_PAUK_create_new_vertex_triangle ( struct _triangle_structure *triangle, struct _vertex_structure *vertex);


RADGOST.h

double Total_Source_Flux (int lambda_count, double x, double z, int *err);
double Find_Source_Flux (int lambda_count, double cos_theta, double cos_alpha, double impact_b, int *err);
double Dust_Density (double x, double z, int dust_counter, int *err);
double q_abs (double x, double z, int lambda_i, int dust_component, int *err);
double albedo (double x, double z, int lambda_i, int dust_component, int *err);
double upsilon (double x, double z, int lambda_i, int dust_component, double *T, int *err);
double Eta (double x, double z, int lambda_i, double *T, int *err);
int _RADGOST_Scale_Cross_Sections (void);
int _RADGOST_exchange_components (int dust1, int dust2);
double _RADGOST_size_limit (double x, double z);
double _RADGOST_3Dstep (struct _3DVector startpoint, struct _triangle_structure *starttriangle, struct _3DVector direction, struct _3DVector *finalpoint, struct _triangle_structure **finaltriangle);
int _RADGOST_locate_point_in_grid (double x, double z, struct _triangle_structure **find_triangle);
int _RADGOST_locate_nearby_point_in_grid (double x, double z, struct _vertex_structure **find_vertex);
double _RADGOST_tau_over_grid (struct _3DVector startpoint, struct _3DVector endpoint, int lambda_k);
int _RADGOST_Eta_Denominator (void);
int _RADGOST_Find_Source_Radius (void);
struct _vertex_structure *_RADGOST_Find_Adjacent_Temperature (struct _vertex_structure *v, int dust_i);


SVAROG.h

double _SVAROG_Find_Temperature (double x, double z, double T1, double T2, int dust_component, double *U, int *err);
double _SVAROG_Equilibrium (double T, double x, double z, int dust_component, double Function2);
struct _integral_ray_structure *_SVAROG_create_integral_directions (struct _vertex_structure *central_vertex);
int _SVAROG_Find_Psi (void);


VESNA.h

int _VESNA__Analyze_Input_Flags (int argc, char *argv[], char Root_Directory[], char Main_Dusty_File[]);
int _VESNA_Find_Initial_Eta_Denominator (void);
int _VESNA_Read_Data_CONTINUE2 ( FILE *DUMP_FILE );
int _VESNA_Read_Data_CONTINUE202 (FILE *DUMP_FILE);


ZMAJ.h

int _ZMAJ_main (void);
void _ZMAJ_Radiative_Transfer_Solver (int Lambda_List_Total, int *Lambda_List);
void _ZMAJ_Radiative_Transfer_Emission (int Lambda_List_Total, int *Lambda_List);
int _ZMAJ_Output_Image_Flux (double theta_view, int *TOTAL_NUMBER_OF_IMAGE_CELLS, struct _image_cell_structure **Image_);
int _ZMAJ_Find_New_Temperature ( void );
double _ZMAJ_Intensity_Integral (int lambda_k, struct _3DVector start_point, struct _3DVector integral_direction, double *Intensity_em, double *Intensity_sca);
int _ZMAJ_Luminosity_shells (void);
int _ZMAJ_Radial_Profiles (void);