RSTT 3.2.1 Regional Seismic Travel Time

Loading...
Searching...
No Matches
GreatCircle_Xn.h
Go to the documentation of this file.
1//- ****************************************************************************
2//-
3//- Copyright 2009 National Technology & Engineering Solutions of Sandia, LLC
4//- (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
5//- Government retains certain rights in this software.
6//-
7//- BSD Open Source License
8//- All rights reserved.
9//-
10//- Redistribution and use in source and binary forms, with or without
11//- modification, are permitted provided that the following conditions are met:
12//-
13//- 1. Redistributions of source code must retain the above copyright notice,
14//- this list of conditions and the following disclaimer.
15//-
16//- 2. Redistributions in binary form must reproduce the above copyright
17//- notice, this list of conditions and the following disclaimer in the
18//- documentation and/or other materials provided with the distribution.
19//-
20//- 3. Neither the name of the copyright holder nor the names of its
21//- contributors may be used to endorse or promote products derived from
22//- this software without specific prior written permission.
23//-
24//- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25//- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26//- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27//- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28//- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29//- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30//- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31//- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32//- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33//- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34//- POSSIBILITY OF SUCH DAMAGE.
35//-
36//- ****************************************************************************
37
38#ifndef GreatCircle_Xn_H
39#define GreatCircle_Xn_H
40
41// **** _SYSTEM INCLUDES_ ******************************************************
42
43#include <vector>
44#include <string>
45#include <iostream>
46
47 using namespace std;
48
49// **** _LOCAL INCLUDES_ *******************************************************
50
51#include "SLBMGlobals.h"
52#include "GreatCircle.h"
53#include "Grid.h"
54#include "Location.h"
55#include "CrustalProfile.h"
56#include "LayerProfile.h"
57
58// **** _BEGIN SLBM NAMESPACE_ **************************************************
59
60 namespace slbm {
61
62// **** _CLASS DEFINITION_ *****************************************************
63//
79 class SLBM_EXP_IMP GreatCircle_Xn : public GreatCircle
80{
81
82 public:
83
100 GreatCircle_Xn(
101 const int& _phase,
102 Grid& _grid,
103 const double& latSource,
104 const double& lonSource,
105 const double& depthSource,
106 const double& latReceiver,
107 const double& lonReceiver,
108 const double& depthReceiver,
109 const double& chMax);
110
116 ~GreatCircle_Xn();
117
121 // GreatCircle_Xn(const GreatCircle_Xn &other);
122 // GreatCircle *clone() { return new GreatCircle_Xn(*this); }
123
127 GreatCircle_Xn& operator=(const GreatCircle_Xn& other);
128
129 void getZhaoParameters(double& Vm, double& Gm, double& H, double& C, double& Cm, int& udSign);
130
149 string toString(const int& verbosity);
150
151 private:
152
156 double ch_max;
157
163 double Vm;
164
170 double Gm;
171
177 double H;
178
182 double rMoho;
183 double rZm;
184
190 int udSign;
191
192 double V0;
193
199 void computeTravelTime();
200
201 bool inCrust;
202
203 void computeTravelTimeCrust();
204
205 void computeTravelTimeMantle();
206
207 double c, cm, zm, zhao_r, cz, cmz;
208
209 const double cmin;
210
211 double func(const double& h);
212
213 void mnbrak(double &ax, double &bx, double &cx,
214 double &fa, double &fb, double &fc);
215
216 double brent(const double ax, const double bx, const double cx,
217 const double tol, double &xmin);
218
219 void SWAP(double &a, double &b) {double dum=a; a=b; b=dum;}
220
221 double SIGN(const double &a, const double &b)
222 {return b >= 0 ? (a >= 0 ? a : -a) : (a >= 0 ? -a : a);};
223
224 void shft3(double &a, double &b, double &cc, const double d)
225 { a=b; b=cc; cc=d;};
226
227};
228
229 inline void GreatCircle_Xn::getZhaoParameters(double& Vm_, double& Gm_, double& H_, double& C_, double& Cm_, int& udSign_)
230{
231 Vm_ = Vm;
232 Gm_ = Gm;
233 H_ = H;
234 C_ = c;
235 Cm_ = cm;
236 udSign_ = udSign;
237}
238
239} // end slbm namespace
240
241#endif // GreatCircle_Xn.h
CrustalProfile.h
GreatCircle.h
Grid.h
LayerProfile.h
Location.h
SLBMGlobals.h
SLBM_EXP_IMP
#define SLBM_EXP_IMP
Definition SLBMGlobals.h:180
slbm::GreatCircle_Xn::getZhaoParameters
void getZhaoParameters(double &Vm, double &Gm, double &H, double &C, double &Cm, int &udSign)
Definition GreatCircle_Xn.h:229
slbm::GreatCircle_Xn::toString
string toString(const int &verbosity)
Retrieve a formatted string providing a detailed description of the information managed by this Great...
slbm::GreatCircle_Xn::GreatCircle_Xn
GreatCircle_Xn(const int &_phase, Grid &_grid, const double &latSource, const double &lonSource, const double &depthSource, const double &latReceiver, const double &lonReceiver, const double &depthReceiver, const double &chMax)
Parameterized constructor.
slbm::GreatCircle_Xn::operator=
GreatCircle_Xn & operator=(const GreatCircle_Xn &other)
Copy constructor.
slbm::GreatCircle_Xn::~GreatCircle_Xn
~GreatCircle_Xn()
Destructor. Deletes the source and receiver CrustalProfile objects and all LayerProfile objects creat...
slbm::GreatCircle::depthReceiver
double depthReceiver
Definition GreatCircle.h:778
slbm::GreatCircle::latSource
double latSource
Definition GreatCircle.h:773
slbm::GreatCircle::lonReceiver
double lonReceiver
Definition GreatCircle.h:777
slbm::GreatCircle::lonSource
double lonSource
Definition GreatCircle.h:774
slbm::GreatCircle::depthSource
double depthSource
Definition GreatCircle.h:775
slbm::GreatCircle::latReceiver
double latReceiver
Definition GreatCircle.h:776
slbm::GreatCircle::GreatCircle
GreatCircle(const int &_phase, Grid &_grid, const double &latSource, const double &lonSource, const double &depthSource, const double &latReceiver, const double &lonReceiver, const double &depthReceiver)
Parameterized constructor.
slbm::Grid
A 2 dimensional, horizontal grid of GirdProfile objects.
Definition Grid.h:91
slbm
Definition CrustalProfile.h:59