Commit 6495381b authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

preparing for single force near-field

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 5127
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent c40a97d1
......@@ -51,11 +51,13 @@
* - 20/10/2012 V1.10 properly implemented reflected wave transformation
* - 12/04/2013 V1.11 implement near-field transformation for constant
* velocity approach
* - 16/04/2013 V1.11a intermediate version until near-field single
* velocity transformation is implemented
*
* ============================================================================
*/
#define LISOUSI_VERSION \
"LISOUSI V1.11 line source simulation"
"LISOUSI V1.11a line source simulation"
#define LISOUSI_CVSID \
"$Id$"
......@@ -91,15 +93,29 @@ typedef ts::filter::Ttimeseries Ttimeseries;
typedef Ttimeseries::Tseries Tseries;
/*----------------------------------------------------------------------*/
// type of Fourier domain solution
enum Efdtype {
Ffdfarfield,
Ffdexplosion,
Ffdzforce,
Ffdlamb
};
struct Options {
bool verbose, debug, exact;
bool verbose, debug;
bool overwrite, taperfirst, sqrttaper, limitlength;
bool fredomain, fdfilter, tdfilter, nointeg, transition, tapsloset;
double velocity, tfac, tshift, tlim, integshift, tapdel;
double tfac, tshift, tlim, integshift, tapdel;
double tapslo, transition1, transition2;
int npad;
std::string inputformat, outputformat;
// single-velocity switches:
Efdtype fdtype;
// propagation parameters:
double velocity, vpvsratio, pquality, squality;
// trapezoid integration:
double tzedgefactor, tzedgetaper;
int tznsteps;
}; // struct Options
/*======================================================================*/
......@@ -201,8 +217,10 @@ int main(int iargc, char* argv[])
LISOUSI_VERSION "\n"
"usage: lisousi [-v] [-o] [-type type] [-Type type]" "\n"
" [-fdfilter] [-tdfilter] [-fredomain]\n"
" [-fdexplosion] [-fdzforce] [-fdlamb]" "\n"
" [-taperlast] [-sqrttaper] [-limitlength]" "\n"
" [-velocity v] [-exact]" "\n"
" [-velocity v] [-vpvsratio v] [-quality Qp,Qs]" "\n"
" [-ktrapezoid n,f,t]\n"
" [-tapdel t] [-tapslo s]" "\n"
" [-pad n] [-tshift f] [-tfac f] [-tlim f]" "\n"
" [-nointeg] [-integshift f]\n"
......@@ -485,7 +503,17 @@ int main(int iargc, char* argv[])
{"transition",arg_yes,"0.,1."},
// 23: exact single velocity transformation (instead of far-field
// approximation)
{"exact",arg_no,"-"},
{"fdexplosion",arg_no,"-"},
// 24: single force in full space
{"fdzforce",arg_no,"-"},
// 25: single vertical force on homogeneous halfspace (Lamb's problem)
{"fdlamb",arg_no,"-"},
// 26: vp/vs ratio
{"vpvsratio",arg_yes,"1.732"},
// 27: quality factor or P-wave and S-wave modulus
{"quality",arg_yes,"30.,30."},
// 28: trapezoid rule parameters for wavenumber integration
{"ktrapezoid",arg_yes,"1000,2.,0.1"},
{NULL}
};
......@@ -544,29 +572,46 @@ int main(int iargc, char* argv[])
// extract commandline options
Options opt;
// 1 is --xhelp
opt.debug=cmdline.optset(2);
opt.verbose=cmdline.optset(3);
opt.overwrite=cmdline.optset(4);
opt.inputformat=cmdline.string_arg(5);
opt.outputformat=cmdline.string_arg(6);
opt.taperfirst=!cmdline.optset(7);
opt.sqrttaper=cmdline.optset(8);
opt.limitlength=cmdline.optset(9);
opt.fredomain=cmdline.optset(10);
opt.velocity=cmdline.double_arg(11);
opt.tdfilter=cmdline.optset(12);
opt.fdfilter=cmdline.optset(13);
opt.npad=cmdline.int_arg(14);
opt.tshift=cmdline.double_arg(15);
opt.tlim=cmdline.double_arg(16);
opt.tfac=cmdline.double_arg(17);
opt.integshift=cmdline.double_arg(18);
opt.tapdel=cmdline.double_arg(19);
opt.nointeg=cmdline.optset(20);
opt.tapslo=cmdline.double_arg(21);
opt.tapsloset=cmdline.optset(21);
opt.transition=cmdline.optset(22);
opt.exact=cmdline.optset(23);
{
std::istringstream iss;
std::string args;
opt.debug=cmdline.optset(2);
opt.verbose=cmdline.optset(3);
opt.overwrite=cmdline.optset(4);
opt.inputformat=cmdline.string_arg(5);
opt.outputformat=cmdline.string_arg(6);
opt.taperfirst=!cmdline.optset(7);
opt.sqrttaper=cmdline.optset(8);
opt.limitlength=cmdline.optset(9);
opt.fredomain=cmdline.optset(10);
opt.velocity=cmdline.double_arg(11);
opt.tdfilter=cmdline.optset(12);
opt.fdfilter=cmdline.optset(13);
opt.npad=cmdline.int_arg(14);
opt.tshift=cmdline.double_arg(15);
opt.tlim=cmdline.double_arg(16);
opt.tfac=cmdline.double_arg(17);
opt.integshift=cmdline.double_arg(18);
opt.tapdel=cmdline.double_arg(19);
opt.nointeg=cmdline.optset(20);
opt.tapslo=cmdline.double_arg(21);
opt.tapsloset=cmdline.optset(21);
opt.transition=cmdline.optset(22);
opt.fdtype=Ffdfarfield;
if (cmdline.optset(23)) { opt.fdtype=Ffdexplosion; };
if (cmdline.optset(24)) { opt.fdtype=Ffdzforce; };
if (cmdline.optset(25)) { opt.fdtype=Ffdlamb; };
opt.vpvsratio=cmdline.double_arg(26);
args=cmdline.string_arg(27);
args.replace(args.find(","),1," ");
iss.str(args);
iss >> opt.pquality >> opt.squality;
args=cmdline.string_arg(28);
args.replace(args.find(","),1," ");
iss.str(args);
iss >> opt.tznsteps >> opt.tzedgefactor >> opt.tzedgetaper;
}
if (opt.transition)
{
std::istringstream transopt(tfxx::string::patsubst(cmdline.string_arg(22),
......@@ -807,7 +852,7 @@ int main(int iargc, char* argv[])
}
TFourier::Tspectrum coeff=Fourier(series, dt);
// scale with frequency independent and offset dependent factor
if (opt.exact)
if (opt.fdtype==Ffdexplosion)
{
coeff*=(-TFourier::Tcoeff(0.,1.)*offset*M_PI);
}
......@@ -823,7 +868,7 @@ int main(int iargc, char* argv[])
int ifre=i-coeff.f();
if (ifre==0) { ifre = 1; }
double f=ifre/T;
if (opt.exact)
if (opt.fdtype==Ffdexplosion)
{
// std::cout << "exact!" << std::endl;
double argument=f*argfact;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment