00001 /************************************************************************ 00002 File pdh_plast_flow_problem.h - problem module's type 00003 00004 Contains problem module defines (see below) 00005 00006 Contains definition of types: 00007 pdt_plast_flow_ctrls 00008 pdt_plast_flow_times 00009 pdt_plast_flow_nonls 00010 pdt_plast_flow_linss 00011 pdt_plast_flow_adpts 00012 pdt_plast_flow_problem - aggregates above ones 00013 00014 Procedures: 00015 pdr_plast_flow_problem_clear - clear problem data 00016 pdr_plast_flow_problem_read - read problem data 00017 00018 ------------------------------ 00019 History: 00020 initial version - Krzysztof Banas (pobanas@cyf-kr.edu.pl) 00021 *************************************************************************/ 00022 00023 #ifndef PDH_PLAST_FLOW_PROBLEM 00024 #define PDH_PLAST_FLOW_PROBLEM 00025 00026 #ifndef ANALYTIC_EXPRESSIONS 00027 #define ANALYTIC_EXPRESSIONS 00028 #endif 00029 00030 #ifndef CONVERGENCE_CURVE 00031 #define CONVERGENCE_CURVE 00032 #endif 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 boundary conditions handling */ 00040 #include "pdh_plast_flow_mixed_bc.h" 00041 00042 /* types and functions related to materials handling */ 00043 #include "pdh_plast_flow_mixed_materials.h" 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 // maximal number of equations (solution components) in component modules 00058 #define PDC_PLAST_FLOW_MAXEQ 4 00059 #define PDC_PLAST_FLOW_NREQ 4 00060 #define PDC_PLAST_FLOW_PRIMARY_FIELD_NREQ 3 00061 #define PDC_PLAST_FLOW_SECONDARY_FIELD_NREQ 1 00062 00063 #define PDC_PLAST_FLOW_STRAIN_MAXEQ 30 // derived field of: strain_intensity, flow_stress, strain_rate_int, 00064 #define PDC_PLAST_FLOW_STRAIN_NREQ 30 // 9 strains, 9 strain rates, 9 stresses 00065 #define PDC_PLAST_FLOW_STRAIN_MAXELSD APC_DOUBLE_MAXELSD // maximum vector size for dofs data from strain field 00066 00067 /**************************************/ 00068 /* TYPES */ 00069 /**************************************/ 00070 /* Rules: 00071 /* - type name starts always witn pdt_ */ 00072 00073 /* structure with control parameters */ 00074 typedef struct { 00075 /*** GENERIC - DO NOT CHANGE !!! ***/ 00076 char name[300]; /* name (identifier for problem dependent routines) */ 00077 int mesh_id; /* ID of the associated mesh */ 00078 int primary_field_id; /* ID of the associated PRIMARY approximation field */ 00079 int secondary_field_id; /* ID of the associated SECONDARY approximation field */ 00080 int nr_sol; /* number of solution vectors stored by approximation */ 00081 /* module (for time dependent/nonlinear problems) */ 00082 int nreq[3]; /* number of equations (solution components) */ 00083 int solver_id; /* ID of the associated solver */ 00084 // for continuous basis functions problem->ctrl.base is not used 00085 //int base; /* parameter specifying the type of basis functions */ 00086 /* interpreted by particular approximation modules */ 00087 int pdeg[4]; /* PDEG value for approximation field 00088 pdeg[0] - PDEG value 00089 pdeg[1] - PDEG value of PRIMARY field 00090 pdeg[2] - PDEG value of SECONDARY field 00091 pdeg[3] - PDEG value of STRAIN FIELD field */ 00092 char mesh_type[2]; 00093 00094 char work_dir[300]; 00095 FILE* interactive_input; 00096 FILE* interactive_output; 00097 char mesh_filename[300]; 00098 char field_filename[300]; 00099 char material_filename[300]; 00100 char bc_filename[300]; 00101 char solver_filename[300]; 00102 char field_dmp_filepattern[50]; 00103 char mesh_dmp_filepattern[50]; 00104 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00105 int mesh_id_initial; /* ID of the associated initial mesh */ 00106 int strain_field_id; /* ID of the associated approximation field */ 00107 int strain_nr_sol; /* number of solution vectors stored by approximation */ 00108 /* module (for time dependent/nonlinear problems) */ 00109 int strain_nreq; /* number of equations (solution components) */ 00110 char strain_field_filename[300]; 00111 char strain_field_dmp_filepattern[50]; 00112 double penalty; // for boundary conditions 00113 double density; // for constant density calculations 00114 double ref_temperature; // for constant temperature calculations 00115 int fields_nb; // fields number 00116 } pdt_plast_flow_ctrls; 00117 00118 /* structure with time integration parameters */ 00119 typedef struct { 00120 /*** GENERIC - DO NOT CHANGE !!! ***/ 00121 int type; /* type of time integration scheme */ 00122 /* 0 - no time integration */ 00123 /* 1 - alpha (a.k.a. theta) scheme */ 00124 double alpha; /* implicitnes parameter alpha (a.k.a. theta)*/ 00125 00126 int cur_step; /* current time-step number */ 00127 double cur_time; /* current time */ 00128 double cur_dtime; /* current time-step length */ 00129 double prev_dtime; /* previous time-step length */ 00130 00131 int final_step; /* time-step number to stop simulation */ 00132 double final_time; /* time to stop simulation */ 00133 00134 int conv_type; /* convergence criterion number */ 00135 double conv_meas; /* convergence measure */ 00136 int monitor; /* monitoring level: */ 00137 /* PDC_SILENT 0 */ 00138 /* PDC_ERRORS 1 */ 00139 /* PDC_INFO 2 */ 00140 /* PDC_ALLINFO 3 */ 00141 int intv_dumpout; /* interval (in time steps) for dumping out data */ 00142 int intv_graph; /* interval (in time steps) for graphics output */ 00143 int graph_accu; /* auto graphics dumpout accuracy */ 00144 00145 int time_step_length_nonl_control; // indicator (0/1) of time step adaptivity 00146 // based on the convergence of non-linear solution 00147 int time_step_length_nonl_iter_max; // the number of non-linear iterations above which 00148 // time step length is decreased (0 for non-decreasing time-step) 00149 int time_step_length_nonl_iter_min; // the number of non-linear iterations below which 00150 // time step length is increased (0 for non-increasing time-step) 00151 double time_step_length_nonl_iter_increase_mult; 00152 double time_step_length_nonl_iter_decrease_mult; 00153 00154 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00155 } pdt_plast_flow_times; 00156 00157 /* structure with nonlinear solver control parameters */ 00158 typedef struct { 00159 /*** GENERIC - DO NOT CHANGE !!! ***/ 00160 int type; /* method identifier */ 00161 /* 0 - problem is linear */ 00162 int max_iter; /* maximal iteration number */ 00163 int conv_type; /* convergence criterion number */ 00164 double conv_meas; /* convergence measure */ 00165 int monitor; /* monitoring level: */ 00166 /* PDC_SILENT 0 */ 00167 /* PDC_ERRORS 1 */ 00168 /* PDC_INFO 2 */ 00169 /* PDC_ALLINFO 3 */ 00170 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00171 } pdt_plast_flow_nonls; 00172 00173 /* structure with linear solver control parameters */ 00174 typedef struct { 00175 /*** GENERIC - DO NOT CHANGE !!! ***/ 00176 int type; /* method identifier */ 00177 /* 0 - direct solver (?) */ 00178 /* 1 - precondittioned GMRES */ 00179 /* 2 - multigrid preconditioned GMRES */ 00180 /* 10 - standard iterations */ 00181 /* 20 - V-cycle multigrid */ 00182 int max_iter; /* maximal iteration number */ 00183 int conv_type; /* convergence criterion number */ 00184 /* 0 - relative to initial residual */ 00185 /* 1 - absolute residual */ 00186 /* 2 - relative to rhs */ 00187 double conv_meas; /* convergence measure */ 00188 int monitor; /* monitoring level: */ 00189 /* PDC_SILENT 0 */ 00190 /* PDC_ERRORS 1 */ 00191 /* PDC_INFO 2 */ 00192 /* PDC_ALLINFO 3 */ 00193 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00194 } pdt_plast_flow_linss; 00195 00196 /* structure with adaptation parameters */ 00197 typedef struct { 00198 /*** GENERIC - DO NOT CHANGE !!! ***/ 00199 int type; /* strategy number for adaptation */ 00200 int interval; /* number of time steps between adaptations */ 00201 int maxgen; /* maximum generation level for elements */ 00202 double eps; /* coefficient for choosing elements to adapt */ 00203 double ratio; /* ratio of errors for derefinements */ 00204 int monitor; /* monitoring level: */ 00205 /* PDC_SILENT 0 */ 00206 /* PDC_ERRORS 1 */ 00207 /* PDC_INFO 2 */ 00208 /* PDC_ALLINFO 3 */ 00209 /*** PROBLEM SPECIFIC - CAN BE MODIFIED ***/ 00210 } pdt_plast_flow_adpts; 00211 00212 /* problem definition data structure */ 00213 typedef struct { 00214 pdt_plast_flow_ctrls ctrl; /* structure with control parameters */ 00215 pdt_plast_flow_times time; /* structure with time integration parameters */ 00216 pdt_plast_flow_nonls nonl; /* structure with nonlinear solver parameters */ 00217 pdt_plast_flow_linss lins; /* structure with linear solver parameters */ 00218 pdt_plast_flow_adpts adpt; /* structure with adaptation parameters */ 00219 //pdt_plast_flow_materials materials; /* structure containing materials data */ 00220 pdt_plast_flow_bc bc; /* structure containing bc data */ 00221 } pdt_plast_flow_problem; 00222 00223 00227 extern int pdr_plast_flow_problem_clear(pdt_plast_flow_problem *Problem); 00228 00232 extern int pdr_plast_flow_problem_read( 00233 char *Work_dir, 00234 char *Filename, 00235 FILE *Interactive_output, 00236 pdt_plast_flow_problem *Problem, 00237 int Nr_sol // nr_sol is time integration dependent - specified by main 00238 ); 00239 00240 #ifdef __cplusplus 00241 } 00242 #endif 00243 00244 #endif