00001
00002
00003
00004
00005
00006 #include "entw.h"
00007 #include "printlas.h"
00008 #include "eingabe.h"
00009
00010
00011
00012 #define ddx(U) DX_FE(U)*Grid_stretch
00013 #define ddy(U) DY_FE(U)*Grid_stretch
00014 #define ddz(U) DZ_FE(U)
00015
00016 #define u_exakt zz
00017
00018
00019 double Grid_stretch, finest_mesh_size;
00020 double mesh_z;
00021 double stretch_x,stretch_y,stretch_z;
00022 double eps;
00023
00024 exit_type Solver(
00025 Grid_gen_parameters ggen_parameter,
00026 int test_processors,
00027 double meshsize,
00028 double grid_stretch,
00029 All_Domains* domain,
00030
00031 double kappa_x, double kappa_y, double kappa_z,
00032 bool (*Neumann_boundary)(double x, double y, double z),
00033 bool (*Third_boundary)(double x, double y, double z),
00034 double beta_third,
00035 double (*T_bulk)(double x,double y,double z),
00036 double (*temp_Dirichlet)(double x,double y,double z),
00037 double (*heat_source)(double x,double y,double z),
00038
00039
00040 Input_data_object* input_object,
00041
00042
00043 bool normalize_heat_integral,
00044
00045
00046 double heat_integral,
00047
00048 double alpha,
00049 double mu, double E,
00050 double T_0,
00051
00052 bool nonlinear_kappa,
00053 bool nonlinear_alpha,
00054 double (*Material_A)(double x,double y,double z),
00055 double (*nonlinear_kappa_A)(double x),
00056 double (*nonlinear_kappa_B)(double x),
00057 double (*nonlinear_alpha_A)(double x),
00058 double (*nonlinear_alpha_B)(double x),
00059
00060 int iteration_Poi,
00061 int iteration_elas,
00062 int solver_typ_elas,
00063 double eps,
00064 double bound_poiss,
00065 double bound_elas,
00066
00067 bool infos,
00068
00069 ThreadComm* comm,
00070
00071 MPI_Comm mpi_comm);
00072
00073
00074 double Material_A(double x,double y,double z) {
00075
00076
00077 z = z * Grid_stretch;
00078
00079 if(z > (0.2))
00080 return 1.0;
00081 return 0.0;
00082 }
00083
00084
00085
00086
00087 double nonlinear_kappa_A(double T) {
00088 return 33.132 / (T - 42.871) / 0.0103;
00089 }
00090
00091 double nonlinear_kappa_B(double T) {
00092 return 33.132 / (T - 42.871) / 0.0103;
00093 }
00094
00095 double nonlinear_alpha_A(double T) {
00096 return 0.0000069;
00097 }
00098
00099 double nonlinear_alpha_B(double T) {
00100 return 0.0000069;
00101 }
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 bool Neumann_boundary(double x, double y, double z) {
00141
00142 z = z * Grid_stretch;
00143 double r;
00144 r = sqrt(x*x+y*y);
00145
00146
00147
00148 return false;
00149
00150 if(x < 0.0)
00151 return true;
00152 else
00153 return false;
00154
00155
00156
00157
00158
00159
00160
00161 }
00162
00163 bool Third_boundary(double x, double y, double z) {
00164
00165 z = z * Grid_stretch;
00166 double r;
00167 r = sqrt(x*x+y*y);
00168 return false;
00169 }
00170
00171
00172 double T_bulk(double x, double y, double z) {
00173 double r;
00174 r = sqrt(z*z+y*y);
00175
00176 return 0.0;
00177 }
00178
00179 double temp_Dirichlet(double x, double y, double z) {
00180 double r;
00181 r = sqrt(x*x+y*y);
00182
00183 return 0.0;
00184 }
00185
00186
00187
00188 double Heat_source(double x, double y, double z) {
00189 double radius2;
00190
00191 return 1.0;
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208 }
00209
00210 int main(int argc, char** argv) {
00211 cout.precision(12);
00212 cout.setf(ios::fixed,ios::floatfield);
00213 ifstream PARAMETER;
00214 int test_processors;
00215
00216 int my_rank;
00217
00218
00219
00220
00221 MPI_Init(&argc,&argv);
00222 MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
00223
00224 PARAMETER.open("para.dat",ios :: in);
00225
00226
00227 stretch_x =6.0;
00228 stretch_y =3.0;
00229 stretch_z =3.0;
00230
00231
00232 PARAMETER >> finest_mesh_size;
00233
00234
00235 PARAMETER >> test_processors;
00236
00237
00238 PARAMETER >> Grid_stretch;
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249 double alpha;
00250 double mu, E;
00251 double T_0;
00252
00253 mu = 0.25;
00254 E = 30000.0;
00255 alpha = 0.0000069;
00256 T_0 = 0.0;
00257
00258
00259 double heat_integral, kappa_x, kappa_y, kappa_z;
00260 double beta_third;
00261
00262 PARAMETER >> heat_integral;
00263
00264 kappa_x = 0.0103;
00265 kappa_y = 0.0103;
00266 kappa_z = 0.0103;
00267 beta_third = 0.2;
00268
00269
00270 bool infos;
00271 infos =true;
00272
00273
00274 int iteration_Poi;
00275 int iteration_elas;
00276 int solver_typ_elas;
00277 double bound_poiss, bound_elas;
00278 double eps;
00279
00280 PARAMETER >> solver_typ_elas;
00281 PARAMETER >> iteration_Poi;
00282
00283 PARAMETER >> iteration_elas;
00284
00285 bound_poiss = 0.000000001;
00286 bound_elas = 0.000000001;
00287
00288 eps = 0.0001;
00289
00290
00291 bool nonlinear_kappa;
00292 bool nonlinear_alpha;
00293
00294 PARAMETER >> nonlinear_kappa;
00295 nonlinear_alpha = true;
00296
00297
00298
00299 exit_type exit_hs;
00300 exit_hs = no_ex;
00301
00302
00303
00304 D3vector Vm(-0.5, -0.5, 0.0);
00305
00306 D3vector Vstretch(stretch_x,stretch_y,stretch_z/Grid_stretch);
00307
00308 Cylinder cylinder;
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322 double alpha_d, alpha_t, alpha_l, alpha_r;
00323
00324
00325
00326
00327
00328
00329
00330 alpha_d = -60;
00331 alpha_t = 60;
00332
00333 alpha_l = -5.0;
00334 alpha_r = 7.0;
00335
00336 double alpha_d_norm=atan(tan(alpha_d/180.*M_PI)/stretch_x*stretch_z);
00337 double alpha_t_norm=atan(tan(alpha_t/180.*M_PI)/stretch_x*stretch_z);
00338
00339 double alpha_l_norm=atan(tan(alpha_l/180.*M_PI)/stretch_y*stretch_z);
00340 double alpha_r_norm=atan(tan(alpha_r/180.*M_PI)/stretch_y*stretch_z);
00341
00342
00343 Skew_squareDTLR cube(alpha_d_norm, alpha_t_norm, alpha_l_norm, alpha_r_norm);
00344
00345
00346 Six_corner_pyramid Sechseck(D3vector(0.0,1.0,1.0),
00347 D3vector(1.0,0.0,1.0),
00348 D3vector(2.0,1.0,1.0),
00349 D3vector(2.0,2.0,1.0),
00350 D3vector(1.0,3.0,1.0),
00351 D3vector(0.0,2.0,1.0),
00352
00353 D3vector(-0.3,1.0,0.0),
00354 D3vector(1.0,-0.3,0.0),
00355 D3vector(2.3,1.0,0.0),
00356 D3vector(2.3,2.0,0.0),
00357 D3vector(1.0,3.3,0.0),
00358 D3vector(-0.3,2.0,0.0));
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373 Ball ball;
00374 Square square;
00375
00376 D3vector V1(-0.5,0.5,0.0);
00377 D3vector V2(0.5,0.0,0.5);
00378 D3vector V3(1.0,0.5,0.5);
00379
00380
00381 Domain domain(ball || ((square*V3) + V1) || ((square*V3) + V2));
00382
00383
00384
00385 Input_data_object* P_input_object;
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401 P_input_object = NULL;
00402
00403 ThreadComm commObj;
00404 ThreadComm* comm;
00405 comm = &commObj;
00406
00407 Grid_gen_parameters ggen_parameter;
00408
00409
00410 double off_par;
00411 double stre_par;
00412 int n_genau;
00413
00414 PARAMETER >> off_par;
00415 PARAMETER >> stre_par;
00416 PARAMETER >> n_genau;
00417 PARAMETER.close();
00418
00419
00420 ggen_parameter.Set_r_parallel(n_genau);
00421 ggen_parameter.Set_offset_square(off_par);
00422 ggen_parameter.Set_stretch_square(stre_par);
00423
00424 exit_hs = Solver(
00425 ggen_parameter,
00426 test_processors,
00427 finest_mesh_size,
00428 Grid_stretch,
00429 &domain,
00430
00431 kappa_x, kappa_y, kappa_z,
00432 Neumann_boundary,
00433 Third_boundary,
00434 beta_third,
00435 T_bulk,
00436 temp_Dirichlet,
00437 Heat_source,
00438
00439
00440
00441 P_input_object,
00442
00443
00444 true,
00445
00446
00447 heat_integral,
00448
00449 alpha,
00450 mu, E,
00451 T_0,
00452
00453 nonlinear_kappa,
00454 nonlinear_alpha,
00455 Material_A,
00456 nonlinear_kappa_A,
00457 nonlinear_kappa_B,
00458 nonlinear_alpha_A,
00459 nonlinear_alpha_B,
00460
00461 iteration_Poi,
00462 iteration_elas,
00463 solver_typ_elas,
00464 eps,
00465 bound_poiss,
00466 bound_elas,
00467
00468 infos,
00469
00470 comm,MPI_COMM_WORLD);
00471
00472
00473 if (exit_hs == hard_ex) {
00474 fout << "Calculation killed. " << endl;
00475 }
00476
00477
00478 if(my_rank==0) cout << " \n End: " << endl;
00479
00480 MPI_Finalize();
00481 }
00482
00483
00484
00485
00486
00487 void Print_Datas(Variable& ux, Variable& uy, Variable& uz,
00488 Variable& Temp,
00489 Variable& rx, Variable& ry, Variable& rz,
00490 Variable& One,
00491 Variable& zz,
00492 double T_0,
00493 double F,
00494 double mu,
00495 double alpha,
00496 Cell_Variable& Mat_A,
00497 ThreadComm* comm) {
00498 double spmax, spmin;
00499 int my_rank;
00500
00501 my_rank = ux.Give_grid()->Give_my_rank();
00502
00503
00504 ofstream DATEI;
00505
00506
00507 zz = (((ddx(ux) * (1.0-mu) + (ddy(uy) + ddz(uz)) * mu)
00508 / One) - ((1.0-mu) * alpha + mu * (alpha + alpha)) * (Temp - T_0))
00509 * F | all_points;
00510
00511
00512
00513
00514
00515
00516
00517 spmax = Maximum(zz);
00518 spmin = Minimum(zz);
00519 if(my_rank==0) fout <<" Maximum sxx: "<< spmax <<" Minimum sxx: "
00520 << spmin << endl;
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533 }
00534