00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 #ifndef _pdh_intf_
00059 #define _pdh_intf_
00060
00061 #ifdef __cplusplus
00062 extern "C"
00063 {
00064 #endif
00065
00071 #define PDC_PI 3.141592654
00072 #define PDC_SQRT_PI 1.772453851
00073 #define PDC_SQRT_3 1.732050808
00074
00075 #define PDC_MAXEQ 30
00076 #define PDC_MAXBCVAL 10
00078 #define PDC_INTERIOR -1
00079 #define PDC_BC_DIRI 1
00080 #define PDC_BC_NEUM 2
00081 #define PDC_BC_MIXED 3
00083 #define PDC_USE_CURRENT_PROBLEM_ID -1 // indicator passed as function argument to use
00084
00085
00087 extern const int PDC_ELEMENT;
00088 extern const int PDC_FACE ;
00089 extern const int PDC_EDGE ;
00090 extern const int PDC_VERTEX ;
00091 extern const int PDC_MIXED_ELEMENT;
00092 extern const int PDC_MIXED_FACE ;
00093 extern const int PDC_MIXED_EDGE ;
00094 extern const int PDC_MIXED_VERTEX ;
00095
00097 extern const int PDC_NO_COMP ;
00098 extern const int PDC_COMP_SM ;
00099 extern const int PDC_COMP_RHS ;
00100 extern const int PDC_COMP_BOTH;
00101 extern const int PDC_COMP_MM;
00103
00104
00105
00106 #define Current_solution_ID 1 // U^(n)_(k) after solver
00107 #define Previous_iteration_sol_ID 2 // U^(n)_(k-1)
00108 #define Previous_time_step_sol_ID 3 // U^(n)_0 = U^(n-1)
00109
00110 #define Geometry_dofs_ID 999
00111
00112
00113
00114 #define PDC_UNIFORM_DEREF -2 // uniform mesh refinement
00115 #define PDC_UNIFORM_REF -1 // uniform mesh refinement
00116 #define PDC_NO_ADAPT 0 // adaptations based on the knowledge of exact solution
00117 #define PDC_ADAPT_EXACT 1 // adaptations based on the knowledge of exact solution
00118 #define PDC_ADAPT_ZZ 2 // adaptations based on Zienkiewicz-Zhu error estimate
00119 #define PDC_ADAPT_EXPL 3 // adaptations based on explicit residual error estimate
00120
00121
00122
00123 #define PDC_MAX_DOF_PER_INT 70 // increased to 70 for constraint quadratic approximation
00124
00125
00126
00127 #include "uth_intf.h"
00128 extern utt_patches *pdv_patches;
00129
00130
00131
00132
00133
00134 int pdr_module_introduce(
00135
00136 char* Problem_module_name
00137 );
00138
00139
00140
00141
00142
00143
00144
00145
00146
00152 extern int pdr_get_list_ent(
00153 int Problem_id,
00154 int* Nr_int_ent,
00156 int** List_int_ent_type,
00157 int** List_int_ent_id,
00158 int* Nr_dof_ent,
00160 int** List_dof_ent_type,
00161 int** List_dof_ent_id,
00162 int** List_dof_ent_nrdofs,
00163 int* Nrdofs_glob,
00164 int* Max_dofs_per_dof_ent
00165 );
00166
00175 int pdr_get_list_ent_coarse(
00176 int Problem_id,
00177 int Nr_int_ent_fine,
00178 int* List_int_ent_type_fine,
00179 int* List_int_ent_id_fine,
00180 int Nr_dof_ent_fine,
00182 int* List_dof_ent_type_fine,
00183 int* List_dof_ent_id_fine,
00184 int* List_dof_ent_nrdofs_fine,
00185 int Nrdofs_glob_fine,
00186 int Max_dof_per_ent_fine,
00187 int* Pdeg_coarse,
00188 int* Nr_int_ent,
00189 int** List_int_ent_type,
00190 int** List_int_ent_id,
00191 int* Nr_dof_ent,
00193 int** List_dof_ent_type,
00194 int** List_dof_ent_id,
00195 int** List_dof_ent_nrdofs,
00196 int* Nrdofs_glob,
00197 int* Max_dof_per_ent
00198 );
00199
00200
00201
00202
00203
00204 int pdr_get_max_num_grid_levels(
00205 int Problem_id
00206 );
00207
00212 extern int pdr_create_assemble_stiff_mat(
00213 int Problem_id,
00214 int Level_id,
00215 int Comp_type,
00216
00217
00218
00219
00220 int* Pdeg_coarse_p,
00221 int Nr_int_ent,
00222 int* L_int_ent_type,
00223 int* L_int_ent_id,
00224 int Nr_colors_elems,
00225 int* L_color_index_elems,
00226 int Nr_colors_faces,
00227 int* L_color_index_faces,
00228 int* Asse_pos_first_dof_int_ent,
00229 int* Assembly_table,
00230 int* Pos_first_dof_int_ent,
00231 int* Local_to_global,
00232 int Max_dofs_int_ent
00233 );
00234
00235
00236
00237
00238
00239 int pdr_assemble_local_stiff_mat_with_table(
00240
00241 int Problem_id,
00242 int Level_id,
00243 int Comp_type,
00244
00245
00246
00247
00248 int Nr_dof_ent,
00249
00250 int* Assembly_table_int_ent,
00251 int* Local_to_global_int_ent,
00252 double* Stiff_mat,
00253 double* Rhs_vect,
00254 char* Rewr_dofs
00255
00256
00257 );
00258
00263 extern int pdr_assemble_local_stiff_mat(
00265 int Problem_id,
00266 int Level_id,
00267 int Comp_type,
00268
00269
00270
00271
00272 int Nr_dof_ent,
00273
00274 int* L_dof_ent_type,
00275 int* L_dof_ent_id,
00276 int* L_dof_ent_nrdofs,
00277 double* Stiff_mat,
00278 double* Rhs_vect,
00279 char* Rewr_dofs
00282 );
00283
00288 extern int pdr_comp_stiff_mat(
00289 int Problem_id,
00290 int Int_ent_type,
00291 int Int_ent_id,
00292 int Comp_sm,
00297 int *Pdeg,
00298 int* Nr_dof_ent,
00301 int* List_dof_ent_type,
00302 int* List_dof_ent_id,
00303 int* List_dof_ent_nrdofs,
00304 int* Nrdofs_loc,
00306 double* Stiff_mat,
00307 double* Rhs_vect,
00308 char* Rewr_dofs
00311 );
00312
00317 extern int pdr_comp_stiff_mat_uncon(
00318 int Problem_id,
00319 int Int_ent_type,
00320 int Int_ent_id,
00321 int Comp_sm,
00326 int *Pdeg,
00327 int* Nrdofs_loc,
00329 double* Stiff_mat,
00330 double* Rhs_vect,
00331 char* Rewr_dofs
00334 );
00335
00339 extern double pdr_err_indi (
00340 int Problem_id,
00341 int Mode,
00342 int El
00343
00344 );
00345
00350 extern int pdr_read_sol_dofs(
00351 int Problem_id,
00352 int Dof_ent_type,
00353 int Dof_ent_id,
00354 int Nrdofs,
00355 double* Vect_dofs
00356 );
00357
00362 extern int pdr_write_sol_dofs(
00363 int Problem_id,
00364 int Dof_ent_type,
00365 int Dof_ent_id,
00366 int Nrdofs,
00367 double* Vect_dofs
00368 );
00369
00373 extern int pdr_L2_proj_sol(
00374 int Problem_id,
00375 int El,
00376 int *Pdeg_vec,
00377 double* Dofs,
00379 int* El_from,
00380 int *Pdeg_vec_from,
00383 double* Dofs_from
00384 );
00385
00390 extern int pdr_renum_coeff(
00391 int Problem_id,
00392 int Ent_type,
00393 int Ent_id,
00394 double* Ren_coeff
00395 );
00396
00397
00402 extern int pdr_get_ent_pdeg(
00404 int Problem_id,
00405 int Ent_type,
00406 int Ent_id
00407 );
00408
00409
00413 extern int pdr_dof_ent_sons(
00414 int Problem_id,
00415 int Ent_type,
00416 int Ent_id,
00417 int *Ent_sons
00419 );
00420
00424 extern int pdr_proj_sol_lev(
00425 int Problem_id,
00426 int Solver_id,
00427 int Ilev_from,
00428 double* Vec_from,
00429 int Ilev_to,
00430 double* Vec_to
00431 );
00432
00436 extern double pdr_vec_norm(
00437 int Problem_id,
00438 int Solver_id,
00439 int Level_id,
00440 int Nrdof,
00441 double* Vector
00442 );
00443
00447 extern double pdr_sc_prod(
00448 int Problem_id,
00449 int Solver_id,
00450 int Level_id,
00451 int Nrdof,
00452 double* Vector1,
00453 double* Vector2
00454 );
00455
00459 extern int pdr_create_exchange_tables(
00461 int Problem_id,
00462 int Solver_id,
00463 int Level_id,
00464 int Nr_dof_ent,
00466 int* L_dof_ent_type,
00467 int* L_dof_ent_id,
00468 int* L_bl_nrdof,
00469 int* L_bl_posg,
00471 int* L_elem_to_bl,
00472 int* L_face_to_bl,
00473 int* L_edge_to_bl,
00474 int* L_vert_to_bl
00475 );
00476
00480 extern int pdr_exchange_dofs(
00481 int Problem_id,
00482 int Solver_id,
00483 int Level_id,
00484 double* Vec_dofs
00485 );
00486
00487
00488
00489
00490
00498 int pdr_select_el_coeff_vect(
00499 int Problem_id,
00500 int *Coeff_vect_ind
00501
00502
00503
00504
00505
00506
00507
00508
00509 );
00510
00511
00517 extern double* pdr_select_el_coeff(
00519 int Problem_id,
00520 double **Mval,
00521 double **Axx,double **Axy,double **Axz,
00522 double **Ayx,double **Ayy,double **Ayz,
00523 double **Azx,double **Azy,double **Azz,
00532 double **Bx,double **By,double **Bz,
00534 double **Tx,double **Ty,double **Tz,
00536 double **Cval,
00538 double **Lval,
00541 double **Qx,
00542 double **Qy,
00543 double **Qz,
00544 double **Sval
00545 );
00546
00552 extern int pdr_el_coeff(
00553 int Problem_id,
00554 int Elem,
00555 int Mat_num,
00556 double Hsize,
00557 int Pdeg,
00558 double *X_loc,
00559 double *Base_phi,
00560 double *Base_dphix,
00561 double *Base_dphiy,
00562 double *Base_dphiz,
00563 double *Xcoor,
00564 double *Uk_val,
00565 double *Uk_x,
00566 double *Uk_y,
00567 double *Uk_z,
00568 double *Un_val,
00569 double *Un_x,
00570 double *Un_y,
00571 double *Un_z,
00572 double *Mval,
00573 double *Axx, double *Axy, double *Axz,
00574 double *Ayx, double *Ayy, double *Ayz,
00575 double *Azx, double *Azy, double *Azz,
00584 double *Bx, double *By, double *Bz,
00586 double *Tx, double *Ty, double *Tz,
00588 double *Cval,
00590 double *Lval,
00593 double *Qx,
00594 double *Qy,
00595 double *Qz,
00596 double *Sval
00597 );
00598
00599
00601
00602
00603 #ifdef __cplusplus
00604 }
00605 #endif
00606
00607 #endif