LISOUSI: Line Source Simulation

◆ singlevelocitytransformation()

TFourier::Tseries singlevelocitytransformation ( const TFourier::Tseries series,
const Parameters par,
const Exco ec,
const Options opt 
)

Definition at line 41 of file singlevelocity.cc.

References CFTfac, Options::debug, Parameters::dt, Fbessel0, Fbessel1, Fcos, Options::fdtype, Ffdexplosion, Ffdfarfield, Ffdlamb, Ffdwizforce, Ffdzforce, Fourier, Fsin, hankel(), IME, Parameters::offset, Options::radial, Parameters::T, Options::velocity, Options::verbose, Options::vpvsratio, wnintegration(), zflinefc(), and zfpointfc().

Referenced by main().

45 {
46  TFXX_debug(opt.debug, "singlevelocitytransformation",
47  "frequency domain single velocity transformation");
48  if (opt.verbose)
49  {
50  cout << " apply 2D/3D Greens function ratio for single "
51  << "wave velocity: " << opt.velocity << " km/s" << endl;
52  }
53 
54  TFXX_debug(opt.debug, "singlevelocity", " series size: " << series.size());
55  TFourier::Tspectrum coeff=Fourier(series, par.dt);
56  TFXX_debug(opt.debug, "singlevelocity", " coefficients size: "
57  << coeff.size());
58  // scale with frequency independent and offset dependent factor
59  if (opt.fdtype==Ffdfarfield)
60  {
61  coeff*=(CFTfac*sqrt(par.offset));
62  }
63 
64  // prepare Fourier coefficients of single force line and point source
65  // Green's function in full space, if required
66  TFourier::Tspectrum zfpoint, zfline;
67  if (opt.fdtype==Ffdzforce)
68  {
69  zfpoint=zfpointfc(series.size(), par.dt, par.offset,
70  1.e3*opt.velocity, 1.e3*opt.velocity*opt.vpvsratio,
71  opt.debug);
72  zfline=zflinefc(series.size(), par.dt, par.offset,
73  1.e3*opt.velocity, 1.e3*opt.velocity*opt.vpvsratio,
74  opt.debug);
75  TFXX_assert(zfpoint.f()==coeff.f(), "shape mismatch (programming error)");
76  TFXX_assert(zfline.f()==coeff.f(), "shape mismatch (programming error)");
77  TFXX_assert(zfpoint.l()==coeff.l(), "shape mismatch (programming error)");
78  TFXX_assert(zfline.l()==coeff.l(), "shape mismatch (programming error)");
79  }
80 
81  // factor in argument of Hankel function and complex exponential
82  // in case of exact solution
83  double argfact=2.e-3*M_PI*par.offset/opt.velocity;
84 
85  for (unsigned int i=coeff.f(); i<=coeff.l(); ++i)
86  {
87  int ifre=i-coeff.f();
88  if (ifre==0) { ifre = 1; }
89  double f=ifre/par.T;
90  if (opt.fdtype==Ffdexplosion)
91  {
92  // std::cout << "exact!" << std::endl;
93  double argument=f*argfact;
94  TFourier::Tcoeff numerator= -IME*M_PI*hankel(argument)*par.offset;
95  TFourier::Tcoeff denominator=exp(-IME*argument);
96  coeff(i) *= (numerator/denominator);
97  }
98  else if (opt.fdtype==Ffdzforce)
99  {
100  coeff(i) *= (zfline(i)/zfpoint(i));
101  }
102  else if ((opt.fdtype==Ffdwizforce) || (opt.fdtype==Ffdlamb))
103  {
104  /*
105  * the angular frequency appears as a factor in the denominator;
106  * this essentiall is an integration and produces a singularity at
107  * f=0Hz; alternatively to using this factor here, we could discard it
108  * and do the integration in the time domain...
109  */
110  TFourier::Tcoeff numerator;
111  TFourier::Tcoeff denominator;
112  if ((opt.fdtype==Ffdlamb) && (opt.radial))
113  {
114  numerator = 2.*wnintegration(ec, f, par.offset, Fsin);
115  denominator = 2.*M_PI*f*wnintegration(ec, f, par.offset, Fbessel1);
116  }
117  else
118  {
119  numerator = 2.*wnintegration(ec, f, par.offset, Fcos);
120  denominator = 2.*M_PI*f*wnintegration(ec, f, par.offset, Fbessel0);
121  }
122  coeff(i) *= (numerator/denominator);
123  }
124  else
125  {
126  coeff(i)*=sqrt(1.e3*opt.velocity/f);
127  }
128  }
129  return(Fourier(coeff, par.dt));
130 }
Bessel function of order 1.
cosine function
const TFourier::Tcoeff CFTfac
Definition: lisousi.h:87
double velocity
Definition: lisousi.h:128
const TFourier::Tcoeff IME
Definition: lisousi.h:85
double vpvsratio
Definition: lisousi.h:128
double T
duration of total recording.
Definition: lisousi.h:160
Bessel function of order 0.
TFourier::Tspectrum zfpointfc(const int &n, const double &dt, const double &offset, const double &vs, const double &vp, const bool &debug)
bool debug
Definition: lisousi.h:117
sine function
TFourier::Tspectrum zflinefc(const int &n, const double &dt, const double &offset, const double &vs, const double &vp, const bool &debug)
TFourier Fourier
Definition: globaldata.cc:44
bool verbose
Definition: lisousi.h:117
TFourier::Tcoeff wnintegration(const Exco &ec, const double &f, const double &offset, const Ebasis &fb)
TFourier::Tcoeff hankel(const double &arg)
Definition: hankel.cc:41
bool radial
Definition: lisousi.h:118
double dt
sampling interval
Definition: lisousi.h:162
Efdtype fdtype
Definition: lisousi.h:126
double offset
either epicentral distance or hypocentral distance.
Definition: lisousi.h:150
Here is the call graph for this function:
Here is the caller graph for this function: