Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

src/expde/extemp/opera.cc

Go to the documentation of this file.
00001 //    expde: expression templates for partial differential equations.
00002 //    Copyright (C) 2001  Christoph Pflaum
00003 //    This program is free software; you can redistribute it and/or modify
00004 //    it under the terms of the GNU General Public License as published by
00005 //    the Free Software Foundation; either version 2 of the License, or
00006 //    (at your option) any later version.
00007 //
00008 //    This program is distributed in the hope that it will be useful,
00009 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 //    GNU General Public License for more details.
00012 //
00013 //                 SEE  Notice1.doc made by 
00014 //                 LAWRENCE LIVERMORE NATIONAL LABORATORY
00015 //
00016 
00017 // ------------------------------------------------------------
00018 // operator.cc
00019 //
00020 // ------------------------------------------------------------
00021 
00022 // Include level 0:
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 // Include level 0:
00037 #include "../parser.h"
00038 
00039 // Include level 1:
00040 #include "../paramete.h"
00041 #include "../abbrevi.h"
00042 #include "../math_lib/math_lib.h"
00043 
00044 // Include level 2:
00045 #include "../basic/basic.h"
00046 
00047 // Include level 3:
00048 #include "../domain/domain.h"
00049 
00050 // Include level 4:
00051 #include "../formulas/boundy.h"
00052 #include "../formulas/loc_sten.h"
00053 #include "../formulas/diffop.h"
00054 #include "../formulas/diffopc.h"
00055 #include "../formulas/diffopv.h"
00056 
00057 // Include level 5:
00058 #include "../grid/gpar.h"
00059 #include "../grid/parallel.h"
00060 #include "../grid/mgcoeff.h"
00061 #include "../grid/sto_man.h"
00062 #include "../grid/gridbase.h"
00063 #include "../grid/grid.h"
00064 #include "../grid/input.h"
00065 
00066 // Include level 5.1
00067 #include "../evpar/evpar.h"
00068 
00069 
00070 // Include level 6:
00071 #include "variable.h"
00072 #include "opera.h"
00073 
00074 #include "operav.h"
00075 //#include "extemp/mg_op.h"
00076 #include "sim.h"
00077 #include "res_op.h"
00078 //#include "extemp/res_opv.h"
00079 //#include "extemp/extra.h"
00080 #include "array.h"
00081 
00082 
00083 
00084 
00085 
00087                // member functions of operator.h
00089 
00090 
00091 /* Unary operators */
00092 // Laplace
00093 #define Macro_operator_implement(insertA) \
00094 DExpr<DVarDiff_15S_Op< insertA , laplace_FE_const> > \
00095 Laplace_FE(const insertA & a) \
00096 { \
00097  typedef DVarDiff_15S_Op< insertA , laplace_FE_const> ExprT; \
00098   return DExpr<ExprT>(ExprT(a)); \
00099 }; \
00100 /* DxDx */ \
00101 DExpr<DVarDiff_15S_Op<insertA, dxdx_FE_const> > \
00102 DxDx_FE(insertA a) \
00103 { \
00104   typedef DVarDiff_15S_Op<insertA, dxdx_FE_const> ExprT; \
00105   return DExpr<ExprT>(ExprT(a)); \
00106 } \
00107 /* Dydy */ \
00108 DExpr<DVarDiff_15S_Op<insertA, dydy_FE_const> > \
00109 DyDy_FE(insertA a) \
00110 { \
00111   typedef DVarDiff_15S_Op<insertA, dydy_FE_const> ExprT; \
00112   return DExpr<ExprT>(ExprT(a)); \
00113 } \
00114 /* Dzdz */ \
00115 DExpr<DVarDiff_15S_Op<insertA, dzdz_FE_const> > \
00116 DzDz_FE(insertA  a) \
00117 { \
00118   typedef DVarDiff_15S_Op<insertA, dzdz_FE_const>  ExprT; \
00119   return DExpr<ExprT>(ExprT(a)); \
00120 } \
00121 /* Helm */ \
00122 DExpr<DVarDiff_15S_Op<insertA, helm_FE_const> > \
00123 Helm_FE(insertA a) \
00124 { \
00125   typedef DVarDiff_15S_Op<insertA, helm_FE_const> ExprT; \
00126   return DExpr<ExprT>(ExprT(a)); \
00127 } \
00128 /* ///////////////////////// \
00129 // Nichsymmetrische Terme \
00131 /* Dxdy */ \
00132 DExpr<DVarDiff_15S_Op<insertA, dxdy_FE_const> > \
00133 DxDy_FE(insertA a) \
00134 { \
00135   typedef DVarDiff_15S_Op<insertA, dxdy_FE_const> ExprT; \
00136   return DExpr<ExprT>(ExprT(a)); \
00137 } \
00138 /* Dydx */ \
00139 DExpr<DVarDiff_15S_Op<insertA, dydx_FE_const> > \
00140 DyDx_FE(insertA a) \
00141 { \
00142   typedef DVarDiff_15S_Op<insertA, dydx_FE_const> ExprT; \
00143   return DExpr<ExprT>(ExprT(a)); \
00144 } \
00145 /* Dxdz */ \
00146 DExpr<DVarDiff_15S_Op<insertA, dxdz_FE_const> > \
00147 DxDz_FE(insertA a) \
00148 { \
00149   typedef DVarDiff_15S_Op<insertA, dxdz_FE_const> ExprT; \
00150   return DExpr<ExprT>(ExprT(a)); \
00151 } \
00152 /* Dzdx */ \
00153 DExpr<DVarDiff_15S_Op<insertA, dzdx_FE_const> > \
00154 DzDx_FE(insertA a) \
00155 { \
00156   typedef DVarDiff_15S_Op<insertA, dzdx_FE_const> ExprT; \
00157   return DExpr<ExprT>(ExprT(a)); \
00158 } \
00159 /* Dydz */ \
00160 DExpr<DVarDiff_15S_Op<insertA, dydz_FE_const> > \
00161 DyDz_FE(insertA a) \
00162 { \
00163   typedef DVarDiff_15S_Op<insertA, dydz_FE_const> ExprT; \
00164   return DExpr<ExprT>(ExprT(a)); \
00165 } \
00166 /* Dzdy */ \
00167 DExpr<DVarDiff_15S_Op<insertA, dzdy_FE_const> > \
00168 DzDy_FE(insertA a) \
00169 { \
00170   typedef DVarDiff_15S_Op<insertA, dzdy_FE_const> ExprT; \
00171   return DExpr<ExprT>(ExprT(a)); \
00172 } \
00173 DExpr<DVarDiff_15S_Op<insertA, dxhelm_FE_const> > \
00174 DX_FE(insertA a) \
00175 { \
00176   typedef DVarDiff_15S_Op<insertA, dxhelm_FE_const> ExprT; \
00177   return DExpr<ExprT>(ExprT(a)); \
00178 } \
00179 DExpr<DVarDiff_15S_Op<insertA, helmdx_FE_const> > \
00180 DX_FE_t(insertA a) \
00181 { \
00182   typedef DVarDiff_15S_Op<insertA, helmdx_FE_const> ExprT; \
00183   return DExpr<ExprT>(ExprT(a)); \
00184 } \
00185 DExpr<DVarDiff_15S_Op<insertA, dyhelm_FE_const> > \
00186 DY_FE(insertA a) \
00187 { \
00188   typedef DVarDiff_15S_Op<insertA, dyhelm_FE_const> ExprT; \
00189   return DExpr<ExprT>(ExprT(a)); \
00190 } \
00191 DExpr<DVarDiff_15S_Op<insertA, helmdy_FE_const> > \
00192 DY_FE_t(insertA a) \
00193 { \
00194   typedef DVarDiff_15S_Op<insertA, helmdy_FE_const> ExprT; \
00195   return DExpr<ExprT>(ExprT(a)); \
00196 } \
00197 DExpr<DVarDiff_15S_Op<insertA, dzhelm_FE_const> > \
00198 DZ_FE(insertA a) \
00199 { \
00200   typedef DVarDiff_15S_Op<insertA, dzhelm_FE_const> ExprT; \
00201   return DExpr<ExprT>(ExprT(a)); \
00202 } \
00203 DExpr<DVarDiff_15S_Op<insertA, helmdz_FE_const> > \
00204 DZ_FE_t(insertA a) \
00205 { \
00206   typedef DVarDiff_15S_Op<insertA, helmdz_FE_const> ExprT; \
00207   return DExpr<ExprT>(ExprT(a)); \
00208 } \
00209 /* /////////////////////////  \
00210 // Rand-operatoren \
00212 DExpr<DVarDiff_15S_Op<insertA, L2boundary_const> > \
00213 Int_boundary(insertA a) \
00214 { \
00215   typedef DVarDiff_15S_Op<insertA, L2boundary_const> ExprT; \
00216   return DExpr<ExprT>(ExprT(a)); \
00217 }
00218 
00219 Macro_operator_implement(Variable);
00220 Macro_operator_implement(DExpr<DExprVAR_ARR>);
00221 
00222 
00223 
00224 /* Unary operators */
00225 
00226 // Laplace
00227 DExpr<DiagonalDiff_Op<laplace_FE_const> >
00228 Diag_Laplace_FE()
00229 {
00230   typedef DiagonalDiff_Op<laplace_FE_const> ExprT;
00231   return DExpr<ExprT>(ExprT());
00232 }
00233 
00234 // DxDx
00235 DExpr<DiagonalDiff_Op<dxdx_FE_const> >
00236 Diag_DxDx_FE()
00237 {
00238   typedef DiagonalDiff_Op<dxdx_FE_const> ExprT;
00239   return DExpr<ExprT>(ExprT());
00240 }
00241 
00242 // DyDy
00243 DExpr<DiagonalDiff_Op<dydy_FE_const> >
00244 Diag_DyDy_FE()
00245 {
00246   typedef DiagonalDiff_Op<dydy_FE_const> ExprT;
00247   return DExpr<ExprT>(ExprT());
00248 }
00249 
00250 // DzDz
00251 DExpr<DiagonalDiff_Op<dzdz_FE_const> >
00252 Diag_DzDz_FE()
00253 {
00254   typedef DiagonalDiff_Op<dzdz_FE_const> ExprT;
00255   return DExpr<ExprT>(ExprT());
00256 }
00257 
00258 // Helm
00259 DExpr<DiagonalDiff_Op<helm_FE_const> >
00260 Diag_Helm_FE()
00261 {
00262   typedef DiagonalDiff_Op<helm_FE_const> ExprT;
00263   return DExpr<ExprT>(ExprT());
00264 }
00265 
00266 
00268 // Nichsymmetrische Terme
00270 
00271 // DxDy
00272 DExpr<DiagonalDiff_Op<dxdy_FE_const> >
00273 Diag_DxDy_FE()
00274 {
00275   typedef DiagonalDiff_Op<dxdy_FE_const> ExprT;
00276   return DExpr<ExprT>(ExprT());
00277 }
00278 
00279 // DyDx
00280 DExpr<DiagonalDiff_Op<dydx_FE_const> >
00281 Diag_DyDx_FE()
00282 {
00283   typedef DiagonalDiff_Op<dydx_FE_const> ExprT;
00284   return DExpr<ExprT>(ExprT());
00285 }
00286 
00287 // DxDz
00288 DExpr<DiagonalDiff_Op<dxdz_FE_const> >
00289 Diag_DxDz_FE()
00290 {
00291   typedef DiagonalDiff_Op<dxdz_FE_const> ExprT;
00292   return DExpr<ExprT>(ExprT());
00293 }
00294 
00295 // DzDx
00296 DExpr<DiagonalDiff_Op<dzdx_FE_const> >
00297 Diag_DzDx_FE()
00298 {
00299   typedef DiagonalDiff_Op<dzdx_FE_const> ExprT;
00300   return DExpr<ExprT>(ExprT());
00301 }
00302 
00303 // DyDz
00304 DExpr<DiagonalDiff_Op<dydz_FE_const> >
00305 Diag_DyDz_FE()
00306 {
00307   typedef DiagonalDiff_Op<dydz_FE_const> ExprT;
00308   return DExpr<ExprT>(ExprT());
00309 }
00310 
00311 // DzDy
00312 DExpr<DiagonalDiff_Op<dzdy_FE_const> >
00313 Diag_DzDy_FE()
00314 {
00315   typedef DiagonalDiff_Op<dzdy_FE_const> ExprT;
00316   return DExpr<ExprT>(ExprT());
00317 }
00318 
00319 // DX
00320 DExpr<DiagonalDiff_Op<dxhelm_FE_const> >
00321 Diag_DX_FE()
00322 {
00323   typedef DiagonalDiff_Op<dxhelm_FE_const> ExprT;
00324   return DExpr<ExprT>(ExprT());
00325 }
00326 
00327 // DX transpose
00328 DExpr<DiagonalDiff_Op<helmdx_FE_const> >
00329 Diag_DX_FE_t()
00330 {
00331   typedef DiagonalDiff_Op<helmdx_FE_const> ExprT;
00332   return DExpr<ExprT>(ExprT());
00333 }
00334 
00335 // DY
00336 DExpr<DiagonalDiff_Op<dyhelm_FE_const> >
00337 Diag_DY_FE()
00338 {
00339   typedef DiagonalDiff_Op<dyhelm_FE_const> ExprT;
00340   return DExpr<ExprT>(ExprT());
00341 }
00342 
00343 // DY transpose
00344 DExpr<DiagonalDiff_Op<helmdy_FE_const> >
00345 Diag_DY_FE_t()
00346 {
00347   typedef DiagonalDiff_Op<helmdy_FE_const> ExprT;
00348   return DExpr<ExprT>(ExprT());
00349 }
00350 
00351 // DZ
00352 DExpr<DiagonalDiff_Op<dzhelm_FE_const> >
00353 Diag_DZ_FE()
00354 {
00355   typedef DiagonalDiff_Op<dzhelm_FE_const> ExprT;
00356   return DExpr<ExprT>(ExprT());
00357 }
00358 
00359 // DZ transpose
00360 DExpr<DiagonalDiff_Op<helmdz_FE_const> >
00361 Diag_DZ_FE_t()
00362 {
00363   typedef DiagonalDiff_Op<helmdz_FE_const> ExprT;
00364   return DExpr<ExprT>(ExprT());
00365 }
00366 
00367 
00369 // Rand-operatoren
00371 
00372 DExpr<DiagonalDiff_Op<L2boundary_const> >
00373 Diag_Int_boundary()
00374 {
00375   typedef DiagonalDiff_Op<L2boundary_const> ExprT;
00376   return DExpr<ExprT>(ExprT());
00377 }

Generated on Fri Nov 2 01:25:57 2007 for IPPL by doxygen 1.3.5