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

src/expde/domain/d_exam.h

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 //
00019 // d_exam.h
00020 //
00021 // ------------------------------------------------------------
00022 
00023 #ifndef DEXAM_H_
00024 #define DEXAM_H_
00025         
00027 // derived class: ball, square
00029 
00030 PointtypeD All_interior(D3vector V);
00031 
00032 //  SQUARE:      [0,1]^3
00033 // ----------------------------------------------
00034 
00035 PointtypeD All_interior(D3vector V);
00036 double dis_Square(D3vector V, dir_3D d);
00037 
00038 class Square : public Convex_domains {
00039  public:
00040   Square(); 
00041 };
00042 
00043 
00044 inline Square::Square() : Convex_domains(All_interior,dis_Square,1) {
00045   A = D3vector(0.0,0.0,0.0);
00046   H = 1.0;
00047   VecH = D3vector(1.0,1.0,1.0);
00048 }
00049 
00050 
00051 //  BALL:         Radius: 0.5,  center: (0.5,0.5,0.5)
00052 // ---------------------------------------------------
00053 
00054 double dis_Ball(D3vector V, dir_3D d);
00055 PointtypeD Poi_Ball(D3vector V);
00056 
00057 class Ball : public Convex_domains {
00058  public:
00059   Ball();
00060 };
00061 
00062 inline Ball::Ball() : Convex_domains(Poi_Ball,dis_Ball,1) {
00063 }
00064 
00065 //  Cylinder:         Radius: 0.5,  center: (0.5,0.5,0.5)
00066 // ---------------------------------------------------
00067 
00068 double dis_Cylinder(D3vector V, dir_3D d);
00069 PointtypeD Poi_Cylinder(D3vector V);
00070 
00071 class Cylinder : public Convex_domains {
00072  public:
00073   Cylinder();
00074 };
00075 
00076 inline Cylinder::Cylinder() : Convex_domains(Poi_Cylinder,dis_Cylinder,1) {
00077   A = D3vector(0.0,0.0,0.0);
00078   H = 1.0;
00079   VecH = D3vector(1.0,1.0,1.0);
00080 }
00081 
00082 
00083 
00084 //  skew cylinder:         radius: r_down...r_top,  center: (0.0,0.0,0.5)
00085 // ----------------------------------------------------------
00086 
00087 double dis_Skew_cylinder(D3vector V, dir_3D d, double R_down, double R_top);
00088 PointtypeD Poi_Skew_cylinder(D3vector V, double R_down, double R_top);
00089 
00090 class Skew_cylinder : public Convex_domains_2P {
00091  public:
00092   Skew_cylinder(double r_down, double r_top);
00093 };
00094 
00095 inline Skew_cylinder::Skew_cylinder(double r_down, double r_top) :
00096   Convex_domains_2P(Poi_Skew_cylinder,dis_Skew_cylinder,1) {
00097   R_down = r_down;
00098   R_top  = r_top;
00099   if(R_down<=0.0 || R_top<=0.0) 
00100     cout << "\n Mistake in constructor Skew_cylinder!" << endl;
00101   A = D3vector(-MAX(R_down,R_top),-MAX(R_down,R_top),0.0);
00102   H = MAX(1.0,2.0*MAX(R_down,R_top));
00103   VecH = D3vector(1.0,1.0,H);
00104 }
00105 
00106 //  double cylinder:    radius: r_interior...r_outside, center: (0.0,0.0,0.5)
00107 // ----------------------------------------------------------
00108 
00109 double dis_Double_cylinder(D3vector V, dir_3D d, double R_in, double R_out);
00110 PointtypeD Poi_Double_cylinder(D3vector V, double R_in, double R_out);
00111 
00112 class Double_cylinder : public Convex_domains_2P {
00113  public:
00114   Double_cylinder(double r_in, double r_out);
00115 };
00116 
00117 inline Double_cylinder::Double_cylinder(double r_in, double r_out) :
00118   Convex_domains_2P(Poi_Double_cylinder,dis_Double_cylinder,1) {
00119   R_down = r_in;
00120   R_top  = r_out;
00121   if(r_in<=0.0 || r_out<=0.0 || r_in > r_out) 
00122     cout << "\n Mistake in constructor Double_cylinder!" << endl;
00123   A = D3vector(-r_out,-r_out,0.0);
00124   H = MAX(1.0,2.0*r_out);
00125   VecH = D3vector(H,H,1.0);
00126 }
00127 
00128 //  SCREW SQUARE:  angles:               alpha_up, alpha_down
00129 // ----------------------------------------------------------
00130 
00131 double dis_Skew_square(D3vector V, dir_3D d, double R_down, double R_top);
00132 PointtypeD Poi_Skew_square(D3vector V, double R_down, double R_top);
00133 
00134 class Skew_square : public Convex_domains_2P {
00135  public:
00136   Skew_square(double r_down, double r_top);
00137 };
00138 
00139 inline Skew_square::Skew_square(double alpha_down, double alpha_top) :
00140   Convex_domains_2P(Poi_Skew_square,dis_Skew_square,1) {
00141   R_down = alpha_down;
00142   R_top  = alpha_top;
00143 
00144   A = D3vector(0.0,0.0,MIN(0.0,my_tan(R_down)));
00145   H = MAX(1.0,MAX(1.0-my_tan(R_down),1.0+my_tan(R_top),1.0+my_tan(R_top)-my_tan(R_down)));
00146   VecH = D3vector(1.0,1.0,H);
00147 }
00148 
00149 //  SCREW SQUARE DTLR:  angles:            alpha_up,   alpha_down
00150 //                                         alpha_left, alpha_right
00151 // ----------------------------------------------------------------
00152 
00153 double dis_Skew_squareDTLR(D3vector V, dir_3D d, 
00154                            double R_down, double R_top, 
00155                            double R_left, double R_right);
00156 PointtypeD Poi_Skew_squareDTLR(D3vector V, 
00157                                double R_down, double R_top,
00158                                double R_left, double R_right);
00159 
00160 class Skew_squareDTLR : public Convex_domains_4P {
00161  public:
00162   Skew_squareDTLR(double r_down, double r_top, double r_left, double r_right);
00163 };
00164 
00165 /* old
00166 inline Skew_squareDTLR::Skew_squareDTLR(double alpha_down,double alpha_top,
00167                                         double alpha_left,double alpha_right) :
00168   Convex_domains_4P(Poi_Skew_squareDTLR,dis_Skew_squareDTLR,1) {
00169   double H_DT, H_LR;
00170   R_down  = alpha_down;
00171   R_top   = alpha_top;
00172   R_left  = alpha_left;
00173   R_right = alpha_right;
00174 
00175   A = D3vector(0.0,MIN(0.0,my_tan(R_left)),MIN(0.0,my_tan(R_down)));
00176   H_DT = MAX(1.0-my_tan(R_down),1.0+my_tan(R_top),1.0+my_tan(R_top)-my_tan(R_down));
00177   H_LR = MAX(1.0-my_tan(R_left),1.0+my_tan(R_right),1.0+my_tan(R_right)-my_tan(R_left));
00178   H = MAX(1.0,MAX(H_DT,H_LR));
00179   VecH = D3vector(1.0,H_LR,H_DT);
00180 }
00181 */
00182 
00183 
00184 inline Skew_squareDTLR::Skew_squareDTLR(double alpha_down,double alpha_top,
00185                                         double alpha_left,double alpha_right) :
00186   Convex_domains_4P(Poi_Skew_squareDTLR,dis_Skew_squareDTLR,1) {
00187   double H_DT, H_LR;
00188   R_down  = alpha_down;
00189   R_top   = alpha_top;
00190   R_left  = alpha_left;
00191   R_right = alpha_right;
00192 
00193   A = D3vector(MIN(0.0,my_tan(R_down)),MIN(0.0,my_tan(R_left)),0.0);
00194   H_DT = MAX(1.0-my_tan(R_down),1.0+my_tan(R_top),1.0+my_tan(R_top)-my_tan(R_down));
00195   H_LR = MAX(1.0-my_tan(R_left),1.0+my_tan(R_right),1.0+my_tan(R_right)-my_tan(R_left));
00196   H = MAX(1.0,MAX(H_DT,H_LR));
00197   VecH = D3vector(H_DT,H_LR,1.0);
00198 }
00199 
00200 
00201 
00202 
00203 //  periodic Cylinder:         Radius: 0.5,  center: (0.5,0.5,0.5)
00204 // ---------------------------------------------------
00205 
00206 double dis_periodic_Cylinder(D3vector V, dir_3D d);
00207 PointtypeD Poi_periodic_Cylinder(D3vector V);
00208 
00209 class Periodic_cylinder : public Convex_domains {
00210  public:
00211   Periodic_cylinder();
00212 };
00213 
00214 inline Periodic_cylinder::Periodic_cylinder() : Convex_domains(Poi_periodic_Cylinder,
00215                                                                dis_periodic_Cylinder,1) {
00216   A = D3vector(0.0,0.0,0.0);
00217   H = 1.0;
00218   VecH = D3vector(1.0,1.0,1.0);
00219   is_periodic = true;
00220 #ifndef PERIODIC
00221       cout << " Do not use Periodic_cylinder with non periodic data structure!" << endl; 
00222 #endif
00223 }
00224 
00225 
00226 
00227 
00228 #endif
00229            

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