00001 /************************************************************************ 00002 File pdh_plast_flow.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_plast_flow_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_plast_flow_problem.h) 00012 pdr_plast_flow_time_integration - time integration driver (in time_integration) 00013 pdr_plast_flow_ZZ_error - to compute estimated norm of error based on 00014 recovered first derivatives - the notorious ZZ error estimate 00015 pdr_plast_flow_err_indi_ZZ - to return error indicator for an element, 00016 based on ZZ first derivative recovery 00017 pdr_plast_flow_adapt - to enforce adaptation strategy for ns problem (in adapt) 00018 pdr_plast_flow_dump_data - dump data to files (in input_output) 00019 pdr_plast_flow_write_paraview - to write graphics data to file (in input_output) 00020 00021 utilities: 00022 pdr_plast_flow_post_process 00023 pdr_plast_flow_write_profile 00024 pdr_plast_flow_initial_condition 00025 00026 ------------------------------ 00027 History: 00028 initial version - Krzysztof Banas (pobanas@cyf-kr.edu.pl) 00029 *************************************************************************/ 00030 00031 #ifndef PDH_PLAST_FLOW 00032 #define PDH_PLAST_FLOW 00033 00034 #include <stdio.h> 00035 00036 /* problem dependent interface with the PDEs */ 00037 #include "pdh_intf.h" 00038 00039 /* types and functions related to problem structures */ 00040 #include "pdh_plast_flow_supg_problem.h" 00041 // bc and material header files are included in problem header files 00042 #include "aph_intf.h" 00043 00044 00045 #ifdef __cplusplus 00046 extern "C" 00047 { 00048 #endif 00049 00050 /**************************************/ 00051 /* DEFINES */ 00052 /**************************************/ 00053 /* Rules: 00054 /* - always uppercase */ 00055 /* - name starts with PDC_ */ 00056 00057 #define PDC_PLAST_FLOW_ID 1 00058 00059 /**************************************/ 00060 /* TYPES */ 00061 /**************************************/ 00062 /* Rules: 00063 /* - type name starts always witn pdt_ */ 00064 00065 00066 /**************************************/ 00067 /* GLOBAL VARIABLES */ 00068 /**************************************/ 00069 /* Rules: 00070 /* - name always begins with pdv_ */ 00071 /* - constants always uppercase and start with PDC_ */ 00072 00073 00074 // ID of the current problem 00075 extern int pdv_plast_flow_current_problem_id; /* ID of the current problem */ 00076 // problem structure for plast_flow module 00077 extern pdt_plast_flow_problem pdv_plast_flow_problem; 00078 00079 #ifdef PARALLEL 00080 extern int pdv_exchange_table_index; // for a single problem 00081 #endif 00082 00083 /**************************************/ 00084 /* INTERNAL PROCEDURES */ 00085 /**************************************/ 00086 /* Rules: 00087 /* - name always begins with pdr_ */ 00088 /* - argument names start uppercase */ 00089 00090 00094 extern void pdr_plast_flow_time_integration( 00095 char* Work_dir, 00096 FILE *Interactive_input, 00097 FILE *Interactive_output); 00098 00099 00103 extern int pdr_plast_flow_adapt( 00104 char* Work_dir, 00105 FILE *Interactive_input, 00106 FILE *Interactive_output); 00107 00112 double pdr_plast_flow_ZZ_error( 00113 /* returns - Zienkiewicz-Zhu error for the whole mesh */ 00114 char* Work_dir, 00115 FILE *Interactive_input, 00116 FILE *Interactive_output 00117 ); 00118 00123 extern double pdr_plast_flow_err_indi_ZZ( 00124 /* returns error indicator for an element */ 00125 int Problem_id, /* in: data structure to be used */ 00126 int El /* in: element number */ 00127 ); 00128 00135 double pdr_plast_flow_sol_mesh(/* returns total volume of the mesh */ 00136 int Problem_id, /* in: data structure to be used */ 00137 double *sol_previous, /* in: averaged previous solution (21) */ 00138 double *sol_averaged /* out: averaged current solution (21) */ 00139 ); 00140 00141 /*------------------------------------------------------------- 00142 pdr_plast_flow_sol_el - to return volume of element and 00143 averaged: strain intensity (1), flow stress (1), strain rate 00144 intensity (1), strain tensor (9), strain rate tensor (9) 00145 for an element (=21) 00146 -------------------------------------------------------------*/ 00147 extern double pdr_plast_flow_sol_el(/* returns volume of element */ 00148 int Problem_id, /* in: data structure to be used */ 00149 int El, /* in: element number */ 00150 double *sol_current /* out: averaged solution (21) */ 00151 ); 00152 00156 extern int pdr_plast_flow_dump_data( 00157 char* Work_dir, 00158 FILE *Interactive_input, 00159 FILE *Interactive_output 00160 ); 00161 00162 /*--------------------------------------------------------- 00163 pdr_write_strain_tensor - to dump tensor, derived field 00164 ---------------------------------------------------------*/ 00165 int pdr_write_strain_tensor( 00166 int Field_id, // derived field ID 00167 int* Dofs_write, // dofs to write: dofs_write[0] - number of dofs 00168 // dofs_write[i] - IDs of dofs to write 00169 double dt 00170 ); 00171 00172 /*--------------------------------------------------------- 00173 pdr_write_stress_tensor - to dump tensor, derived field 00174 ---------------------------------------------------------*/ 00175 int pdr_write_stress_tensor( 00176 int Field_id, // derived field ID 00177 int* Dofs_write, // dofs to write: dofs_write[0] - number of dofs 00178 // dofs_write[i] - IDs of dofs to write 00179 double dt 00180 ); 00181 00185 extern int pdr_plast_flow_write_paraview( 00186 char* Work_dir, 00187 FILE *Interactive_input, 00188 FILE *Interactive_output 00189 ); 00190 00191 /*--------------------------------------------------------- 00193 ---------------------------------------------------------*/ 00194 void pdr_write_paraview_mesh_nodes_displacement( 00195 int Mesh_id, int Mesh_id_initial, FILE *File); 00196 00197 00198 // IN: MAIN/PDS_PLAST_FLOW_UTIL.C 00199 00203 double pdr_plast_flow_post_process( 00204 char* Work_dir, 00205 FILE *Interactive_input, 00206 FILE *Interactive_output 00207 ); 00208 00212 int pdr_plast_flow_write_profile( 00213 char* Work_dir, 00214 FILE *Interactive_input, 00215 FILE *Interactive_output 00216 ); 00217 00223 double pdr_plast_flow_initial_condition( 00224 int Field_id, // field_id - each problem should know its field id 00225 double *Coor, // point coordinates 00226 int Sol_comp_id // solution component 00227 ); 00228 00234 double pdr_strain_initial_condition( 00235 int Field_id, // field_id - each problem should know its field id 00236 double *Coor, // point coordinates 00237 int Sol_comp_id // solution component 00238 ); 00239 00240 #ifdef __cplusplus 00241 } 00242 00243 #endif 00244 00245 #endif