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