![]() |
Classes | |
struct | utt_patches |
struct | utt_time_measurement |
struct | utt_paraview_field_descriptor |
Modules | |
Boundary Condition Utilities | |
IO Compression Utilities | |
Input-Ouput Utilities | |
Input-Ouput Results Utilities | |
Logging Utilities | |
Materials Utilities | |
Mesh Utilities | |
Mathematical Expression IO Utilities | |
Defines | |
#define | UTC_LIST_END_MARK -1 |
#define | UTC_MAXEL_PATCH 100 |
#define | UTC_MAXNO_PATCH 200 |
#define | UTC_MAX_INT_ENT_NEIG 300 |
Enumerations | |
enum | ute_paraview_flags { UTE_POINT_DATA = 0, UTE_CELL_DATA, UTE_SCALARS, UTE_VECTORS, UTE_TENSORS, UTE_DOUBLE, UTE_INT, UTE_VTK_LEGACY_FORMAT, UTE_VTK_XML, UTE_LAST } |
Functions | |
void | utr_ctrl_c_signal_handler (int param) |
void | utr_reset_time_counters (int Control) |
void | utr_display_time_counters (int Control) |
int | utr_set_interactive (char *Workdir, int Argc, char **Argv, FILE **Interactive_input, FILE **Interactive_output) |
int | utr_initialize_mesh (FILE *Interactive_output, const char *Work_dir, char Mesh_type, const char *Mesh_file) |
int | utr_initialize_field (FILE *Interactive_output, char Field_type, char Control, int Mesh_id, int Nreq, int Nr_sol, int Pdeg, char *Filename, double(*Fun_p)(int, double *, int)) |
int | utr_write_paraview_std_lin (int Mesh_id, int Field_id, const char *Workdir, const char *Filename, ute_paraview_flags VTK_file_version) |
utr_write_paraview_std_lin - to dump std_lin mesh and field in Paraview format | |
int | utr_write_paraview_mesh (int Mesh_id, const char *Work_dir, const char *Filename, ute_paraview_flags VTK_file_version) |
void | utr_write_paraview_partmesh (int Mesh_id, const char *Work_dir, const char *Filename, int *Parts, ute_paraview_flags VTK_file_version) |
int | utr_write_paraview_fields (const char *Work_dir, const char *Filename, double Current_time, const int N_descriptors, utt_paraview_field_descriptor *Field_descriptors, ute_paraview_flags VTK_file_version) |
int | utr_write_paraview_tensor (int Field_id, FILE *File, int *Dofs_write, double dt) |
int | utr_write_paraview_bc (int Mesh_id, const char *Work_dir, const char *Filename, ute_paraview_flags VTK_file_version) |
int | utr_get_ent_dofs (int Problem_id, int Dof_ent_type, int Dof_ent_id, int Nrdofs, int Vect_id, double *Vect_dofs) |
int | utr_create_patches (int Problem_id, utt_patches **patches_p) |
int | utr_create_patches_small (int Problem_id, utt_patches **patches_p) |
int | utr_recover_derivatives (int Field_id, int Sol_vec_id, int Nr_patches, utt_patches *patches) |
int | utr_recover_derivatives_small (int Field_id, int Sol_vec_id, int Nr_patches, utt_patches *patches) |
int | utr_adapt (int Problem_id, char *Work_dir, FILE *Interactive_input, FILE *Interactive_output) |
int | utr_test_refinements (int Problem_id, char *Work_dir, FILE *Interactive_input, FILE *Interactive_output) |
int | utr_manual_refinement (int Problem_id, char *Work_dir, FILE *Interactive_input, FILE *Interactive_output) |
int | utr_get_list_ent (int Problem_id, int *Nr_int_ent, int **List_int_ent_type, int **List_int_ent_id, int *Nr_dof_ent, int **List_dof_ent_type, int **List_dof_ent_id, int **List_dof_ent_nrdofs, int *Nrdofs_glob, int *Max_dofs_per_dof_ent) |
int | utr_get_list_dof_ent (int Problem_id, int *Nr_int_ent, int **List_int_ent_type, int **List_int_ent_id, int *Nr_dof_ent, int **List_dof_ent_type, int **List_dof_ent_id, int **List_dof_ent_nrdofs, int *Nrdofs_glob, int *Max_dofs_per_dof_ent) |
int | utr_get_list_int_ent (int Problem_id, int *Nr_int_ent, int **List_int_ent_type, int **List_int_ent_id) |
int | utr_get_list_ent_coarse (int Problem_id, int Nr_int_ent_fine, int *List_int_ent_type_fine, int *List_int_ent_id_fine, int Nr_dof_ent_fine, int *List_dof_ent_type_fine, int *List_dof_ent_id_fine, int *List_dof_ent_nrdof_fine, int Nrdof_glob_fine, int Max_dof_per_ent_fine, int *Pdeg_coarse_p, int *Nr_int_ent_p, int **List_int_ent_type, int **List_int_ent_id, int *Nr_dof_ent_p, int **List_dof_ent_type, int **List_dof_ent_id, int **List_dof_ent_nrdofs, int *Nrdofs_glob_p, int *Max_dofs_per_dof_ent_p) |
int | utr_get_max_num_grid_levels (int Problem_id) |
int | utr_dof_ent_sons (int Problem_id, int Ent_type, int Ent_id, int *Ent_sons) |
int | utr_comp_stiff_mat (int Problem_id, int Int_ent_type, int Int_ent_id, int Comp_sm, int *Pdeg_vec, int *Nr_dof_ent, int *List_dof_ent_type, int *List_dof_ent_id, int *List_dof_ent_nrdofs, int *Nrdofs_loc, double *Stiff_mat, double *Rhs_vect, char *Rewr_dofs) |
int | utr_create_assemble_stiff_mat (int Problem_id, int Level_id, int Comp_type, int *Pdeg_coarse_p, int Nr_int_ent, int *L_int_ent_type, int *L_int_ent_id, int Nr_colors_elems, int *L_color_index_elems, int Nr_colors_faces, int *L_color_index_faces, int *Asse_pos_first_dof_int_ent, int *Assembly_table, int *Pos_first_dof_int_ent, int *Local_to_global, int Max_dofs_int_ent) |
int | utr_rewr_sol (int Field_id, int Sol_from, int Sol_to) |
void | utr_renumber (int Nr_vertices, int *Nrneig, int **L_neig, int *Permutation_array) |
double | utr_average_sol_el (int Field_id, int El) |
double * | utr_dvector (int ncom, char error_text[]) |
int * | utr_ivector (int ncom, char error_text[]) |
void | utr_d_zero (double *Vec, int Num) |
int | utr_chk_list (int Num, int *List, int Ll) |
int | utr_put_list (int Num, int *List, int Ll) |
double | utr_mat3_inv (const double *mat, double *mat_inv) |
void | utr_vec3_add (const double vec_a[3], const double vec_b[3], double vec_c[3]) |
void | utr_vec3_subst (const double vec_a[3], const double vec_b[3], double vec_c[3]) |
void | utr_vec3_prod (const double *vec_a, const double *vec_b, double *vec_c) |
double | utr_vec3_mxpr (const double *vec_a, const double *vec_b, const double *vec_c) |
double | utr_vec3_length (const double *vec) |
void | utr_mat3vec (const double *m1, const double *v1, double *v2) |
void | utr_mat3mat (const double *m1, const double *m2, double *m3) |
double | utr_vec3_dot (const double vec_a[3], const double vec_b[3]) |
double | utr_vec3_angle (const double vec_a[3], const double vec_b[3]) |
double | utr_mat_det (const double *m, int n, char store, double *det) |
void | utr_skip_rest_of_line (FILE *Fp) |
int | utr_fprintf_double (FILE *stream, int sdigits, double value) |
void | utr_heap_sort (int *Ind_array, double *Val_array) |
int | utr_insert_sort (int *A, int p, int k) |
int | utr_io_read_mesh (const int Mesh_id, const char *Working_dir, const char *Mesh_files_regex, const char Mesh_type) |
Definitions:. | |
int | utr_export_field (int Field_id, int Nreq, int Select, int Accuracy, char *Filename) |
int | utr_io_export_mesh (FILE *Interactive_output, const int Mesh_id, char Mesh_type, char *Mesh_file) |
int | utr_menu_export_mesh (FILE *Interactive_output, FILE *Interactive_input, const int Mesh_id, const char *Work_dir, char *Mesh_file) |
int | utr_io_write_img_to_pbm (const char *Work_dir, const char *Filename, const char *Comment, const int Width, const int Height, const int Max_color_component_value, const int Magic_number, const unsigned char *Img_data, FILE *Interactive_output) |
int | utr_io_write_mesh_info_to_PAM (int Mesh_id, const char *Work_dir, const char *Filename, const char *Comment, FILE *Interactive_output) |
int | utr_io_write_img_to_pam (const char *Work_dir, const char *Filename, const int Width, const int Height, const int Depth, const int Maxval, const char *TUPLTYPE, const char *Img_data, FILE *Interactive_output) |
int | utr_io_write_img_to_pnm (const char *Work_dir, const char *Filename, const char *Comment, const int Width, const int Height, const int Max_color_component_value, const int Magic_number, const char *Img_data, FILE *Interactive_output) |
int | utr_color_int_ent_for_assembly (int Problem_id, int Level_id, int nr_elems, int nr_faces, int *L_int_ent_type, int *L_int_ent_id, int nr_dof_ent, int *nr_int_ent_loc, int **l_int_ent_index, int *Nr_colors_elems, int **L_color_index_elems, int *Nr_colors_faces, int **L_color_index_faces) |
int | utr_ctrl_pts_init (const char *Work_dir, const char *Filename, const int N_solutions, const char *Target_ctrl_pts_filename) |
utr_ctrl_pts_init - to initialize 'control points' functionality. It is coupled with utr_io_results_... functions, but to simplify useage this function wraps up several setup steps to make it work properly. | |
int | utr_ctrl_pts_add_values (const int Field_id) |
utr_ctrl_pts_add_values - this function computes values at previously defined control points and stores them until they will we written to the file when utr_io_result_write_values_and_proceed will be called. NOTE that before this function can be called, the utr_ctrl_pts_init must be called! This function can be called several times, to store more values from different fields, but no more then first N_solutions given in utr_ctrl_pts_init will be saved to file. | |
int | utr_generate_int_ent_coloring (const int nr_int_ent, int **elem2elem, int *Elem_colors) |
Variables | |
utt_time_measurement | utv_time |
int | utv_SIGINT_not_caught |
#define UTC_LIST_END_MARK -1 |
#define UTC_MAX_INT_ENT_NEIG 300 |
#define UTC_MAXEL_PATCH 100 |
definition of type utt_patches - useful e.g. for error estimation
#define UTC_MAXNO_PATCH 200 |
enum ute_paraview_flags |
int utr_adapt | ( | int | Problem_id, | |
char * | Work_dir, | |||
FILE * | Interactive_input, | |||
FILE * | Interactive_output | |||
) |
-------------------------------------------------------- utr_adapt - to enforce default adaptation strategy for SINGLE problem/field ---------------------------------------------------------
Problem_id | returns: >0 - success, <=0 - failure | |
Work_dir | in: problem data structure to be used |
double utr_average_sol_el | ( | int | Field_id, | |
int | El | |||
) |
-------------------------------------------------------- utr_average_sol_el - to compute the average of solution over element ----------------------------------------------------------
Field_id | returns: the average of solution over element | |
El | in: data structure to be used in: element number |
int utr_chk_list | ( | int | Num, | |
int * | List, | |||
int | Ll | |||
) |
-------------------------------------------------------- utr_chk_list - to check whether Num is on the list List with length Ll ---------------------------------------------------------
int utr_color_int_ent_for_assembly | ( | int | Problem_id, | |
int | Level_id, | |||
int | nr_elems, | |||
int | nr_faces, | |||
int * | L_int_ent_type, | |||
int * | L_int_ent_id, | |||
int | nr_dof_ent, | |||
int * | nr_int_ent_loc, | |||
int ** | l_int_ent_index, | |||
int * | Nr_colors_elems, | |||
int ** | L_color_index_elems, | |||
int * | Nr_colors_faces, | |||
int ** | L_color_index_faces | |||
) |
int utr_comp_stiff_mat | ( | int | Problem_id, | |
int | Int_ent_type, | |||
int | Int_ent_id, | |||
int | Comp_sm, | |||
int * | Pdeg_vec, | |||
int * | Nr_dof_ent, | |||
int * | List_dof_ent_type, | |||
int * | List_dof_ent_id, | |||
int * | List_dof_ent_nrdofs, | |||
int * | Nrdofs_loc, | |||
double * | Stiff_mat, | |||
double * | Rhs_vect, | |||
char * | Rewr_dofs | |||
) |
int utr_create_assemble_stiff_mat | ( | int | Problem_id, | |
int | Level_id, | |||
int | Comp_type, | |||
int * | Pdeg_coarse_p, | |||
int | Nr_int_ent, | |||
int * | L_int_ent_type, | |||
int * | L_int_ent_id, | |||
int | Nr_colors_elems, | |||
int * | L_color_index_elems, | |||
int | Nr_colors_faces, | |||
int * | L_color_index_faces, | |||
int * | Asse_pos_first_dof_int_ent, | |||
int * | Assembly_table, | |||
int * | Pos_first_dof_int_ent, | |||
int * | Local_to_global, | |||
int | Max_dofs_int_ent | |||
) |
----------------------------------------------------------- utr_create_assemble_stiff_mat - to create element stiffness matrices and assemble them to the global SM (implementation provided separately for different multithreaded environments) ------------------------------------------------------------
Pdeg_coarse_p | in: indicator for the scope of computations: |
int utr_create_patches | ( | int | Problem_id, | |
utt_patches ** | patches_p | |||
) |
-------------------------------------------------------- utr_create_patches - to create patches of elements containing a given node (uses only mesh data - can be the same for all fields) ---------------------------------------------------------
Problem_id | returns: >0 - Nr_patches, <=0 - failure | |
patches_p | in: problem data structure to be used in/out - array of patches for real nodes |
int utr_create_patches_small | ( | int | Problem_id, | |
utt_patches ** | patches_p | |||
) |
-------------------------------------------------------- utr_create_patches - to create patches of elements containing a given node (uses only mesh data - can be the same for all fields) ---------------------------------------------------------
!!ino=0
Problem_id | returns: >0 - Nr_patches, <=0 - failure | |
patches_p | in: problem data structure to be used in/out - array of patches for real nodes |
void utr_ctrl_c_signal_handler | ( | int | param | ) |
switch
int utr_ctrl_pts_add_values | ( | const int | Field_id | ) |
utr_ctrl_pts_add_values - this function computes values at previously defined control points and stores them until they will we written to the file when utr_io_result_write_values_and_proceed will be called. NOTE that before this function can be called, the utr_ctrl_pts_init must be called! This function can be called several times, to store more values from different fields, but no more then first N_solutions given in utr_ctrl_pts_init will be saved to file.
Field_id | - ID of field to compute values from at control points. |
utr_ctrl_pts_add_values - this function computes values at previously defined control points and stores them until they will we written to the file when utr_io_result_write_values_and_proceed will be called. NOTE that before this function can be called, the utr_ctrl_pts_init must be called! This function can be called several times, to store more values from different fields, but no more then first N_solutions given in utr_ctrl_pts_init will be saved to file.
Field_id |
int utr_ctrl_pts_init | ( | const char * | Work_dir, | |
const char * | Filename, | |||
const int | N_solutions, | |||
const char * | Target_ctrl_pts_filename | |||
) |
utr_ctrl_pts_init - to initialize 'control points' functionality. It is coupled with utr_io_results_... functions, but to simplify useage this function wraps up several setup steps to make it work properly.
Work_dir | - working directory in which Filename will be searched and Target_ctrl_pts_filename will be saved. | |
Filename | - name of file from which 'control_points' block will be loaded (e.g. problem.dat). | |
N_solutions | - number of values from all fields wich will be stored at each control point in each time step. Usually this could be the sum of apr_get_nreq for all desired fields. | |
Target_ctrl_pts_filename | - name of file in which control points values will be stored (e.g. control_points.csv). |
void utr_d_zero | ( | double * | Vec, | |
int | Num | |||
) |
-------------------------------------------------------- utr_d_zero - to zero a double vector of length Num ---------------------------------------------------------
Num | in, out: vector to initialize in: vector length |
void utr_display_time_counters | ( | int | Control | ) |
-------------------------------------------------------- utr_display_time_counters ----------------------------------------------------------
int utr_dof_ent_sons | ( | int | Problem_id, | |
int | Ent_type, | |||
int | Ent_id, | |||
int * | Ent_sons | |||
) |
double* utr_dvector | ( | int | ncom, | |
char | error_text[] | |||
) |
-------------------------------------------------------- utr_dvector - to allocate a double vector: name[0..ncom-1]: name=ut_dvector(ncom,error_text) ---------------------------------------------------------
ncom | return: pointer to allocated vector | |
error_text | in: number of components in: error text to be printed |
int utr_export_field | ( | int | Field_id, | |
int | Nreq, | |||
int | Select, | |||
int | Accuracy, | |||
char * | Filename | |||
) |
-------------------------------------------------------- utr_io_export_field - to export mesh of a specified type ---------------------------------------------------------
-------------------------------------------------------- utr_export_field - to export mesh of a specified type ---------------------------------------------------------
Field_id | returns number of files exported |
int utr_fprintf_double | ( | FILE * | stream, | |
int | sdigits, | |||
double | value | |||
) |
------------------------------------------------------------ utr_fprintf_double - prints double to stream in "%f" fashion with specified significant digits number -------------------------------------------------------------
int utr_generate_int_ent_coloring | ( | const int | nr_int_ent, | |
int ** | elem2elem, | |||
int * | Elem_colors | |||
) |
int utr_get_ent_dofs | ( | int | Problem_id, | |
int | Dof_ent_type, | |||
int | Dof_ent_id, | |||
int | Nrdofs, | |||
int | Vect_id, | |||
double * | Vect_dofs | |||
) |
Dof_ent_type | in: solver ID (used to identify the subproblem) | |
Vect_dofs | in: vector ID in case of multiple solution vectors in: dofs to be written |
int utr_get_list_dof_ent | ( | int | Problem_id, | |
int * | Nr_int_ent, | |||
int ** | List_int_ent_type, | |||
int ** | List_int_ent_id, | |||
int * | Nr_dof_ent, | |||
int ** | List_dof_ent_type, | |||
int ** | List_dof_ent_id, | |||
int ** | List_dof_ent_nrdofs, | |||
int * | Nrdofs_glob, | |||
int * | Max_dofs_per_dof_ent | |||
) |
int utr_get_list_ent | ( | int | Problem_id, | |
int * | Nr_int_ent, | |||
int ** | List_int_ent_type, | |||
int ** | List_int_ent_id, | |||
int * | Nr_dof_ent, | |||
int ** | List_dof_ent_type, | |||
int ** | List_dof_ent_id, | |||
int ** | List_dof_ent_nrdofs, | |||
int * | Nrdofs_glob, | |||
int * | Max_dofs_per_dof_ent | |||
) |
----------------------------------------------------------- utr_get_list_ent - to return the list of integration entities - entities for which stiffness matrices and load vectors are provided by the FEM code to the solver module, and DOF entities - entities with which there are dofs associated by the given approximation ------------------------------------------------------------
Problem_id | returns: >=0 - success code, <0 - error code | |
Nr_int_ent | in: problem (and solver) identification | |
List_int_ent_type | out: number of integration entitites GHOST ENTITIES HAVE NEGATIVE TYPE !!! | |
List_int_ent_id | out: list of types of integration entitites | |
Nr_dof_ent | out: list of IDs of integration entitites GHOST DOF ENTITIES HAVE NEGATIVE TYPE !!! | |
List_dof_ent_type | out: number of dof entities (entities with which there are dofs associated by the given approximation) | |
List_dof_ent_id | out: list of types of integration entitites | |
List_dof_ent_nrdofs | out: list of IDs of integration entitites | |
Nrdofs_glob | out: list of no of dofs for 'dof' entity | |
Max_dofs_per_dof_ent | out: global number of degrees of freedom (unknowns) out: maximal number of dofs per dof entity |
int utr_get_list_ent_coarse | ( | int | Problem_id, | |
int | Nr_int_ent_fine, | |||
int * | List_int_ent_type_fine, | |||
int * | List_int_ent_id_fine, | |||
int | Nr_dof_ent_fine, | |||
int * | List_dof_ent_type_fine, | |||
int * | List_dof_ent_id_fine, | |||
int * | List_dof_ent_nrdof_fine, | |||
int | Nrdof_glob_fine, | |||
int | Max_dof_per_ent_fine, | |||
int * | Pdeg_coarse_p, | |||
int * | Nr_int_ent_p, | |||
int ** | List_int_ent_type, | |||
int ** | List_int_ent_id, | |||
int * | Nr_dof_ent_p, | |||
int ** | List_dof_ent_type, | |||
int ** | List_dof_ent_id, | |||
int ** | List_dof_ent_nrdofs, | |||
int * | Nrdofs_glob_p, | |||
int * | Max_dofs_per_dof_ent_p | |||
) |
----------------------------------------------------------- utr_get_list_ent_coarse - to return the list of integration entities - entities for which stiffness matrices and load vectors are provided by the FEM code to the solver module, and DOF entities - entities with which there are dofs associated by the given approximation for COARSE level given the corresponding lists from the fine level (it calls separate implementations for dg and std?) ------------------------------------------------------------
int utr_get_list_int_ent | ( | int | Problem_id, | |
int * | Nr_int_ent, | |||
int ** | List_int_ent_type, | |||
int ** | List_int_ent_id | |||
) |
int utr_get_max_num_grid_levels | ( | int | Problem_id | ) |
void utr_heap_sort | ( | int * | Ind_array, | |
double * | Val_array | |||
) |
-------------------------------------------------------- utr_heap_sort - to heap-sort an array (code taken from fortran...) ---------------------------------------------------------
Val_array | in/out: index array for sorting Ind_array[0] - the length of both arrays in: array of values used for sorting |
int utr_initialize_field | ( | FILE * | Interactive_output, | |
char | Field_type, | |||
char | Control, | |||
int | Mesh_id, | |||
int | Nreq, | |||
int | Nr_sol, | |||
int | Pdeg, | |||
char * | Filename, | |||
double(*)(int, double *, int) | Fun_p | |||
) |
-------------------------------------------------------- utr_initialize_field - to initialize field of a specified type ---------------------------------------------------------
Interactive_output | returns: >0 - field ID, <0 - error code | |
Field_type | file or stdout to write messages | |
Control | options: s - standard, d - discontinuous | |
Mesh_id | in: control variable: z - to initialize the field to zero r - to read field values from the file i - to initialize the field using function provided by the problem dependent module | |
Nreq | in: ID of the corresponding mesh | |
Nr_sol | in: number of equations - solution vector components | |
Pdeg | in: number of solution vectors for each dof entity | |
Filename | in: degree of approximating polynomial | |
Fun_p | in: name of the file to read approximation data pointer to function that provides problem dependent initial condition data |
int utr_initialize_mesh | ( | FILE * | Interactive_output, | |
const char * | Work_dir, | |||
char | Mesh_type, | |||
const char * | Mesh_file | |||
) |
-------------------------------------------------------- utr_initialize_mesh - to initialize mesh of a specified type ---------------------------------------------------------
Interactive_output | returns mesh_id | |
Work_dir | file or stdout to write messages | |
Mesh_file | letter symbol denoting mesh_type (j, p, t or h) mesh file name - conforming to naming convention |
int utr_insert_sort | ( | int * | A, | |
int | p, | |||
int | k | |||
) |
-------------------------------------------------------- utr_insert_sort - to sort an array by insertion (for small integer arrays) ---------------------------------------------------------
int utr_io_export_mesh | ( | FILE * | Interactive_output, | |
const int | Mesh_id, | |||
char | Mesh_type, | |||
char * | Mesh_file | |||
) |
-------------------------------------------------------- utr_io_export_mesh - to export mesh of a specified type ---------------------------------------------------------
Interactive_output | returns number of files exported | |
Mesh_id | file or stdout to write messages | |
Mesh_file | symbol denoting mesh_type mesh file name - conforming to naming convention |
int utr_io_read_mesh | ( | const int | Mesh_id, | |
const char * | Working_dir, | |||
const char * | Mesh_files_regex, | |||
const char | Mesh_type | |||
) |
Definitions:.
-------------------------------------------------------- utr_io_read_mesh - to read mesh with given filename(s) ------------------------------------------------------- Reads all mesh files from current working directory that matches with passed regular expression Mesh_files_regex. All files HAVE TO be the same type (ex. nas,dat,in etc.). NOTE: single filename ex. "mesh.dat" is also a valid regular expression. ------------------------------------------------------- What this function does in short: 1. Gather files list form directory. 2. Filter files list with mesh filename regex. 3. Sort in alphabetic order. 4. Loop over selected files and read each one. -------------------------------------------------------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT NOTE: if there is available more than one process, then each process will recive one file to read. NOTE: if there is more processes than files, mesh needs to be redistributed (balancing)! NOTE: if there is more files than processes, processes will recive (in continues manner) more files to read. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1. Gather files list form directory.
2. Filter files list with mesh filename regex.
1B. Gather files list form directory.
2B. Filter files list with mesh filename regex.
3. Sort in alphabetic order.
4. Loop over selected files and read each one.
!PARALLEL
Make filename a valid path to file.
Mesh_id | returns: > 0 - number of files correctly read; <=0 - error | |
Working_dir | IN: id of mesh to write to | |
Mesh_files_regex | IN: directory with mesh files | |
Mesh_type | IN: regular expression pattern NOTE: using regex 'POSIX grep' standardIN: mesh type character (the same for all files!) |
int utr_io_write_img_to_pam | ( | const char * | Work_dir, | |
const char * | Filename, | |||
const int | Width, | |||
const int | Height, | |||
const int | Depth, | |||
const int | Maxval, | |||
const char * | TUPLTYPE, | |||
const char * | Img_data, | |||
FILE * | Interactive_output | |||
) |
utr_io_write_img_to_pam - to write data into PAM image file. http:///en.wikipedia.org/wiki/Netpbm Allowed combinations of parameters: ----------------------------------------------------------- TUPLTYPE |MAXVAL |DEPTH |comment ----------------------------------------------------------- BLACKANDWHITE 1 1 special case of GRAYSCALE GRAYSCALE 2…65535 1 2 bytes per pixel for MAXVAL > 255 RGB 1…65535 3 6 bytes per pixel for MAXVAL > 255 BLACKANDWHITE_ALPHA 1 2 2 bytes per pixel GRAYSCALE_ALPHA 2…65535 2 4 bytes per pixel for MAXVAL > 255 RGB_ALPHA 1…65535 4 8 bytes per pixel for MAXVAL > 255 -----------------------------------------------------------
Work_dir | returns 0 if all ok. | |
Filename | Directory to write in. | |
Width | without extension | |
Height | >0 | |
Depth | >0 | |
Maxval | <1:4> | |
TUPLTYPE | <1:65535>, | |
Interactive_output | [Width*Height*byte per pixel] pointer to the array with image data |
int utr_io_write_img_to_pbm | ( | const char * | Work_dir, | |
const char * | Filename, | |||
const char * | Comment, | |||
const int | Width, | |||
const int | Height, | |||
const int | Max_color_component_value, | |||
const int | Magic_number, | |||
const unsigned char * | Img_data, | |||
FILE * | Interactive_output | |||
) |
bit per pixel = 1
Work_dir | returns 0 if all ok. | |
Filename | Directory to write in. | |
Comment | without extension | |
Width | written into img file header, can be NULL if no comment. | |
Height | >0 | |
Max_color_component_value | >0 | |
Img_data | {1,4} | |
Interactive_output | pointer to the array with image data |
int utr_io_write_img_to_pnm | ( | const char * | Work_dir, | |
const char * | Filename, | |||
const char * | Comment, | |||
const int | Width, | |||
const int | Height, | |||
const int | Max_color_component_value, | |||
const int | Magic_number, | |||
const char * | Img_data, | |||
FILE * | Interactive_output | |||
) |
utr_io_write_img_to_pnm - to write data into PNM image file. The Portable Bit/Grey/PixMap formats PBM, PGM, PPM. They are collectively referred to as PNM (Portable aNy Map). http:///en.wikipedia.org/wiki/Netpbm_format Allowed combinations: ----------------------------------------------------------- Type Magic number Extension Colors ----------------------------------------------------------- Portable BitMap P4 binary .pbm 0–1 (black & white) Portable GrayMap P5 binary .pgm 0–255 (gray scale) Portable PixMap P6 binary .ppm 0–255 (RGB) -----------------------------------------------------------
bytes per pixel = 1
Work_dir | returns 0 if all ok. | |
Filename | Directory to write in. | |
Comment | without extension | |
Width | written into img file header, can be NULL if no comment. | |
Height | >0 | |
Max_color_component_value | >0 | |
Img_data | {4,5,6} | |
Interactive_output | pointer to the array with image data |
int utr_io_write_mesh_info_to_PAM | ( | int | Mesh_id, | |
const char * | Work_dir, | |||
const char * | Filename, | |||
const char * | Comment, | |||
FILE * | Interactive_output | |||
) |
int* utr_ivector | ( | int | ncom, | |
char | error_text[] | |||
) |
-------------------------------------------------------- utr_ivector - to allocate an integer vector: name[0..ncom-1]: name=ut_ivector(ncom,error_text) ---------------------------------------------------------
ncom | return: pointer to allocated vector | |
error_text | in: number of components in: error text to be printed |
int utr_manual_refinement | ( | int | Problem_id, | |
char * | Work_dir, | |||
FILE * | Interactive_input, | |||
FILE * | Interactive_output | |||
) |
-------------------------------------------------------- utr_manual_refinement - to perform manual refinement/unrefinement ---------------------------------------------------------
Problem_id | returns: >0 - success, <=0 - failure | |
Work_dir | in: problem data structure to be used |
double utr_mat3_inv | ( | const double * | mat, | |
double * | mat_inv | |||
) |
-------------------------------------------------------- utr_mat3_inv - to invert a 3x3 matrix (stored as a vector!) ---------------------------------------------------------
mat | returns: determinant of matrix to invert | |
mat_inv | matrix to invert inverted matrix |
void utr_mat3mat | ( | const double * | m1, | |
const double * | m2, | |||
double * | m3 | |||
) |
-------------------------------------------------------- utr_mat3mat - to compute matrix matrix product in 3D space (all matrices are stored by rows as vectors!) ---------------------------------------------------------
m2 | in: matrix | |
m3 | in: matrix out: matrix m1*m2 |
void utr_mat3vec | ( | const double * | m1, | |
const double * | v1, | |||
double * | v2 | |||
) |
-------------------------------------------------------- utr_mat3vec - to compute matrix vector product in 3D space ---------------------------------------------------------
v1 | in: matrix (stored by rows as a vector!) | |
v2 | in: vector out: resulting vector |
double utr_mat_det | ( | const double * | m, | |
int | n, | |||
char | store, | |||
double * | det | |||
) |
-------------------------------------------------------- utr_mat_det - to compute determinant of a matrix ---------------------------------------------------------
int utr_menu_export_mesh | ( | FILE * | Interactive_output, | |
FILE * | Interactive_input, | |||
const int | Mesh_id, | |||
const char * | Work_dir, | |||
char * | Mesh_file | |||
) |
-------------------------------------------------------- utr_io_export_mesh - to display menu for exporting mesh ---------------------------------------------------------
Interactive_output | returns number of files exported | |
Interactive_input | file or stdout to write messages | |
Work_dir | id of mesh to export | |
Mesh_file | mesh file name - conforming to naming convention |
int utr_put_list | ( | int | Num, | |
int * | List, | |||
int | Ll | |||
) |
-------------------------------------------------------- utr_put_list - to put Num on the list List with length Ll (filled with numbers and zeros at the end) ---------------------------------------------------------
Num | returns >0 - position already occupied on the list <0 - position at which put on the list 0 - list full, not found on the list | |
List | in: number to put on the list | |
Ll | in: list in: total list's lengths |
int utr_recover_derivatives | ( | int | Field_id, | |
int | Sol_vec_id, | |||
int | Nr_patches, | |||
utt_patches * | patches | |||
) |
-------------------------------------------------------- utr_recover_derivatives - to recover derivatives using patches of elements (can be called separately for each field on the same mesh) ---------------------------------------------------------
Field_id | returns: >0 - success, <=0 - failure | |
Sol_vec_id | in: field data structure to be used | |
patches | in - array of patches for real nodes out: array of patches with computed derivatives for ALL nodes |
int utr_recover_derivatives_small | ( | int | Field_id, | |
int | Sol_vec_id, | |||
int | Nr_patches, | |||
utt_patches * | patches | |||
) |
-------------------------------------------------------- utr_recover_derivatives_small-to recover derivatives using patches of elements (does not use apr_get_stiff_mat_data for getting lists of element nodes) (can be called separately for each field on the same mesh) ---------------------------------------------------------
Field_id | returns: >0 - success, <=0 - failure | |
Sol_vec_id | in: field data structure to be used | |
patches | in - array of patches for real nodes out: array of patches with computed derivatives for ALL nodes |
void utr_renumber | ( | int | Nr_vertices, | |
int * | Nrneig, | |||
int ** | L_neig, | |||
int * | Permutation_array | |||
) |
void utr_reset_time_counters | ( | int | Control | ) |
-------------------------------------------------------- utr_reset_time_counters ----------------------------------------------------------
int utr_rewr_sol | ( | int | Field_id, | |
int | Sol_from, | |||
int | Sol_to | |||
) |
----------------------------------------------------------- utr_rewr_sol - to rewrite solution from one vector to another ------------------------------------------------------------
Sol_from | in: data structure to be used | |
Sol_to | in: ID of vector to read solution from in: ID of vector to write solution to |
int utr_set_interactive | ( | char * | Workdir, | |
int | Argc, | |||
char ** | Argv, | |||
FILE ** | Interactive_input, | |||
FILE ** | Interactive_output | |||
) |
-------------------------------------------------------- utr_set_interactive - to set up pointers for interactive input and output that control the run (possibly stdin and/or stdout for on-line control) ----------------------------------------------------------
Workdir | returns: >0 - success code, <0 - error code |
void utr_skip_rest_of_line | ( | FILE * | Fp | ) |
-------------------------------------------------------- utr_skip_rest_of_line - to allow for comments in input files ---------------------------------------------------------
Fp | in: input file |
int utr_test_refinements | ( | int | Problem_id, | |
char * | Work_dir, | |||
FILE * | Interactive_input, | |||
FILE * | Interactive_output | |||
) |
-------------------------------------------------------- utr_test_refinements - to perform sequence of random refinements/unrefinements ---------------------------------------------------------
Problem_id | returns: >0 - success, <=0 - failure | |
Work_dir | in: problem data structure to be used |
void utr_vec3_add | ( | const double | vec_a[3], | |
const double | vec_b[3], | |||
double | vec_c[3] | |||
) |
double utr_vec3_angle | ( | const double | vec_a[3], | |
const double | vec_b[3] | |||
) |
---------------------------------------------------------- utr_vec3_angle - to compute vector dot product of 3D vectors scalar_prod(a,b) angle(a,b) = arc cos --------------------- length(a) * length(b) ----------------------------------------------------------
vec_a | returns angle in radians |
double utr_vec3_dot | ( | const double | vec_a[3], | |
const double | vec_b[3] | |||
) |
double utr_vec3_length | ( | const double * | vec | ) |
-------------------------------------------------------- utr_vec3_length - to compute length of a 3D vector ---------------------------------------------------------
vec | returns: vector length in: vector |
double utr_vec3_mxpr | ( | const double * | vec_a, | |
const double * | vec_b, | |||
const double * | vec_c | |||
) |
-------------------------------------------------------- utr_vec3_mxpr - to compute mixed vector product of 3D vectors ---------------------------------------------------------
vec_a | returns: mixed product [a,b,c] | |
vec_b | in: vector a | |
vec_c | in: vector b in: vector c |
void utr_vec3_prod | ( | const double * | vec_a, | |
const double * | vec_b, | |||
double * | vec_c | |||
) |
-------------------------------------------------------- utr_vec3_prod - to compute vector product of 3D vectors ---------------------------------------------------------
vec_b | in: vector a | |
vec_c | in: vector b out: vector product axb |
void utr_vec3_subst | ( | const double | vec_a[3], | |
const double | vec_b[3], | |||
double | vec_c[3] | |||
) |
int utr_write_paraview_bc | ( | int | Mesh_id, | |
const char * | Work_dir, | |||
const char * | Filename, | |||
ute_paraview_flags | VTK_file_version | |||
) |
-------------------------------------------------------- / utr_write_paraview_bc - to dump boundary conditions 'field' in Paraview format ---------------------------------------------------------
int utr_write_paraview_fields | ( | const char * | Work_dir, | |
const char * | Filename, | |||
double | Current_time, | |||
const int | N_descriptors, | |||
utt_paraview_field_descriptor * | Field_descriptors, | |||
ute_paraview_flags | VTK_file_version | |||
) |
-------------------------------------------------------- / utr_write_paraview_field - to dump field in Paraview format ---------------------------------------------------------
1. GATHERING FIELD DATA Mapping from Field_id to PVsolInfo array.
2. Writing initial information etc., but not fields.
3. Writing all fields.
4. Ending and cleaning. Freeing memory.
int utr_write_paraview_mesh | ( | int | Mesh_id, | |
const char * | Work_dir, | |||
const char * | Filename, | |||
ute_paraview_flags | VTK_file_version | |||
) |
-------------------------------------------------------- / utr_write_paraview_mesh - to dump mesh in Paraview format ---------------------------------------------------------
void utr_write_paraview_partmesh | ( | int | Mesh_id, | |
const char * | Work_dir, | |||
const char * | Filename, | |||
int * | Parts, | |||
ute_paraview_flags | VTK_file_version | |||
) |
-------------------------------------------------------- / utr_write_paraview_partmesh - to dump mesh in Paraview format includiong partition info ---------------------------------------------------------
VTK_file_version | partition vector for the elements of the mesh |
int utr_write_paraview_std_lin | ( | int | Mesh_id, | |
int | Field_id, | |||
const char * | Workdir, | |||
const char * | Filename, | |||
ute_paraview_flags | VTK_file_version | |||
) |
utr_write_paraview_std_lin - to dump std_lin mesh and field in Paraview format
-------------------------------------------------------- utr_write_paraview_std_lin - to dump data in Paraview format (for std_lin only) ---------------------------------------------------------
Mesh_id | - id of the mesh associated with given field Field_id | |
Field_id | - id of the field to dump | |
Filename | - c-string with name of the file to write on disk | |
Desc | - c-string c-array with name of the field values (at least Desc[0]!= NULL should be passed) |
Field_id | in: ID of the mesh | |
Workdir | in: ID of the field | |
VTK_file_version | in: name of the file to write data |
int utr_write_paraview_tensor | ( | int | Field_id, | |
FILE * | File, | |||
int * | Dofs_write, | |||
double | dt | |||
) |
-------------------------------------------------------- / utr_write_paraview_tensor - to dump tensor in Paraview format ---------------------------------------------------------
-------------------------------------------------------- utr_ctrl_c_signal_handler(int param) - to catch kill signals ----------------------------------------------------------