UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
rt_migr.hpp
1 // rt_migr.hpp
2 // $Id: rt_migr.hpp,v 1.12 2008/07/30 14:29:22 guser1 Exp $
3 //---------------------------------------------------------------------
4 #ifndef __rt_migrhpp
5 #define __rt_migrhpp
6 
7 #include <math.h>
8 #include <vector>
9 
10 #include "ray_tracing.hpp"
11 //#include <mix/misc.h> // for timer
12 //#include <ldb/dbtools.h>
13 
14 #include "seis.hpp"
15 //#define RAY_SHOOT_DEBUG
16 
17 using namespace std;
18 typedef vector<int> iVect;
19 typedef vector<double> dVect;
20 
21 
22 enum BOUND {TOP, BOT, RIGHT, LEFT, BAD};
23 
24 
26 enum ACTIVE_ZONE {AZ_OK, AZ_NO, AZ_SPECIAL};
27 
28 
31 enum MIGR_TYPE {PPUP, PPDOWN, PSUP, PSDOWN, SPUP, SPDOWN, SSUP, SSDOWN};
32 
33 
34 //---------------------------------------------------------------------
36 
37 struct MigrInnerCell
38 {
40  double f;
41 
43  double t;
44 
46  MigrInnerCell *next;
47 };
48 
49 
51 
52 struct MigrCell
53 {
55  double f;
56 
58  double t;
59 
61  unsigned short int next;
62 };
63 
64 
66 
67 struct IPCell
68 {
70  int i;
71 
73  int j;
74 
76  double f;
77 
79  double t;
80 };
81 
82 
85 
86 //==============================================================================
88 class RTMigr : private RayTracing
89 {
90 public:
91 
92  //#ifndef GE_BUILD_RAYTR
93  //RTMigr(Vel2dModelLDB *VelMod2d, AbstractSeis *seis, double stepX, double stepZ, double dfEps, double migrAngle, MIGR_TYPE mt);
94  //#else
95  //RTMigr(Vel2dModelGEVSP *VelMod2d, AbstractSeis *seis, double stepX, double stepZ, double dfEps, double migrAngle, MIGR_TYPE mt);
96  //#endif
97  RTMigr(Vel2dModel *VelMod2d, AbstractSeis *seis, double stepX, double stepZ, double dfEps, double migrAngle, MIGR_TYPE mt);
98 
99  ~RTMigr();
100 
102  bool GetMigrGridSP(int sp_num, MigrCell *&grid, int &size);
103 
105  bool GetMigrGridRec(int recNum, MigrCell *&grid, int &size);
106 
107 
109  bool GetMigrGrid(double x, double z, WAVE_TYPE wType, MigrCell *&grid, int &size);
110 
113  bool GetMigrGrid(double x, double z, WAVE_TYPE wType, MigrInnerGrid &grid);
114 
115 
116 
117 
120  void CompMigrGrid(MigrCell *grid1, int size1, MigrCell *grid2, int size2, IPCell *&ip_info, int &ip_cell_num,
121  int i_beg = -1, int i_end = -1);
122 
126  void AddIPInfo(MigrInnerGrid ip_grid, IPCell* ip_info, int ip_cell_num);
127 
129  void RecalculateIPGrid(MigrInnerGrid ip_grid);
130 
136  double GetIPValue(int spN, int i, int j, MigrInnerCell cell);
137 
139  int GetIMax();
140 
142  int GetJMax();
143 
145  AbstractSeis* GetSeis();
146 
148  MigrGridArea GetMGArea();
149 
150  //RayInfo* RayShoot(double f, double startX, double startZ, WAVE_TYPE wp, MigrInnerGrid grid);
151 
152 
154  Vel2dModel* GetMod2d() const { return Mod2d; };
155 
156 
158  bool GetReady();
159 
160 private:
161 
163  RayInfo* RayShoot(double f, double startX, double startZ, WAVE_TYPE wp, MigrInnerGrid grid);
164 
166  void AddRayPoint(double rx0, double rz0, double rx1, double rz1, WAVE_TYPE wType,
167  double f, double t, double dt, MigrInnerGrid grid);
168 
170  void GetCellIJ(double x, double z, int &i, int&j);
171 
173  void GetCellXZ(int i, int j, double &x, double &z, BOUND bound=BAD);
174 
176  void MarkCell(MigrInnerGrid grid, int i, int j, double f, double t);
177 
179  BOUND GetNextCell(int i1, int j1, int &i_next, int &j_next);
180 
182  BOUND GetNextPoint(double x, double z, double &x_next, double &z_next);
183 
186  bool GetShadowZoneBorder(WAVE_TYPE wType, double spX, double spZ, double init_f, double &last_f, double &f_shad_tmp, double f);
187 
189  void GetShadowZoneEnd(WAVE_TYPE wType, double spX, double spZ, double init_f_shad, double f_step,
190  double &x1, double &z1, int &i1, int &j1, double &f, MigrInnerGrid inner_grid);
191 
193  bool CheckBoundPoint(double x, double z);
194 
196  void MovePointFromBound(double &x, double &z);
197 
199  bool FormMigrGrid(MigrInnerGrid inner_grid, MigrCell *&grid, int &size);
200 
202  bool MigrCellComp(MigrCell cell1, MigrCell cell2, int i, int j);
203 
204  //---------------------------------------------------------------------
205 
207  ACTIVE_ZONE GetActiveZoneStart(WAVE_TYPE wType, double spX, double spZ, double &init_f, double &init_x, double &init_z,
208  double f, int &rec_count, bool print=TRUE);
209 
211  ACTIVE_ZONE AZDetermination(WAVE_TYPE wType, double spX, double spZ, double &init_f,
212  double &init_x, double &init_z, double f, int &rec_count,
213  ACTIVE_ZONE AZ, double well_f, double no_well_f, bool print);
214 
216  int GetWellDir(double spX, double spZ, double z1, double z2);
217 
219  bool GetNearestRecNum(double spX, double spZ, double last_x, double last_z, int &first_rec, int rec_count, bool print=TRUE);
220 
222  int GetLastRecNum(WAVE_TYPE wType, double spX, double spZ, double f, int first_rec, int rec_count,
223  double &end_f, double &end_x, double &end_z);
224 
226  bool OneRecShoot(WAVE_TYPE wType , double spX, double spZ, int rec_num, double x0, double z0, double x1, double z1,
227  double base_angle, double sec_base_angle, double &result_x, double &result_z, double &result_angle,
228  double &result_w_angle, double &time, double eps);
229 
231  double GetAmpl(int spN, iVect &recNum, dVect &recT, dVect &recF);
232 
234  bool AboveWell(double spZ);
235 
237  bool RayError(RayInfo *ray, const char* message, double f, double sp_x, double sp_z);
238 
239  //---------------------------------------------------------------------
240  // TEMPORARY
241 
242  void Log(const char* str);
243 
244  //---------------------------------------------------------------------
245  // INPUT DATA STORAGE
246 
247  double stepX;
248  double stepZ;
249  double dfEps;
250  double migrAngle;
251  int i_max;
252  int j_max;
253  AbstractSeis *ASeis;
254  MIGR_TYPE mType;
256  //---------------------------------------------------------------------
257  // AUXILIARY VALUES
258 
259  bool ready;
260  double DIAGONAL;
261  double T_EPS;
264  double F_EPS;
267  double MIN_RAY_STEP;
268  double ROUGH_F_STEP;
269  double MIN_F_STEP;
270  int MAX_CHILD_NUM;
271  double AZ_F_STEP;
272  double MOD_LIM_EPS;
273  double MOD_BOUND_STEP_X;
275  double MOD_BOUND_STEP_Z;
277  double MOD_BOUND_EPS_X;
279  double MOD_BOUND_EPS_Z;
281  int MAX_ITER_NUM;
283  double MOVE_POINT_STEP;
284  double CHECK_BOUND_EPS;
286 };
287 
288 
289 #endif
290 
291 
292 
unsigned short int next
Definition: rt_migr.hpp:61
Definition: vel2dmod.hpp:19
Vel2dModel * GetMod2d() const
Definition: rt_migr.hpp:154
Ray tracing class.
Definition: ray_tracing.hpp:24
Definition: rt_migr.hpp:88
Definition: seis.hpp:38
Ray data storage sturcture.
Definition: rt_storage.hpp:74
double f
Definition: rt_migr.hpp:55
int i
Definition: rt_migr.hpp:70
migration-cell structure
Definition: u3d_migr_defines.hpp:47
Definition: seis.hpp:18
Definition: rays.H:81
incident-point-cell structure
Definition: u3d_migr_defines.hpp:63
double f
Definition: rt_migr.hpp:76
int j
Definition: rt_migr.hpp:73
double f
Definition: rt_migr.hpp:40
migration-cell structure
Definition: u3d_migr_defines.hpp:31