00001 /************************************************************************ 00002 File pdh_ns_supg.h - problem module's types and functions 00003 BY ASSUMPTION NOT CALLED BY OTHER MODULES' FUNCTIONS 00004 (functions called by other modules are in pdh_ns_supg_weakform.h) 00005 00006 Contains problem module defines (see below) 00007 00008 00009 Contains declarations of routines: 00010 BY ASSUMPTION NOT CALLED BY OTHER MODULES' FUNCTIONS 00011 (functions called by other modules are in pdh_ns_supg_problem.h) 00012 pdr_ns_supg_time_integration - time integration driver (in time_integration) 00013 pdr_ns_supg_ZZ_error - to compute estimated norm of error based on 00014 recovered first derivatives - the notorious ZZ error estimate (in adapt) 00015 pdr_ns_supg_err_indi_ZZ - to return error indicator for an element, 00016 based on ZZ first derivative recovery 00017 pdr_ns_supg_err_indi_explicit - to return error indicator for an element, 00018 based on explicit formulae 00019 pdr_ns_supg_adapt - to enforce adaptation strategy for ns problem (in adapt) 00020 pdr_ns_supg_dump_data - dump data to files (in input_output) 00021 pdr_ns_supg_write_paraview - to write graphics data to file (in input_output) 00022 00023 utilities: 00024 pdr_ns_supg_post_process 00025 pdr_ns_supg_write_profile 00026 pdr_ns_supg_initial_condition 00027 00028 ------------------------------ 00029 History: 00030 initial version - Krzysztof Banas 00031 2011 - Przemyslaw Plaszewski (pplaszew@agh.edu.pl) 00032 2011 - Aleksander Siwek (Aleksander.Siwek@agh.edu.pl) 00033 2012 - Krzysztof Banas (pobanas@cyf-kr.edu.pl) 00034 *************************************************************************/ 00035 00036 #ifndef PDH_NS_SUPG 00037 #define PDH_NS_SUPG 00038 00039 #include <stdio.h> 00040 00041 /* problem dependent interface with the PDEs */ 00042 #include "pdh_intf.h" 00043 00044 /* types and functions related to problem structures */ 00045 #include "pdh_ns_supg_problem.h" 00046 // bc and material header files are included in problem header files 00047 00048 //#define TURBULENTFLOW 00049 #ifdef TURBULENTFLOW 00050 #include "../../pdd_turbulent/supg.h" 00051 void GetLocalViscosity(int elementId,int GaussPointId, double* viscLocal,int problem_id); 00052 #endif //TURBULENTFLOW 00053 00054 #ifdef __cplusplus 00055 extern "C" 00056 { 00057 #endif 00058 00059 /**************************************/ 00060 /* DEFINES */ 00061 /**************************************/ 00062 /* Rules: 00063 /* - always uppercase */ 00064 /* - name starts with PDC_ */ 00065 00066 #define PDC_NS_SUPG_ID 1 00067 00068 /**************************************/ 00069 /* TYPES */ 00070 /**************************************/ 00071 /* Rules: 00072 /* - type name starts always witn pdt_ */ 00073 00074 00075 /**************************************/ 00076 /* GLOBAL VARIABLES */ 00077 /**************************************/ 00078 /* Rules: 00079 /* - name always begins with pdv_ */ 00080 /* - constants always uppercase and start with PDC_ */ 00081 00082 extern double pdv_ns_supg_timer_all; 00083 extern double pdv_ns_supg_timer_pdr_comp_el_stiff_mat; 00084 extern double pdv_ns_supg_timer_pdr_comp_fa_stiff_mat; 00085 00086 00087 // ID of the current problem 00088 extern int pdv_ns_supg_current_problem_id; /* ID of the current problem */ 00089 // problem structure for ns_supg module 00090 extern pdt_ns_supg_problem pdv_ns_supg_problem; 00091 00092 #ifdef PARALLEL 00093 extern int pdv_exchange_table_index; // for a single problem 00094 #endif 00095 00096 /**************************************/ 00097 /* INTERNAL PROCEDURES */ 00098 /**************************************/ 00099 /* Rules: 00100 /* - name always begins with pdr_ */ 00101 /* - argument names start uppercase */ 00102 00103 00107 extern void pdr_ns_supg_time_integration( 00108 char* Work_dir, 00109 FILE *Interactive_input, 00110 FILE *Interactive_output); 00111 00112 00116 extern int pdr_ns_supg_adapt( 00117 char* Work_dir, 00118 FILE *Interactive_input, 00119 FILE *Interactive_output); 00120 00125 double pdr_ns_supg_ZZ_error( 00126 /* returns - Zienkiewicz-Zhu error for the whole mesh */ 00127 char* Work_dir, 00128 FILE *Interactive_input, 00129 FILE *Interactive_output 00130 ); 00131 00136 extern double pdr_ns_supg_err_indi_ZZ( 00137 /* returns error indicator for an element */ 00138 int Problem_id, /* in: data structure to be used */ 00139 int El /* in: element number */ 00140 ); 00141 00146 extern double pdr_ns_supg_err_indi_explicit( 00147 /* returns error indicator for an element */ 00148 int Problem_id, /* in: data structure to be used */ 00149 int El /* in: element number */ 00150 ); 00151 00155 extern int pdr_ns_supg_dump_data( 00156 char* Work_dir, 00157 FILE *Interactive_input, 00158 FILE *Interactive_output 00159 ); 00160 00164 extern int pdr_ns_supg_write_paraview( 00165 char* Work_dir, 00166 FILE *Interactive_input, 00167 FILE *Interactive_output 00168 ); 00169 00170 00171 // IN: MAIN/PDS_NS_SUPG_UTIL.C 00172 00176 double pdr_ns_supg_post_process( 00177 char* Work_dir, 00178 FILE *Interactive_input, 00179 FILE *Interactive_output 00180 ); 00181 00185 int pdr_ns_supg_write_profile( 00186 char* Work_dir, 00187 FILE *Interactive_input, 00188 FILE *Interactive_output 00189 ); 00190 00196 double pdr_ns_supg_initial_condition( 00197 int Field_id, // field_id - each problem should know its field id 00198 double *Coor, // point coordinates 00199 int Sol_comp_id // solution component 00200 ); 00201 00202 00203 #ifdef __cplusplus 00204 } 00205 #endif 00206 00207 #endif