00001 #include "solverm.h" 00002 #include "lssolver.h" 00003 #include "edsolver.h" 00004 #include "fdsolver.h" 00005 #include "nssolver.h" 00006 #include "mtsolver.h" 00007 #include "llssolver.h" 00008 #include "epsolver.h" 00009 #include "slsolver.h" 00010 #include "lfssolver.h" 00011 #include "nfssolver.h" 00012 #include "cpsolver.h" 00013 #include "hvisolver.h" 00014 #include "lbsolver.h" 00015 #include "homog.h" 00016 #include "global.h" 00017 00018 void solve_mefel_problem (stochdriver *stochd) 00019 { 00020 if (Mp->stochasticcalc==0){ 00021 solve_mefel_deterministic_problem (); 00022 } 00023 if (Mp->stochasticcalc==1 || Mp->stochasticcalc==2 || Mp->stochasticcalc==3){ 00024 solve_mefel_stochastic_problem (stochd); 00025 } 00026 } 00027 00028 void solve_mefel_deterministic_problem () 00029 { 00030 switch (Mp->tprob){ 00031 case linear_statics:{ 00032 solve_linear_statics (); 00033 break; 00034 } 00035 case eigen_dynamics:{ 00036 solve_eigen_dynamics (Lsrs->lhs,Lsrs->w); 00037 break; 00038 } 00039 case forced_dynamics:{ 00040 solve_forced_dynamics (); 00041 break; 00042 } 00043 case linear_stability:{ 00044 solve_linear_stability (); 00045 break; 00046 } 00047 case mat_nonlinear_statics:{ 00048 solve_nonlinear_statics (); 00049 break; 00050 } 00051 case mech_timedependent_prob:{ 00052 solve_time_dep_prob (); 00053 break; 00054 } 00055 case growing_mech_structure:{ 00056 solve_prob_constr_phases (); 00057 //solve_prob_constr_phases_old (); 00058 break; 00059 } 00060 case earth_pressure:{ 00061 solve_epressure (); 00062 break; 00063 } 00064 case layered_linear_statics:{ 00065 solve_layered_linear_statics (); 00066 break; 00067 } 00068 case lin_floating_subdomain:{ 00069 //solve_linear_statics (); 00070 solve_linear_floating_subdomains (); 00071 //solve_nonlinear_floating_subdomains (); 00072 break; 00073 } 00074 case nonlin_floating_subdomain:{ 00075 solve_incremental_floating_subdomains (); 00076 break; 00077 } 00078 case hemivar_inequal:{ 00079 solve_hemivariational_inequalities (); 00080 break; 00081 } 00082 case load_balancing:{ 00083 solve_load_balancing (); 00084 break; 00085 } 00086 default:{ 00087 print_err("unknown problem type is required", __FILE__, __LINE__, __func__); 00088 } 00089 } 00090 00091 // homogenization 00092 if (Mp->homog!=0){ 00093 homogenization (Out,0); 00094 } 00095 00096 } 00097 00098 void solve_mefel_stochastic_problem (stochdriver *stochd) 00099 { 00100 long i,j; 00101 00102 for (i=0;i<stochd->nsampl;i++){ 00103 //fprintf (Out,"\n\n %ld\n",i); 00104 fprintf (stdout,"\n sample %ld",i); 00105 //Mp->ns=i; 00106 stochd->changevalues (i); 00107 Lsrs->clean_lhs (); 00108 Mm->clean_ip (); 00109 Mt->clean_nodes (); 00110 solve_mefel_deterministic_problem (); 00111 stochd->extractor (); 00112 stochd->save_results (i); 00113 // presunuto do extractoru 00114 //stochd->update_auxparam (); 00115 } 00116 00117 00118 00119 if (Mp->stochasticcalc==1){ 00120 stochd->writetable (); 00121 } 00122 if (Mp->stochasticcalc==3){ 00123 //for (i=0;i<stochd->nprunknowns;i++){ 00124 //fprintf (Out,"\n\n fuzzy number %ld",i); 00125 //stochd->fn[i].print (Out); 00126 //} 00127 00128 long k=0; 00129 for (i=0;i<stochd->npnd;i++){ 00130 for (j=0;j<stochd->pnd[i].num;j++){ 00131 //fprintf (Out,"\n\n fuzzy posun %ld",i); 00132 stochd->fn[k].print (stochd->datout); 00133 k++; 00134 } 00135 } 00136 00137 /* 00138 long k; 00139 for (i=0;i<stochd->npev;i++){ 00140 fprintf (Out,"\n\n"); 00141 00142 for (k=0;k<6;k++){ 00143 fprintf (Out,"\n"); 00144 stochd->fn[j].print (Out); 00145 j++; 00146 } 00147 } 00148 */ 00149 00150 00151 /* 00152 fprintf (Out,"\n\n\n\n"); 00153 for (i=0;i<stochd->npev*6;i+=3){ 00154 fprintf (Out,"\n"); 00155 stochd->fn[j+i].print (Out); 00156 } 00157 fprintf (Out,"\n\n\n\n"); 00158 for (i=1;i<stochd->npev*6;i+=3){ 00159 fprintf (Out,"\n"); 00160 stochd->fn[j+i].print (Out); 00161 } 00162 fprintf (Out,"\n\n\n\n"); 00163 for (i=2;i<stochd->npev*6;i+=3){ 00164 fprintf (Out,"\n"); 00165 stochd->fn[j+i].print (Out); 00166 } 00167 00168 */ 00169 00170 00171 } 00172 00173 //stochd->diagpostproc (); 00174 00175 }