00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef DEXAM_H_
00024 #define DEXAM_H_
00025
00027
00029
00030 PointtypeD All_interior(D3vector V);
00031
00032
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
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
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
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
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
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
00150
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
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
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
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