00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VARIABLE_H_
00018 #define VARIABLE_H_
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 enum Dominace_label { anti_dominant = -1, not_dominant = 0, yes_dominant = 1 };
00029
00030
00031 enum Differential_op_typ { not_abstract, abstract_with_var, abstract_diag ,
00032 abstract_both, not_both };
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #define double_stencils_in double *LuN, double *LuW, double *LuM, \
00053 double *LuE, double *LuS, double *LuT, double *LuD, double *LuND, \
00054 double *LuWN, double *LuWT, double *LuED, double *LuST, double *LuES, \
00055 double *LuWD, double *LuET, double *LuEST, double *LuWND, \
00056 double *LuCell_WSD, double *LuCell_WST, \
00057 double *LuCell_WND, double *LuCell_WNT, \
00058 double *LuCell_ESD, double *LuCell_EST, \
00059 double *LuCell_END, double *LuCell_ENT
00060 #define double_stencils_out LuN, LuW, LuM, LuE, LuS, LuT, LuD, LuND, \
00061 LuWN, LuWT, LuED, LuST, LuES, LuWD, LuET, LuEST, LuWND, \
00062 LuCell_WSD, LuCell_WST, LuCell_WND, LuCell_WNT, \
00063 LuCell_ESD, LuCell_EST, LuCell_END, LuCell_ENT
00064
00065
00066 template<class B>
00067 class DExprSim;
00068
00069 template<class A, class B>
00070 class DExprAnd;
00071
00072 class Variable;
00073 class Array_Variable;
00074 class Array_Local_var;
00075
00076 template<class R>
00077 class DExprResVarP;
00078
00079 class ExpdeIndex;
00080 class assignable_vector;
00081
00082
00083
00084 class FunctionClass {
00085 int r_boundary;
00086 bool r_interior;
00087 bool r_nearb;
00088 public:
00089 double (*Formula)(double x,double y,double z);
00090 template<class R>
00091 FunctionClass( double (*formula)(double x,double y,double z), const R& r)
00092 {
00093 Formula = formula;
00094 r_boundary = r.run_boundary();
00095 r_nearb = r.run_nearb();
00096 r_interior = r.run_interior();
00097 }
00098 bool run_interior() const { return r_interior; }
00099 bool run_nearb() const { return r_nearb; }
00100 int run_boundary() const { return r_boundary; }
00101
00102
00103 void Put_grid_rbo(Grid* gr, int r_bo) const { };
00104
00105 Differential_op_typ Abstract_differential_operator() const
00106 { return not_abstract; }
00107 };
00108
00110
00112
00113
00114 class Local_var {
00115 friend class Array_Local_var;
00116 private:
00117 double* value_;
00118 Local_var() {
00119 value_ = NULL;
00120 }
00121 void Initialize(double* v) {
00122 value_ = v;
00123 }
00124 void Initialize() {
00125 value_ = new double;
00126 *value_ = 0.0;
00127 }
00128 public:
00129 Local_var(double* v) {
00130 value_ = v;
00131 }
00132
00133
00134
00135
00136
00137
00138
00139 double Give_interior(const P_interior* it_i,const Grid* gr, double h_mesh,
00140 int l, double_stencils_in) const {
00141 return *value_;
00142 }
00143 double Give_interior_coarse(const P_interior* it_i,const Grid* gr,
00144 double h_mesh,
00145 int l, double_stencils_in) const {
00146 return *value_;
00147 }
00148 double Give_nearb(const P_nearb* it_n,const Grid* gr, double h_mesh, int l,
00149 const Nearb_Ablage* nearb_ablage)
00150 const {
00151 return *value_;
00152 };
00153 double Give_Bo2p(const P_Bo2p* it_b,const Grid* gr, int l) const {
00154 return *value_;
00155 };
00156 double Give_cellpoi(const P_cellpoi* it_cf,const Grid* gr,
00157 const BoCeData* bocedata) const {
00158 return *value_;
00159 };
00160
00161
00162 double* Give_regular_pointer(const P_interior* it_i,const Grid* gr, int l)
00163 const {
00164 return value_;
00165 };
00166 double* Give_regular_pointer(const P_nearb* it_n,const Grid* gr, int l)
00167 const {
00168 return value_;
00169 };
00170 double* Give_Bo2p_pointer(const P_Bo2p* it_b,const Grid* gr, int l) const {
00171 return value_;
00172 };
00173 double* Give_cellpoi_pointer(const P_cellpoi* it_cf,const Grid* gr) const {
00174 return value_;
00175 };
00176
00177
00178
00179 int Sice_stencil() const { return 1; }
00180
00181
00182 int Level() const { return 0; }
00183 Dominace_label Dominant_lev() const { return anti_dominant; }
00184 Dominace_label Dominant_poi() const { return anti_dominant; }
00185 bool run_interior() const { return true; }
00186 bool run_nearb() const { return true; }
00187 int run_boundary() const { return 1; }
00188
00189
00190 int ops_interior() const { return 0; }
00191
00192 void Active_Sim_Level( int lev) const { };
00193 void Active_Sim_interior(bool run) const { };
00194 void Active_Sim_nearb(bool run) const { };
00195 void Active_Sim_boundary( int run) const { };
00196 void Active_Sim_update(Evaluation_Parallelization_object* evpar,
00197 int level, type_of_update typ) const { };
00198
00199
00200 void Put_grid_rbo(Grid* gr, int r_bo) const { };
00201
00202 Differential_op_typ Abstract_differential_operator() const {
00203 return abstract_both;
00204 }
00205 int Give_number_var_of_abstract_op() const { return -1; }
00206 bool Give_array_variable_inserted() const {
00207 return false;
00208 }
00209 int Give_length_of_array_variable_inserted() const {
00210 return 0;
00211 }
00212
00213
00214 double Give_interior_sten_element(Index3D I, double meshsize,
00215 int stelle,
00216 const Grid* grid, int l) const {
00217 return *value_;
00218 }
00219 double Give_boundary_sten_element(const Grid* grid, BoCeData* b_cell,
00220 double* u_ablage, int num_v) const {
00221 return *value_;
00222 }
00223
00224
00225 void Put_interior(const P_interior* it_i, int lev, double x) { Put(x); };
00226 void Put_nearb(const P_nearb* it_n, int lev, double x) { Put(x); };
00227 void Put_Bo2p(const P_Bo2p* it_b, double x) { Put(x); };
00228 void Put_cellpoi(const P_cellpoi* it_cf, double x) { Put(x); };
00229
00230 void Put(double x) {
00231 *value_=x;
00232 };
00233 double Get() const {
00234 return *value_;
00235 };
00236 double* Give_pointer() const {
00237 return value_;
00238 };
00239
00240 void Add_variables_for_parallel(Evaluation_Parallelization_object *evpar)
00241 const {};
00242 bool GS_type(int var_number_left, int dim) const {
00243 return false; };
00244
00245
00246 void clean() const {};
00247 };
00248
00249
00250
00251 class Local_int {
00252 private:
00253 int* value_;
00254 public:
00255 Local_int(int* v) {
00256 value_ = v;
00257 *value_ = 0;
00258 }
00259 Local_int() {
00260 value_ = new int;
00261 *value_ = 0;
00262 }
00263
00264 double Give_interior(const P_interior* it_i,const Grid* gr, double h_mesh,
00265 int l, double_stencils_in) const {
00266 return (double)(*value_);
00267 }
00268 double Give_interior_coarse(const P_interior* it_i,const Grid* gr,
00269 double h_mesh,
00270 int l, double_stencils_in) const {
00271 return (double)(*value_);
00272 }
00273 double Give_nearb(const P_nearb* it_n,const Grid* gr, double h_mesh, int l,
00274 const Nearb_Ablage* nearb_ablage)
00275 const {
00276 return (double)(*value_);
00277 };
00278 double Give_Bo2p(const P_Bo2p* it_b,const Grid* gr, int l) const {
00279 return (double)(*value_);
00280 };
00281 double Give_cellpoi(const P_cellpoi* it_cf,const Grid* gr,
00282 const BoCeData* bocedata) const {
00283 return (double)(*value_);
00284 };
00285
00286 int Sice_stencil() const { return 1; }
00287
00288
00289 int Level() const { return 0; }
00290 Dominace_label Dominant_lev() const { return anti_dominant; }
00291 Dominace_label Dominant_poi() const { return anti_dominant; }
00292 bool run_interior() const { return true; }
00293 bool run_nearb() const { return true; }
00294 int run_boundary() const { return 1; }
00295
00296
00297 int ops_interior() const { return 0; }
00298
00299 void Active_Sim_Level( int lev) const { };
00300 void Active_Sim_interior(bool run) const { };
00301 void Active_Sim_nearb(bool run) const { };
00302 void Active_Sim_boundary( int run) const { };
00303 void Active_Sim_update(Evaluation_Parallelization_object* evpar,
00304 int level, type_of_update typ) const { };
00305
00306
00307 void Put_grid_rbo(Grid* gr, int r_bo) const { };
00308
00309 bool Abstract_differential_operator() const { return false; }
00310 bool Give_array_variable_inserted() const {
00311 return false;
00312 }
00313 int Give_length_of_array_variable_inserted() const {
00314 return 0;
00315 }
00316
00317
00318 void Put_interior(const P_interior* it_i, int lev, double x) { Put(x); };
00319 void Put_nearb(const P_nearb* it_n, int lev, double x) { Put(x); };
00320 void Put_Bo2p(const P_Bo2p* it_b, double x) { Put(x); };
00321 void Put_cellpoi(const P_cellpoi* it_cf, double x) { Put(x); };
00322
00323 void Put(double x) {
00324 cout << " \n type conversion in Local_int! " << endl;
00325 *value_=(int)x;
00326 };
00327 int Get() const {
00328 return *value_;
00329 };
00330 int* Give_pointer() const {
00331 return value_;
00332 };
00333
00334 void Add_variables_for_parallel(Evaluation_Parallelization_object *evpar)
00335 const {};
00336 bool GS_type(int var_number_left, int dim) const {
00337 return false; };
00338
00339
00340 void clean() const {};
00341 };
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352 #include "sim2.h"
00353
00354 template<class A>
00355 class DExpr {
00356 private:
00357 A a_;
00358
00359 public:
00360 DExpr(const A& x)
00361 : a_(x)
00362 {}
00363
00364 Grid* Give_grid() const {
00365 return a_.Give_grid();
00366 }
00367 int Number_variable() const {
00368 return a_.Number_variable();
00369 }
00370 int Number_variable_start() const {
00371 return a_.Number_variable_start();
00372 }
00373 int* Give_value() const {
00374 return a_.Give_value();
00375 }
00376 int Give_dim() const {
00377 return a_.Give_dim();
00378 }
00379 template<class B>
00380 DWrapSim<DExprVecSim<B> >
00381 operator== (const B& b_)
00382 {
00383 typedef DWrapSim<DExprVecSim<B> > ExprT;
00384 return ExprT(DExprVecSim<B>(Number_variable_start(),Give_value(),
00385 Give_dim(),b_));
00386 }
00387
00388
00389 double Give_interior(const P_interior* it_i,const Grid* gr, double h_mesh,
00390 int l, double_stencils_in) const {
00391 return a_.Give_interior(it_i,gr,h_mesh,l, double_stencils_out);
00392 };
00393 double Give_interior_coarse(const P_interior* it_i,const Grid* gr,
00394 double h_mesh, int l, double_stencils_in) const {
00395 return a_.Give_interior_coarse(it_i,gr,h_mesh,l, double_stencils_out);
00396 };
00397 double Give_nearb(const P_nearb* it_n,const Grid* gr, double h_mesh, int l,
00398 const Nearb_Ablage* nearb_ablage)
00399 const {
00400 return a_.Give_nearb(it_n,gr,h_mesh,l,nearb_ablage);
00401 };
00402 double Give_Bo2p(const P_Bo2p* it_b,const Grid* gr, int l) const {
00403 return a_.Give_Bo2p(it_b,gr,l);
00404 };
00405 double Give_cellpoi(const P_cellpoi* it_cf,const Grid* gr,
00406 const BoCeData* bocedata) const {
00407 return a_.Give_cellpoi(it_cf,gr,bocedata);
00408 };
00409
00410 double Give_interior_cell(const P_interior_cell* it_icell ,
00411 const Grid* gr, int l) const {
00412 return a_.Give_interior_cell(it_icell,gr,l);
00413 };
00414 double Give_bo_tet(const P_boundary_tet* it_bcell,
00415 const Grid* gr) const {
00416 return a_.Give_bo_tet(it_bcell,gr);
00417 };
00418
00419
00420 int Sice_stencil() const { return a_.Sice_stencil(); }
00421
00422
00423 int Level() const { return a_.Level(); }
00424 Dominace_label Dominant_lev() const { return a_.Dominant_lev(); }
00425 Dominace_label Dominant_poi() const { return a_.Dominant_poi(); }
00426 bool run_interior() const { return a_.run_interior(); }
00427 bool run_nearb() const { return a_.run_nearb(); }
00428 int run_boundary() const { return a_.run_boundary(); }
00429
00430
00431 int ops_interior() const { return a_.ops_interior(); }
00432
00433
00434 void Active_Sim_Level( int lev) const { a_.Active_Sim_Level(lev); }
00435 void Active_Sim_interior( bool run) const { a_.Active_Sim_interior(run); }
00436 void Active_Sim_nearb( bool run) const { a_.Active_Sim_nearb(run); }
00437 void Active_Sim_boundary(int run) const { a_.Active_Sim_boundary(run); }
00438 void Active_Sim_update(Evaluation_Parallelization_object* evpar,
00439 int level, type_of_update typ) const
00440 { a_.Active_Sim_update(evpar,level,typ); };
00441
00442
00443 void Put_grid_rbo(Grid* gr, int r_bo) const { a_.Put_grid_rbo(gr,r_bo); }
00444
00445
00446
00447 Differential_op_typ Abstract_differential_operator() const {
00448 return a_.Abstract_differential_operator(); }
00449 int Give_number_var_of_abstract_op() const {
00450 return a_.Give_number_var_of_abstract_op(); };
00451 bool Give_array_variable_inserted() const {
00452 return a_.Give_array_variable_inserted();
00453 }
00454 int Give_length_of_array_variable_inserted() const {
00455 return a_.Give_length_of_array_variable_inserted();
00456 }
00457
00458
00459 double Give_interior_sten_element(Index3D I, double meshsize,
00460 int stelle,
00461 const Grid* grid, int level) const {
00462 return a_.Give_interior_sten_element(I,meshsize,stelle,grid,level);
00463 }
00464 double Give_boundary_sten_element(const Grid* grid, BoCeData* b_cell,
00465 double* u_ablage, int num_v) const {
00466 return a_.Give_boundary_sten_element(grid, b_cell,u_ablage,num_v);
00467 }
00468
00469 void Add_variables_for_parallel(Evaluation_Parallelization_object *evpar)
00470 const {
00471 a_.Add_variables_for_parallel(evpar);
00472 };
00473 bool GS_type(int var_number_left, int dim) const {
00474 return a_.GS_type(var_number_left, dim);
00475 };
00476
00477
00478 double operator[] (ExpdeIndex& i);
00479
00480
00481 void clean() const { a_.clean(); };
00482 };
00483
00484
00485
00486
00487
00488 template<class A>
00489 class DExprResDomain {
00490 A a_;
00491 Domain* domain_R;
00492 public:
00493 DExprResDomain(const A& a, const Domain& dom)
00494 : a_(a) {
00495
00496 domain_R = new Domain(dom);
00497 }
00498 double Give_interior(const P_interior* it_i,const Grid* gr, double h_mesh,
00499 int l, double_stencils_in) const {
00500 return a_.Give_interior(it_i,gr,h_mesh,l, double_stencils_out);
00501 };
00502 double Give_interior_coarse(const P_interior* it_i,const Grid* gr,
00503 double h_mesh,
00504 int l, double_stencils_in) const {
00505 return a_.Give_interior_coarse(it_i,gr,h_mesh,l, double_stencils_out);
00506 };
00507 double Give_nearb(const P_nearb* it_n, const Grid* gr, double h_mesh, int l,
00508 const Nearb_Ablage* nearb_ablage)
00509 const {
00510 return a_.Give_nearb(it_n,gr,h_mesh,l,nearb_ablage);
00511 };
00512 double Give_Bo2p(const P_Bo2p* it_b, const Grid* gr, int l) const {
00513 return a_.Give_Bo2p(it_b,gr,l);
00514 };
00515 double Give_cellpoi(const P_cellpoi* it_cf, const Grid* gr,
00516 const BoCeData* bocedata)
00517 const {
00518 return a_.Give_cellpoi(it_cf,gr,bocedata);
00519 };
00520
00521
00522 int Sice_stencil() const { return a_.Sice_stencil(); }
00523
00524
00525 int Level() const { return a_.Level(); }
00526 Dominace_label Dominant_lev() const { return a_.Dominant_lev(); }
00527 Dominace_label Dominant_poi() const { return yes_dominant; }
00528 bool run_domain() const { return true; }
00529
00530
00531 int ops_interior() const { return a_.ops_interior(); }
00532 int ops_nearb() const { return a_.ops_nearb(); }
00533 int ops_Bo2p() const { return a_.ops_Bo2p(); }
00534
00535
00536 void Active_Sim_Level( int lev) const { a_.Active_Sim_Level(lev); };
00537 void Active_Sim_update(Evaluation_Parallelization_object* evpar,
00538 int level, type_of_update typ) const
00539 { a_.Active_Sim_update(evpar,level,typ); };
00540
00541
00542 bool point_in_domain(double x, double y, double z) const {
00543 return domain_R->point_in_domain(D3vector(x,y,z));
00544 }
00545
00546
00547 void Put_grid_rbo(Grid* gr, int r_bo) const { a_.Put_grid_rbo(gr,r_bo); }
00548
00549 Differential_op_typ Abstract_differential_operator() const {
00550 return a_.Abstract_differential_operator();
00551 }
00552
00553 void Add_variables_for_parallel(Evaluation_Parallelization_object *evpar)
00554 const {
00555 a_.Add_variables_for_parallel(evpar);
00556 };
00557 bool GS_type(int var_number_left, int dim) const {
00558 return a_.GS_type(var_number_left,dim);
00559 };
00560
00561
00562 void clean() const {
00563 a_.clean();
00564 delete(domain_R);
00565 };
00566 };
00567
00568
00569
00570 class Variable {
00571 friend class Array_Variable;
00572 private:
00573 Variable();
00574 void Initialize(Grid* gridp);
00575
00576
00577
00578 int r_boundary;
00579 bool r_interior;
00580 bool r_nearb;
00581 int level;
00582
00583
00584 P_interior *iter_i;
00585 P_nearb *iter_n;
00586 P_Bo2p *iter_b;
00587 P_cellpoi *iter_cf;
00588
00589
00590 Nearb_Ablage* nearb_ablage;
00591
00592
00593 Grid *grid;
00594
00595
00596 int number_variable;
00597
00598
00599 template<class A>
00600 void evaluate_interior_dom(const DExprResDomain<A>& a_,
00601 int lev,double h_mesh);
00602 template<class A>
00603 void evaluate_nearb_dom(const DExprResDomain<A>& a_, int lev, double h_mesh);
00604 template<class A>
00605 void evaluate_boundary_dom(const DExprResDomain<A>& a_, int lev);
00606 public:
00607 Variable(Grid* gridp);
00608
00609 int my_rank() { return grid->Give_my_rank(); };
00610 class Variable* Give_my_pointer() { return this; }
00611
00613
00614 void Print_AVS(ofstream *Datei) {
00615 grid->Print_Variable_AVS(Datei,number_variable);
00616 }
00617 int Number_variable() const { return number_variable; }
00618 int Number_variable_start() const {
00619 return number_variable;
00620 }
00621
00622
00623 int Sice_stencil() const { return 1; }
00624
00625
00626 bool Give_array_variable_inserted() const {
00627 return false;
00628 }
00629 int Give_length_of_array_variable_inserted() const {
00630 return 0;
00631 }
00632
00633 inline void Test_init() { grid->Test_init(); }
00634
00635
00636 inline int Level() const { return level; }
00637 inline int Ebene() const { return level; }
00638 inline void Level_up();
00639 inline void Level_down();
00640 inline void Active_Level(int Level);
00641
00642
00643 int ops_interior() const { return 0; }
00644
00645
00646 inline void Active_interior(bool run);
00647 inline void Active_nearb(bool run);
00648 inline void Active_boundary(int run_bo);
00649
00650 inline void Active_update(Evaluation_Parallelization_object* evpar,
00651 int level, type_of_update typ);
00652
00653 inline void Active_only_boundary(bool run);
00654
00655 inline bool run_interior() const { return r_interior; }
00656 inline bool run_nearb() const { return r_nearb; }
00657 inline int run_boundary() const { return r_boundary; }
00658
00659 Dominace_label Dominant_lev() const { return not_dominant; }
00660 Dominace_label Dominant_poi() const { return not_dominant; }
00661
00662 inline int Max_Level() const { return grid->Max_level(); }
00663
00664
00665 void Active_Sim_Level( int lev) const { };
00666 void Active_Sim_interior(bool run) const { };
00667 void Active_Sim_nearb(bool run) const { };
00668 void Active_Sim_boundary( int run) const { };
00669 void Active_Sim_update(Evaluation_Parallelization_object* evpar,
00670 int level, type_of_update typ) const { };
00671
00672 inline Grid* Give_grid() const {
00673 if(developer_version) {
00674 if(grid==NULL) cout << "\n Variable is not initialized! Error!" << endl;
00675 }
00676 return grid;
00677 }
00678
00679
00680 double Give_interior_simple(const P_interior* it_i,const Grid* gr,
00681 int l) const;
00682 double Give_nearb(const P_nearb* it_n,const Grid* gr,
00683 double h_mesh, int l) const;
00684 double Give_cellpoi(const P_cellpoi* it_cf, const Grid* gr) const;
00685
00686
00687 double Give_interior(const P_interior* it_i,const Grid* gr,
00688 double h_mesh, int l, double_stencils_in) const;
00689 double Give_interior_coarse(const P_interior* it_i,const Grid* gr,
00690 double h_mesh, int l, double_stencils_in) const;
00691 double Give_nearb(const P_nearb* it_n,const Grid* gr, double h_mesh, int l,
00692 const Nearb_Ablage* nearb_ablage) const;
00693 double Give_Bo2p(const P_Bo2p* it_b, const Grid* gr, int l) const;
00694 double Give_cellpoi(const P_cellpoi* it_cf, const Grid* gr,
00695 const BoCeData* bocedata) const;
00696
00697
00698
00699 void Put_interior(const P_interior* it_i, int lev, double x);
00700 void Put_nearb(const P_nearb* it_n, int lev, double x);
00701 void Put_Bo2p(const P_Bo2p* it_b, double x);
00702 void Put_cellpoi(const P_cellpoi* it_cf, double x);
00703
00704
00705
00706 template<class A>
00707 inline void operator=(const DExpr<A>& a_);
00708
00709
00710 template<class A>
00711 void evaluate_interior_15_evaluation_fine(const DExpr<A>& a_,
00712 Evaluation_Parallelization_object* ev_par_obj,
00713 double h_mesh, int lev);
00714 template<class A>
00715 void evaluate_interior_17_evaluation_fine(const DExpr<A>& a_,
00716 Evaluation_Parallelization_object* ev_par_obj,
00717 double h_mesh, int lev);
00718 template<class A>
00719 void evaluate_interior_25_evaluation_fine(const DExpr<A>& a_,
00720 Evaluation_Parallelization_object* ev_par_obj,
00721 double h_mesh, int lev);
00722 template<class A>
00723 void evaluate_interior_1_evaluation_fine(const DExpr<A>& a_,
00724 Evaluation_Parallelization_object* ev_par_obj,
00725 double h_mesh, int lev);
00726
00727 template<class A>
00728 void operator=(const DExprResDomain<A>& a_);
00729 void operator=(const Variable &v);
00730 template<class R>
00731 void operator=(const DExprResVarP<R> &r_);
00732 void operator=(double (*Formula)(double x,double y,double z));
00733 void operator=(const FunctionClass& function);
00734 void operator= (double x);
00735 void operator= (Input_data_object& input_object);
00736
00737 void Add_variables_for_parallel(Evaluation_Parallelization_object *evpar)
00738 const {
00739 };
00740 bool GS_type(int var_number_left, int dim) const {
00741 return false; };
00742
00743
00744 assignable_vector operator[] (ExpdeIndex& i);
00745
00746
00747 void clean() const { };
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759 void Put_grid_rbo(Grid* gr, int r_bo) const { };
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780 };
00781
00782
00783
00784
00785
00786
00787 class DExprVAR {
00788 private:
00789
00790 int r_boundary;
00791 bool r_interior;
00792 bool r_nearb;
00793 int level;
00794
00795
00796 int number_variable;
00797 public:
00798 DExprVAR(const Variable& vec) {
00799 r_boundary = vec.run_boundary();
00800 r_interior = vec.run_interior();
00801 r_nearb = vec.run_nearb();
00802 level = vec.Level();
00803 number_variable = vec.Number_variable();
00804 }
00805 double Give_interior(const P_interior* it_i,const Grid* gr, double h_mesh,
00806 int l, double_stencils_in) const {
00807 return it_i->varM(gr,l)[number_variable];
00808 };
00809 double Give_interior_coarse(const P_interior* it_i,const Grid* gr,
00810 double h_mesh, int l, double_stencils_in) const {
00811 return it_i->varM(gr,l)[number_variable];
00812 };
00813 double Give_nearb(const P_nearb* it_n,const Grid* gr, double h_mesh, int l,
00814 const Nearb_Ablage* nearb_ablage)
00815 const {
00816 return it_n->varM(gr,l)[number_variable];
00817 };
00818 double Give_Bo2p(const P_Bo2p* it_b,const Grid* gr, int l) const {
00819 return it_b->varM(gr)[number_variable];
00820 };
00821 double Give_cellpoi(const P_cellpoi* it_cf,const Grid* gr,
00822 const BoCeData* bocedata) const {
00823 return it_cf->varM(gr)[number_variable];
00824 };
00825
00826
00827 double* Give_regular_pointer(const P_interior* it_i,const Grid* gr, int l)
00828 const {
00829 return &(it_i->varM(gr,l)[number_variable]);
00830 };
00831 double* Give_regular_pointer(const P_nearb* it_n,const Grid* gr, int l)
00832 const {
00833 return &(it_n->varM(gr,l)[number_variable]);
00834 };
00835 double* Give_Bo2p_pointer(const P_Bo2p* it_b,const Grid* gr, int l) const {
00836 return &(it_b->varM(gr)[number_variable]);
00837 };
00838 double* Give_cellpoi_pointer(const P_cellpoi* it_cf,const Grid* gr) const {
00839 return &(it_cf->varM(gr)[number_variable]);
00840 };
00841
00842
00843 int Sice_stencil() const { return 1; }
00844
00845
00846 int Level() const { return level; }
00847 Dominace_label Dominant_lev() const { return not_dominant; }
00848 Dominace_label Dominant_poi() const { return not_dominant; }
00849 bool run_interior() const { return r_interior; }
00850 bool run_nearb() const { return r_nearb; }
00851 int run_boundary() const { return r_boundary; }
00852
00853
00854 int ops_interior() const { return 0; }
00855
00856
00857 void Active_Sim_Level( int lev) const { };
00858 void Active_Sim_interior(bool run) const { };
00859 void Active_Sim_nearb(bool run) const { };
00860 void Active_Sim_boundary( int run) const { };
00861 void Active_Sim_update(Evaluation_Parallelization_object* evpar,
00862 int level, type_of_update typ) const { };
00863
00864
00865 void Put_grid_rbo(Grid* gr, int r_bo) const { };
00866
00867
00868
00869 Differential_op_typ Abstract_differential_operator()
00870 const { return abstract_both; }
00871 int Give_number_var_of_abstract_op() const { return -1; }
00872 bool Give_array_variable_inserted() const {
00873 return false;
00874 }
00875 int Give_length_of_array_variable_inserted() const {
00876 return 0;
00877 }
00878
00879
00880 double Give_interior_sten_element(Index3D I, double meshsize,
00881 int stelle,
00882 const Grid* grid, int l) const {
00883 return (grid->Give_variable(I.neighbour(ESTd),l)[number_variable] +
00884 grid->Give_variable(I.neighbour(WNDd),l)[number_variable])
00885 * 0.5;
00886 }
00887 double Give_boundary_sten_element(const Grid* grid, BoCeData* b_cell,
00888 double* u_ablage, int num_v) const {
00889 return b_cell->vars[num_v][number_variable];
00890
00891 }
00892
00893 void Add_variables_for_parallel(Evaluation_Parallelization_object *evpar)
00894 const {
00895 };
00896 bool GS_type(int var_number_left, int dim) const {
00897 return false; };
00898
00899
00900 void clean() const { };
00901 };
00902
00903
00904
00905
00906
00907 class DExprLIT {
00908 private:
00909 double value_;
00910 public:
00911 DExprLIT(double value)
00912 { value_ = value; }
00913 double Give_interior(const P_interior* it_i,const Grid* gr,double h_mesh,
00914 int l, double_stencils_in) const {
00915 return value_;
00916 };
00917 double Give_interior_coarse(const P_interior* it_i,const Grid* gr,
00918 double h_mesh, int l, double_stencils_in) const {
00919 return value_;
00920 };
00921 double Give_nearb(const P_nearb* it_n,const Grid* gr,double h_mesh, int l,
00922 const Nearb_Ablage* nearb_ablage)
00923 const {
00924 return value_;
00925 };
00926 double Give_Bo2p(const P_Bo2p* it_b,const Grid* gr, int l) const {
00927 return value_;
00928 };
00929 double Give_cellpoi(const P_cellpoi* it_cf,const Grid* gr,
00930 const BoCeData* bocedata) const {
00931 return value_;
00932 };
00933
00934
00935 double Give_interior_cell(const P_interior_cell* it_icell ,
00936 const Grid* gr, int l) const {
00937 return value_;
00938 };
00939 double Give_bo_tet(const P_boundary_tet* it_bcell,
00940 const Grid* gr) const {
00941 return value_;
00942 };
00943
00944
00945 int Sice_stencil() const { return 0; }
00946
00947
00948 int Level() const { return 0; }
00949 Dominace_label Dominant_lev() const { return anti_dominant; }
00950 Dominace_label Dominant_poi() const { return anti_dominant; }
00951 bool run_interior() const { return true; }
00952 bool run_nearb() const { return true; }
00953 int run_boundary() const { return true; }
00954
00955
00956 int ops_interior() const { return 0; }
00957
00958
00959 void Active_Sim_Level( int lev) const { };
00960 void Active_Sim_interior(bool run) const { };
00961 void Active_Sim_nearb(bool run) const { };
00962 void Active_Sim_boundary( int run) const { };
00963 void Active_Sim_update(Evaluation_Parallelization_object* evpar,
00964 int level, type_of_update typ) const { };
00965
00966
00967 void Put_grid_rbo(Grid* gr, int r_bo) const { };
00968
00969
00970
00971 Differential_op_typ Abstract_differential_operator() const
00972 { return abstract_both; }
00973 int Give_number_var_of_abstract_op() const { return -1; }
00974 bool Give_array_variable_inserted() const {
00975 return false;
00976 }
00977 int Give_length_of_array_variable_inserted() const {
00978 return 0;
00979 }
00980
00981
00982 double Give_interior_sten_element(Index3D I, double meshsize,
00983 int stelle,
00984 const Grid* grid, int l) const {
00985 return value_;
00986 }
00987 double Give_boundary_sten_element(const Grid* grid, BoCeData* b_cell,
00988 double* u_ablage, int num_v) const {
00989 return value_;
00990 }
00991
00992 void Add_variables_for_parallel(Evaluation_Parallelization_object *evpar)
00993 const {};
00994 bool GS_type(int var_number_left, int dim) const {
00995 return false; };
00996
00997
00998 void clean() const { };
00999 };
01000
01001
01003
01005
01006
01007 double Maximum(Variable& a);
01008 double Minimum(Variable& a);
01009 double L_infty(Variable& a);
01010
01011
01012 double product(Variable& b, Variable& a);
01013 double product(Variable& a1, Variable& a2, Variable& a3,
01014 Variable& b1, Variable& b2, Variable& b3);
01015
01016
01017
01018
01019 void Print_UCD(Variable& a,ofstream *Datei);
01020 void Print_UCD_parallel(Variable& a,ofstream *Datei);
01021 void Print_UCD_parallel(Variable& a,ofstream *Datei, int level);
01022 void Print_UCD_surface_parallel(Variable& a,ofstream *Datei);
01023 void Print_UCD(Variable& a, Variable& b, Variable& c, ofstream *Datei);
01024 void Print_UCD_parallel(Variable& a, Variable& b, Variable& c,
01025 ofstream *Datei);
01026 void Print_UCD_moved(Variable& v,
01027 Variable& a, Variable& b, Variable& c, ofstream *Datei);
01028 void Print_UCD_moved_parallel(Variable& v,
01029 Variable& a, Variable& b, Variable& c, ofstream *Datei);
01030
01031 void Print_Gnuplot_moved(Variable& a, Variable& b, Variable& c,
01032 ofstream *Datei);
01033
01034 void Print_Dx(Variable& a,ofstream *Datei);
01035 void Print_Dx_parallel(Variable& a,ofstream *Datei);
01036 void Print_Dx_moved(Variable& v,
01037 Variable& a, Variable& b, Variable& c, ofstream *Datei);
01038
01039 void Print(Variable& a);
01040
01041
01042
01043 void Normal_vector(Variable& vx, Variable& vy, Variable& vz);
01044
01045
01046 void Sum_ghost_nodes(Variable& vx);
01047 void Update_ghost_nodes(Variable& vx);
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057 inline void Variable::Active_boundary(int run_bo) {
01058 r_boundary = run_bo;
01059 if(run_bo==false && r_interior==false && r_nearb==false)
01060 Active_interior(true);
01061 }
01062
01063
01064 inline void Variable::Active_update(Evaluation_Parallelization_object* evpar,
01065 int level, type_of_update typ) {
01066 evpar->Set_type_of_update(number_variable,level,no_update);
01067 }
01068
01069
01070 inline double Variable::Give_interior_simple(const P_interior* it_i,
01071 const Grid* gr, int l) const {
01072 return it_i->varM(gr,l)[number_variable];
01073 };
01074
01075 inline double Variable::Give_interior(const P_interior* it_i,const Grid* gr,
01076 double h_mesh, int l, double_stencils_in) const {
01077 return it_i->varM(gr,l)[number_variable];
01078 };
01079
01080 inline double Variable::Give_interior_coarse(const P_interior* it_i,
01081 const Grid* gr,
01082 double h_mesh, int l, double_stencils_in) const {
01083 return it_i->varM(gr,l)[number_variable];
01084 };
01085
01086 inline double Variable::Give_nearb(const P_nearb* it_n,const Grid* gr,
01087 double h_mesh, int l) const {
01088 return it_n->varM(gr,l)[number_variable];
01089 };
01090
01091 inline double Variable::Give_nearb(const P_nearb* it_n,const Grid* gr,
01092 double h_mesh, int l,
01093 const Nearb_Ablage* nearb_ablage) const {
01094 return it_n->varM(gr,l)[number_variable];
01095 };
01096
01097 inline double Variable::Give_Bo2p(const P_Bo2p* it_b, const Grid* gr, int l)
01098 const {
01099 return it_b->varM(gr)[number_variable];
01100 };
01101
01102 inline double Variable::Give_cellpoi(const P_cellpoi* it_cf, const Grid* gr,
01103 const BoCeData* bocedata) const {
01104 return it_cf->varM(gr)[number_variable];
01105 };
01106 inline double Variable::Give_cellpoi(const P_cellpoi* it_cf,
01107 const Grid* gr) const {
01108 return it_cf->varM(gr)[number_variable];
01109 };
01110
01111 inline void Variable::Put_interior(const P_interior* it_i, int lev, double x) {
01112 it_i->varM(grid,lev)[number_variable] = x;
01113 };
01114 inline void Variable::Put_nearb(const P_nearb* it_n, int lev, double x) {
01115 it_n->varM(grid,lev)[number_variable] = x;
01116 };
01117 inline void Variable::Put_Bo2p(const P_Bo2p* it_b, double x) {
01118 it_b->varM(grid)[number_variable] = x;
01119 };
01120 inline void Variable::Put_cellpoi(const P_cellpoi* it_cf, double x) {
01121 it_cf->varM(grid)[number_variable] = x;
01122 };
01123
01124
01125 inline void Variable::Level_up() {
01126 level++;
01127 }
01128 inline void Variable::Level_down() {
01129 level--;
01130 }
01131 inline void Variable::Active_Level(int Level) {
01132 level = Level;
01133 }
01134
01135
01136 inline void Variable::Active_interior(bool run) {
01137 r_interior = run;
01138 }
01139 inline void Variable::Active_nearb(bool run) {
01140 r_nearb = run;
01141 }
01142
01143 inline void Variable::Active_only_boundary(bool run) {
01144 r_boundary = run;
01145 }
01146
01147
01148 #endif
01149