00001 /************************************************************************ 00002 File pdh_forming_problem.h - problem module's type 00003 00004 Contains problem module defines (see below) 00005 00006 Contains definition of types: 00007 pdt_forming_mixed_ctrls 00008 pdt_forming_mixed_times 00009 pdt_forming_mixed_nonls 00010 pdt_forming_mixed_linss 00011 pdt_forming_mixed_adpts 00012 pdt_forming_mixed_problem - aggregates above ones 00013 00014 Procedures: 00015 pdr_forming_mixed_problem_clear - clear problem data 00016 pdr_forming_mixed_problem_read - read problem data 00017 00018 ------------------------------ 00019 History: 00020 initial version - Krzysztof Banas (pobanas@cyf-kr.edu.pl) 00021 *************************************************************************/ 00022 00023 #ifndef PDH_FORMING_MIXED_PROBLEM 00024 #define PDH_FORMING_MIXED_PROBLEM 00025 00026 #include <stdio.h> 00027 00028 /* problem dependent interface with the PDEs */ 00029 #include "pdh_intf.h" 00030 00031 /* types and functions related to boundary conditions handling */ 00032 #include "pdh_forming_mixed_bc.h" 00033 00034 /* types and functions related to materials handling */ 00035 #include "pdh_forming_mixed_materials.h" 00036 00037 #ifdef __cplusplus 00038 extern "C" 00039 { 00040 #endif 00041 00042 /**************************************/ 00043 /* DEFINES */ 00044 /**************************************/ 00045 /* Rules: 00046 /* - always uppercase */ 00047 /* - name starts with PDC_ */ 00048 00049 // maximal number of equations (solution components) in component modules 00050 #define PDC_PLAST_FLOW_MAXEQ 3 00051 #define PDC_PLAST_FLOW_NREQ 4 00052 00053 #define PDC_PLAST_FLOW_VELOCITY_NREQ 3 00054 #define PDC_PLAST_FLOW_STRESS_NREQ 1 00055 #define PDC_PLAST_FLOW_STRAIN_NREQ 1 00056 00057 #define PDC_PLAST_FLOW_STRAIN 6 00058 00059 #define SIMPLE_MIXED_SOLUTION 00060 00061 /**************************************/ 00062 /* TYPES */ 00063 /**************************************/ 00064 /* Rules: 00065 /* - type name starts always witn pdt_ */ 00066 00067 /* structure with control parameters */ 00068 typedef struct { 00069 /*** GENERIC - DO NOT CHANGE !!! ***/ 00070 char name[300]; /* name (identifier for problem dependent routines) */ 00071 int mesh_id; /* ID of the associated mesh */ 00072 int field_id; /* ID of the associated approximation field */ 00073 int nr_sol; /* number of solution vectors stored by approximation */ 00074 /* module (for time dependent/nonlinear problems) */ 00075 int nreq; /* number of equations (solution components) */ 00076 int solver_id; /* ID of the associated solver */ 00077 // for continuous basis functions problem->ctrl.base is not used 00078 //int base; /* parameter specifying the type of basis functions */ 00079 int pdeg[3]; /* PDEG value for approximation field */ 00080 /* interpreted by particular approximation modules */ 00081 char mesh_type[2]; 00082 00083 char work_dir[300]; 00084 FILE* interactive_input; 00085 FILE* interactive_output; 00086 char mesh_filename[300]; 00087 char field_filename[300]; // GENERAL FIELD FILENAME NOT USED [used only in simple version] 00088 char material_filename[300]; 00089 char bc_filename[300]; 00090 char solver_filename[300]; 00091 char field_dmp_filepattern[50]; // GENERAL FIELD FILE PATTERN NOT USED [used only in simple version] 00092 char mesh_dmp_filepattern[50]; 00093 00094 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00095 00096 /* ---- VELOCITY FIELD ---- */ 00097 int velocity_field_id; /* ID of the associated approximation field */ 00098 int velocity_nr_sol; /* number of solution vectors stored by approximation */ 00099 int velocity_nreq; /* number of equations (solution components) */ 00100 int velocity_pdeg; /* PDEG value for approximation field */ 00101 char velocity_field_filename[300]; 00102 char velocity_field_dmp_filepattern[50]; 00103 00104 /* ---- STRESS FIELD ---- */ 00105 int stress_field_id; /* ID of the associated approximation field */ 00106 int stress_nr_sol; /* number of solution vectors stored by approximation */ 00107 int stress_nreq; /* number of equations (solution components) */ 00108 int stress_pdeg; /* PDEG value for approximation field */ 00109 char stress_field_filename[300]; 00110 char stress_field_dmp_filepattern[50]; 00111 00112 /* ---- STRAIN FIELD ---- */ 00113 int strain_field_id; /* ID of the associated approximation field */ 00114 int strain_nr_sol; /* number of solution vectors stored by approximation */ 00115 int strain_nreq; /* number of equations (solution components) */ 00116 char strain_field_filename[300]; 00117 char strain_field_dmp_filepattern[50]; 00118 00119 /* --- OTHER PARAMETERS */ 00120 double penalty; // for boundary conditions 00121 double ref_temperature; // if <=0 - constant density and viscosity are used 00122 double density; //material property (this value used only for ref_temperature <=0 ) 00123 // TODO: problem parameters for plast_flow 00124 int fields_nb; // fields number 00125 } pdt_forming_mixed_ctrls; 00126 00127 /* structure with time integration parameters */ 00128 typedef struct { 00129 /*** GENERIC - DO NOT CHANGE !!! ***/ 00130 int type; /* type of time integration scheme */ 00131 /* 0 - no time integration */ 00132 /* 1 - alpha (a.k.a. theta) scheme */ 00133 double alpha; /* implicitnes parameter alpha (a.k.a. theta)*/ 00134 00135 int cur_step; /* current time-step number */ 00136 double cur_time; /* current time */ 00137 double cur_dtime; /* current time-step length */ 00138 double prev_dtime; /* previous time-step length */ 00139 00140 int final_step; /* time-step number to stop simulation */ 00141 double final_time; /* time to stop simulation */ 00142 00143 int conv_type; /* convergence criterion number */ 00144 double conv_meas; /* convergence measure */ 00145 int monitor; /* monitoring level: */ 00146 /* PDC_SILENT 0 */ 00147 /* PDC_ERRORS 1 */ 00148 /* PDC_INFO 2 */ 00149 /* PDC_ALLINFO 3 */ 00150 int intv_dumpout; /* interval (in time steps) for dumping out data */ 00151 int intv_graph; /* interval (in time steps) for graphics output */ 00152 int graph_accu; /* auto graphics dumpout accuracy */ 00153 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00154 } pdt_forming_mixed_times; 00155 00156 /* structure with nonlinear solver control parameters */ 00157 typedef struct { 00158 /*** GENERIC - DO NOT CHANGE !!! ***/ 00159 int type; /* method identifier */ 00160 /* 0 - problem is linear */ 00161 int max_iter; /* maximal iteration number */ 00162 int conv_type; /* convergence criterion number */ 00163 double conv_meas; /* convergence measure */ 00164 int monitor; /* monitoring level: */ 00165 /* PDC_SILENT 0 */ 00166 /* PDC_ERRORS 1 */ 00167 /* PDC_INFO 2 */ 00168 /* PDC_ALLINFO 3 */ 00169 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00170 } pdt_forming_mixed_nonls; 00171 00172 /* structure with linear solver control parameters */ 00173 typedef struct { 00174 /*** GENERIC - DO NOT CHANGE !!! ***/ 00175 int type; /* method identifier */ 00176 /* 0 - direct solver (?) */ 00177 /* 1 - precondittioned GMRES */ 00178 /* 2 - multigrid preconditioned GMRES */ 00179 /* 10 - standard iterations */ 00180 /* 20 - V-cycle multigrid */ 00181 int max_iter; /* maximal iteration number */ 00182 int conv_type; /* convergence criterion number */ 00183 /* 0 - relative to initial residual */ 00184 /* 1 - absolute residual */ 00185 /* 2 - relative to rhs */ 00186 double conv_meas; /* convergence measure */ 00187 int monitor; /* monitoring level: */ 00188 /* PDC_SILENT 0 */ 00189 /* PDC_ERRORS 1 */ 00190 /* PDC_INFO 2 */ 00191 /* PDC_ALLINFO 3 */ 00192 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00193 } pdt_forming_mixed_linss; 00194 00195 /* structure with adaptation parameters */ 00196 typedef struct { 00197 /*** GENERIC - DO NOT CHANGE !!! ***/ 00198 int type; /* strategy number for adaptation */ 00199 int interval; /* number of time steps between adaptations */ 00200 int maxgen; /* maximum generation level for elements */ 00201 double eps; /* coefficient for choosing elements to adapt */ 00202 double ratio; /* ratio of errors for derefinements */ 00203 int monitor; /* monitoring level: */ 00204 /* PDC_SILENT 0 */ 00205 /* PDC_ERRORS 1 */ 00206 /* PDC_INFO 2 */ 00207 /* PDC_ALLINFO 3 */ 00208 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00209 } pdt_forming_mixed_adpts; 00210 00211 /* problem definition data structure */ 00212 typedef struct { 00213 pdt_forming_mixed_ctrls ctrl; /* structure with control parameters */ 00214 pdt_forming_mixed_times time; /* structure with time integration parameters */ 00215 pdt_forming_mixed_nonls nonl; /* structure with nonlinear solver parameters */ 00216 pdt_forming_mixed_linss lins; /* structure with linear solver parameters */ 00217 pdt_forming_mixed_adpts adpt; /* structure with adaptation parameters */ 00218 //pdt_forming_mixed_materials materials; /* structure containing materials data */ 00219 pdt_forming_mixed_bc bc; /* structure containing bc data */ 00220 } pdt_forming_mixed_problem; 00221 00222 /* structure with control parameters */ 00223 typedef struct { 00224 /*** GENERIC - DO NOT CHANGE !!! ***/ 00225 char name[300]; /* name (identifier for problem dependent routines) */ 00226 int mesh_id; /* ID of the associated mesh */ 00227 int field_id; /* ID of the associated approximation field */ 00228 int nr_sol; /* number of solution vectors stored by approximation */ 00229 /* module (for time dependent/nonlinear problems) */ 00230 int nreq; /* number of equations (solution components) */ 00231 int solver_id; /* ID of the associated solver */ 00232 // for continuous basis functions problem->ctrl.base is not used 00233 //int base; /* parameter specifying the type of basis functions */ 00234 /* interpreted by particular approximation modules */ 00235 char mesh_type[2]; 00236 00237 char work_dir[300]; 00238 FILE* interactive_input; 00239 FILE* interactive_output; 00240 char mesh_filename[300]; 00241 char field_filename[300]; 00242 char material_filename[300]; 00243 char bc_filename[300]; 00244 char solver_filename[300]; 00245 char field_dmp_filepattern[50]; 00246 char mesh_dmp_filepattern[50]; 00247 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00248 double penalty; // for boundary conditions 00249 double ref_temperature; // if <=0 - constant density and viscosity are used 00250 double density; //material property (this value used only for ref_temperature <=0 ) 00251 // TODO: problem parameters for plast_flow 00252 } pdt_strain_ctrls; 00253 00254 /* structure with adaptation parameters */ 00255 typedef struct { 00256 /*** GENERIC - DO NOT CHANGE !!! ***/ 00257 int type; /* strategy number for adaptation */ 00258 int interval; /* number of time steps between adaptations */ 00259 int maxgen; /* maximum generation level for elements */ 00260 double eps; /* coefficient for choosing elements to adapt */ 00261 double ratio; /* ratio of errors for derefinements */ 00262 int monitor; /* monitoring level: */ 00263 /* PDC_SILENT 0 */ 00264 /* PDC_ERRORS 1 */ 00265 /* PDC_INFO 2 */ 00266 /* PDC_ALLINFO 3 */ 00267 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00268 } pdt_strain_adpts; 00269 00270 /* problem definition data structure */ 00271 typedef struct { 00272 pdt_strain_ctrls ctrl; /* structure with control parameters */ 00273 //pdt_strain_times time; /* structure with time integration parameters */ 00274 //pdt_strain_nonls nonl; /* structure with nonlinear solver parameters */ 00275 //pdt_strain_linss lins; /* structure with linear solver parameters */ 00276 pdt_strain_adpts adpt; /* structure with adaptation parameters */ 00277 //pdt_strain_materials materials; /* structure containing materials data */ 00278 //pdt_strain_bc bc; /* structure containing bc data */ 00279 } pdt_strain_problem; 00280 00284 extern int pdr_forming_mixed_problem_clear(pdt_forming_mixed_problem *Problem); 00285 00289 extern int pdr_forming_mixed_problem_read( 00290 char *Work_dir, 00291 char *Filename, 00292 FILE *Interactive_output, 00293 pdt_forming_mixed_problem *Problem, 00294 int Nr_sol // nr_sol is time integration dependent - specified by main 00295 ); 00296 00297 #ifdef __cplusplus 00298 } 00299 #endif 00300 00301 #endif