00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef COMP_GNUOLD
00024 #include <iostream.h>
00025 #include <fstream.h>
00026 #include <time.h>
00027 #include <math.h>
00028 #else
00029 #include <iostream>
00030 #include <fstream>
00031 #include <ctime>
00032 #include <cmath>
00033 #endif
00034
00035
00036
00037 #include "../parser.h"
00038
00039
00040 #include "../paramete.h"
00041 #include "../abbrevi.h"
00042 #include "../math_lib/math_lib.h"
00043
00044
00045 #include "../basic/basic.h"
00046
00047
00048 #include "../domain/domain.h"
00049
00050
00051 #include "../formulas/boundy.h"
00052 #include "../formulas/loc_sten.h"
00053
00054
00055 #include "../grid/gpar.h"
00056 #include "../grid/parallel.h"
00057 #include "../grid/mgcoeff.h"
00058 #include "../grid/sto_man.h"
00059 #include "../grid/gridbase.h"
00060 #include "../grid/grid.h"
00061 #include "../grid/input.h"
00062
00063
00064 #include "../evpar/evpar.h"
00065
00066
00067
00068 #include "variable.h"
00069 #include "mg_op.h"
00070
00072
00074
00075
00076
00077 DExpr<DVar_Res_Op>
00078 Restriction_FE(Variable a)
00079 {
00080 typedef DVar_Res_Op ExprT;
00081 return DExpr<ExprT>(ExprT(a));
00082 }
00083
00084 DExpr<DVar_Prol_Op>
00085 Prolongation_FE(Variable a)
00086 {
00087 typedef DVar_Prol_Op ExprT;
00088 return DExpr<ExprT>(ExprT(a));
00089 }
00090
00091
00092
00093
00094 double DVar_Prol_Op::Give_at_Index(const Index3D I, const Grid* grid,
00095 int l) const {
00096
00097
00098 if(I.I_x().Tiefe()==l) {
00099 if(I.I_y().Tiefe()==l) {
00100 if(I.I_z().Tiefe()==l) {
00101
00102
00103 return 0.5 *
00104 (grid->Give_variable(I.next_EST(l),l-1)[v_.Number_variable()] +
00105 grid->Give_variable(I.next_WND(l),l-1)[v_.Number_variable()]);
00106 }
00107 else {
00108
00109
00110 return 0.5 *
00111 (grid->Give_variable(I.next_ES(l),l-1)[v_.Number_variable()] +
00112 grid->Give_variable(I.next_WN(l),l-1)[v_.Number_variable()]);
00113 }
00114 }
00115 else {
00116 if(I.I_z().Tiefe()==l) {
00117
00118
00119 return 0.5 *
00120 (grid->Give_variable(I.next_WT(l),l-1)[v_.Number_variable()] +
00121 grid->Give_variable(I.next_ED(l),l-1)[v_.Number_variable()]);
00122 }
00123 else {
00124
00125 return 0.5 *
00126 (grid->Give_variable(I.next_E(l),l-1)[v_.Number_variable()] +
00127 grid->Give_variable(I.next_W(l),l-1)[v_.Number_variable()]);
00128 }
00129 }
00130 }
00131 else {
00132 if(I.I_y().Tiefe()==l) {
00133 if(I.I_z().Tiefe()==l) {
00134
00135
00136 return 0.5 *
00137 (grid->Give_variable(I.next_ST(l),l-1)[v_.Number_variable()] +
00138 grid->Give_variable(I.next_ND(l),l-1)[v_.Number_variable()]);
00139 }
00140 else {
00141
00142 return 0.5 *
00143 (grid->Give_variable(I.next_N(l),l-1)[v_.Number_variable()] +
00144 grid->Give_variable(I.next_S(l),l-1)[v_.Number_variable()]);
00145 }
00146 }
00147 else {
00148 if(I.I_z().Tiefe()==l) {
00149
00150 return 0.5 *
00151 (grid->Give_variable(I.next_T(l),l-1)[v_.Number_variable()] +
00152 grid->Give_variable(I.next_D(l),l-1)[v_.Number_variable()]);
00153
00154
00155 }
00156 else {
00157
00158 return grid->Give_variable(I,l-1)[v_.Number_variable()];
00159 }
00160 }
00161 }
00162 return 0.0;
00163 };
00164