Main Lemma Repository
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

KernelEM1DSpec.h 52KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470
  1. /* This file is part of Lemma, a geophysical modelling and inversion API */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /**
  6. @file
  7. @author Trevor Irons
  8. @date 05/16/2012
  9. **/
  10. #ifndef KERNELEM1DSPEC_INC
  11. #define KERNELEM1DSPEC_INC
  12. #include "KernelEM1DBase.h"
  13. #include "KernelEM1DReflSpec.h"
  14. #include "KernelEM1DReflBase.h"
  15. #include "LayeredEarthEM.h"
  16. #include "DipoleSource.h"
  17. namespace Lemma {
  18. //class KernelEM1DReflBase;
  19. // ===================================================================
  20. // Class: KernelEM1DSpec
  21. /**
  22. @class
  23. \brief Optimized version of KernelEm1D
  24. \details Through use of template specialisations, this KernelEm1D
  25. class delivers much better performance.
  26. \note This class is internal and cannot be serialized.
  27. */
  28. // ===================================================================
  29. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  30. class KernelEM1DSpec : public KernelEM1DBase {
  31. struct ctor_key {};
  32. public:
  33. // ==================== LIFECYCLE =======================
  34. /// Default locked constructor.
  35. explicit KernelEM1DSpec (const ctor_key& ) : KernelEM1DBase( ), ReflCalc(nullptr) {
  36. }
  37. /// Default destructor.
  38. ~KernelEM1DSpec () {
  39. }
  40. /** Returns a pointer to a new object of type KernelEM1DSpec.
  41. * It allocates all necessary memory.
  42. */
  43. static std::shared_ptr<KernelEM1DSpec> NewSP() {
  44. return std::make_shared< KernelEM1DSpec > ( ctor_key() );
  45. }
  46. static std::shared_ptr<KernelEM1DSpec> NewSP(LayeredEarthEM* Earth, std::shared_ptr<DipoleSource> Dipole,
  47. const int& ifreq, const Real& rz) {
  48. auto Obj = std::make_shared< KernelEM1DSpec > ( ctor_key() );
  49. // under this scenario KernelEM1DSpec manages its own Refl Base
  50. Obj->ReflCalc = KernelEM1DReflSpec<Mode, Isource, Irecv>::NewSP();
  51. Obj->ReflCalc->Initialise(Earth);
  52. Obj->ReflCalc->SetUpSource(Dipole, ifreq);
  53. Obj->ReflCalc->SetUpReceiver( rz );
  54. return Obj;
  55. }
  56. // ==================== OPERATORS =======================
  57. // ==================== OPERATIONS =======================
  58. /** Returns the Complex bessel argument to be evaluated for a given
  59. * lambda value. This is specialised for each kernel type.
  60. */
  61. Complex BesselArg(const Real& lambda);
  62. /** Returns the Complex bessel argument to be evaluated for a given
  63. * lambda value. This is used in the calculation of related kernels.
  64. * This function does not call
  65. * KernelEM1DReflBase->ComputeReflectionCoeffs() Which saves
  66. * significant cost. This is specialised for each kernel type.
  67. */
  68. Complex RelBesselArg(const Real& lambda);
  69. // ==================== ACCESS =======================
  70. void SetIk(const int& ikin) {
  71. std::cerr << "deprecated (SetIk in KernelEm1dSpec.h)\n";
  72. exit(EXIT_FAILURE);
  73. }
  74. void SetMode(const EMMODE& modein) {
  75. //ReflCalc->mode = modein;
  76. std::cerr << "deprecated (SetMode in KernelEM1DSpec.h)\n";
  77. exit(EXIT_FAILURE);
  78. }
  79. void SetReflBase( std::shared_ptr<KernelEM1DReflBase> Base ) {
  80. ReflCalc = Base;
  81. }
  82. // ==================== INQUIRY =======================
  83. int GetNumRel() {
  84. std::cerr << "deprecated GetNumRel() (in KernelEM1DSpec.h) ";
  85. return -1;
  86. }
  87. int GetBesselOrder();
  88. Complex GetZm() {
  89. return ReflCalc->GetZm();
  90. }
  91. Complex GetYm() {
  92. return ReflCalc->GetYm();
  93. }
  94. Complex GetZs() {
  95. return ReflCalc->GetZs();
  96. }
  97. Complex GetKs() {
  98. return ReflCalc->GetKs();
  99. }
  100. /** Returns the name of the underlying class, similiar to Python's type */
  101. virtual std::string GetName() const;
  102. protected:
  103. // ==================== OPERATIONS =======================
  104. /// Calculates the potential when the receiver is above the source
  105. /// layer
  106. Complex PotentialAboveSourceLayer(const Real &ra);
  107. /// Calculates the potential when the receiver is below the source
  108. /// layer
  109. Complex PotentialBelowSourceLayer(const Real &ra);
  110. /// Calculates the potential when the receiver is below the source
  111. /// layer
  112. Complex RelPotentialBelowSourceLayer(const Real &ra);
  113. /// Used for related kernels. Stores expensive exp(Complex) values
  114. Complex PotentialInSourceLayer(const Real &ra);
  115. /// Used for related kernels. Stores expensive exp(Complex) values
  116. Complex RelPotentialInSourceLayer(const Real &ra);
  117. // ==================== DATA MEMBERS =========================
  118. /// Make these static consts
  119. static const Eigen::Matrix<int, 13, 1> JD;
  120. static const Eigen::Matrix<Real, 4, 4> SS_SN;
  121. static const Eigen::Matrix<Real, 4, 4> SR_SN;
  122. static const Eigen::Matrix<Real, 4, 4> RS_SN;
  123. static const Eigen::Matrix<Real, 4, 2> SS_SL;
  124. std::shared_ptr<KernelEM1DReflBase> ReflCalc;
  125. private:
  126. static constexpr auto CName = "KernelEM1DSpec";
  127. }; // ----- end of class KernelEM1DSpec -----
  128. // ================ INITIALISE STATIC CONSTS ==========================
  129. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  130. const Eigen::Matrix<int, 13, 1> KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::JD =
  131. ( Eigen::Matrix<int, 13, 1>() << 4, 4, 1, 1, 3, 3, 3, 2, 2, 1, 2, 1, 1 ).finished();
  132. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  133. const Eigen::Matrix<Real, 4, 4> KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::SS_SN =
  134. ( Eigen::Matrix<Real, 4, 4>() <<
  135. 1.e0, 1.e0, 1.e0, 1.e0,
  136. -1.e0, -1.e0, 1.e0, 1.e0,
  137. -1.e0, 1.e0, 1.e0, -1.e0,
  138. 1.e0, -1.e0, 1.e0, -1.e0 ).finished();
  139. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  140. const Eigen::Matrix<Real, 4, 4> KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::SR_SN =
  141. ( Eigen::Matrix<Real, 4, 4>() <<
  142. 1.e0, 1.e0, 1.e0, 1.e0,
  143. -1.e0, -1.e0, 1.e0, 1.e0,
  144. 1.e0, -1.e0, 1.e0, -1.e0,
  145. -1.e0, 1.e0, 1.e0, -1.e0 ).finished();
  146. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  147. const Eigen::Matrix<Real, 4, 4> KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::RS_SN =
  148. ( Eigen::Matrix<Real, 4, 4>() <<
  149. 1.e0, 1.e0, 1.e0, 1.e0,
  150. -1.e0, -1.e0, 1.e0, 1.e0,
  151. -1.e0, 1.e0, -1.e0, 1.e0,
  152. 1.e0, -1.e0, -1.e0, 1.e0 ).finished();
  153. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  154. const Eigen::Matrix<Real, 4, 2> KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::SS_SL =
  155. ( Eigen::Matrix<Real, 4, 2>() <<
  156. 1.e0, 1.e0,
  157. -1.e0, 1.e0,
  158. 1.e0, -1.e0,
  159. -1.e0, -1.e0 ).finished();
  160. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  161. std::string KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::GetName() const {
  162. return CName;
  163. }
  164. ///////////////////////////////////////////////
  165. // Declarations of specialisations for private fuctions
  166. // (some compilers seem to need these, or defaults are fallen back on)
  167. /* Bessel Args */
  168. template <>
  169. Complex KernelEM1DSpec<TM, 0, INAIR, INAIR>::BesselArg( const Real& lambda );
  170. template <>
  171. Complex KernelEM1DSpec<TM, 0, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  172. template <>
  173. Complex KernelEM1DSpec<TM, 1, INAIR, INAIR>::BesselArg( const Real& lambda );
  174. template <>
  175. Complex KernelEM1DSpec<TM, 1, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  176. template <>
  177. Complex KernelEM1DSpec<TM, 2, INAIR, INAIR>::BesselArg( const Real& lambda );
  178. template <>
  179. Complex KernelEM1DSpec<TM, 2, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  180. template <>
  181. Complex KernelEM1DSpec<TM, 3, INAIR, INAIR>::BesselArg( const Real& lambda );
  182. template <>
  183. Complex KernelEM1DSpec<TM, 3, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  184. template <>
  185. Complex KernelEM1DSpec<TM, 4, INAIR, INAIR>::BesselArg( const Real& lambda );
  186. template <>
  187. Complex KernelEM1DSpec<TM, 4, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  188. template <>
  189. Complex KernelEM1DSpec<TM, 5, INAIR, INAIR>::BesselArg( const Real& lambda );
  190. template <>
  191. Complex KernelEM1DSpec<TM, 5, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  192. template <>
  193. Complex KernelEM1DSpec<TM, 6, INAIR, INAIR>::BesselArg( const Real& lambda );
  194. template <>
  195. Complex KernelEM1DSpec<TM, 6, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  196. template <>
  197. Complex KernelEM1DSpec<TM, 7, INAIR, INAIR>::BesselArg( const Real& lambda );
  198. template <>
  199. Complex KernelEM1DSpec<TM, 7, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  200. template <>
  201. Complex KernelEM1DSpec<TM, 8, INAIR, INAIR>::BesselArg( const Real& lambda );
  202. template <>
  203. Complex KernelEM1DSpec<TM, 8, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  204. template <>
  205. Complex KernelEM1DSpec<TM, 9, INAIR, INAIR>::BesselArg( const Real& lambda );
  206. template <>
  207. Complex KernelEM1DSpec<TM, 9, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  208. template <>
  209. Complex KernelEM1DSpec<TM, 10, INAIR, INAIR>::BesselArg( const Real& lambda );
  210. template <>
  211. Complex KernelEM1DSpec<TM, 10, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  212. template <>
  213. Complex KernelEM1DSpec<TM, 11, INAIR, INAIR>::BesselArg( const Real& lambda );
  214. template <>
  215. Complex KernelEM1DSpec<TM, 11, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  216. template <>
  217. Complex KernelEM1DSpec<TM, 12, INAIR, INAIR>::BesselArg( const Real& lambda );
  218. template <>
  219. Complex KernelEM1DSpec<TM, 12, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  220. template <>
  221. Complex KernelEM1DSpec<TE, 0, INAIR, INAIR>::BesselArg( const Real& lambda );
  222. template <>
  223. Complex KernelEM1DSpec<TE, 0, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  224. template <>
  225. Complex KernelEM1DSpec<TE, 1, INAIR, INAIR>::BesselArg( const Real& lambda );
  226. template <>
  227. Complex KernelEM1DSpec<TE, 1, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  228. template <>
  229. Complex KernelEM1DSpec<TE, 2, INAIR, INAIR>::BesselArg( const Real& lambda );
  230. template <>
  231. Complex KernelEM1DSpec<TE, 2, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  232. template <>
  233. Complex KernelEM1DSpec<TE, 3, INAIR, INAIR>::BesselArg( const Real& lambda );
  234. template <>
  235. Complex KernelEM1DSpec<TE, 3, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  236. template <>
  237. Complex KernelEM1DSpec<TE, 4, INAIR, INAIR>::BesselArg( const Real& lambda );
  238. template <>
  239. Complex KernelEM1DSpec<TE, 4, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  240. template <>
  241. Complex KernelEM1DSpec<TE, 5, INAIR, INAIR>::BesselArg( const Real& lambda );
  242. template <>
  243. Complex KernelEM1DSpec<TE, 5, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  244. template <>
  245. Complex KernelEM1DSpec<TE, 6, INAIR, INAIR>::BesselArg( const Real& lambda );
  246. template <>
  247. Complex KernelEM1DSpec<TE, 6, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  248. template <>
  249. Complex KernelEM1DSpec<TE, 7, INAIR, INAIR>::BesselArg( const Real& lambda );
  250. template <>
  251. Complex KernelEM1DSpec<TE, 7, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  252. template <>
  253. Complex KernelEM1DSpec<TE, 8, INAIR, INAIR>::BesselArg( const Real& lambda );
  254. template <>
  255. Complex KernelEM1DSpec<TE, 8, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  256. template <>
  257. Complex KernelEM1DSpec<TE, 9, INAIR, INAIR>::BesselArg( const Real& lambda );
  258. template <>
  259. Complex KernelEM1DSpec<TE, 9, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  260. template <>
  261. Complex KernelEM1DSpec<TE, 10, INAIR, INAIR>::BesselArg( const Real& lambda );
  262. template <>
  263. Complex KernelEM1DSpec<TE, 10, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  264. template <>
  265. Complex KernelEM1DSpec<TE, 11, INAIR, INAIR>::BesselArg( const Real& lambda );
  266. template <>
  267. Complex KernelEM1DSpec<TE, 11, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  268. template <>
  269. Complex KernelEM1DSpec<TE, 12, INAIR, INAIR>::BesselArg( const Real& lambda );
  270. template <>
  271. Complex KernelEM1DSpec<TE, 12, INAIR, INAIR>::RelBesselArg( const Real& lambda );
  272. template <>
  273. Complex KernelEM1DSpec<TM, 0, INAIR, INGROUND>::BesselArg( const Real& lambda );
  274. template <>
  275. Complex KernelEM1DSpec<TM, 0, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  276. template <>
  277. Complex KernelEM1DSpec<TM, 1, INAIR, INGROUND>::BesselArg( const Real& lambda );
  278. template <>
  279. Complex KernelEM1DSpec<TM, 1, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  280. template <>
  281. Complex KernelEM1DSpec<TM, 2, INAIR, INGROUND>::BesselArg( const Real& lambda );
  282. template <>
  283. Complex KernelEM1DSpec<TM, 2, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  284. template <>
  285. Complex KernelEM1DSpec<TM, 3, INAIR, INGROUND>::BesselArg( const Real& lambda );
  286. template <>
  287. Complex KernelEM1DSpec<TM, 3, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  288. template <>
  289. Complex KernelEM1DSpec<TM, 4, INAIR, INGROUND>::BesselArg( const Real& lambda );
  290. template <>
  291. Complex KernelEM1DSpec<TM, 4, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  292. template <>
  293. Complex KernelEM1DSpec<TM, 5, INAIR, INGROUND>::BesselArg( const Real& lambda );
  294. template <>
  295. Complex KernelEM1DSpec<TM, 5, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  296. template <>
  297. Complex KernelEM1DSpec<TM, 6, INAIR, INGROUND>::BesselArg( const Real& lambda );
  298. template <>
  299. Complex KernelEM1DSpec<TM, 6, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  300. template <>
  301. Complex KernelEM1DSpec<TM, 7, INAIR, INGROUND>::BesselArg( const Real& lambda );
  302. template <>
  303. Complex KernelEM1DSpec<TM, 7, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  304. template <>
  305. Complex KernelEM1DSpec<TM, 8, INAIR, INGROUND>::BesselArg( const Real& lambda );
  306. template <>
  307. Complex KernelEM1DSpec<TM, 8, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  308. template <>
  309. Complex KernelEM1DSpec<TM, 9, INAIR, INGROUND>::BesselArg( const Real& lambda );
  310. template <>
  311. Complex KernelEM1DSpec<TM, 9, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  312. template <>
  313. Complex KernelEM1DSpec<TM, 10, INAIR, INGROUND>::BesselArg( const Real& lambda );
  314. template <>
  315. Complex KernelEM1DSpec<TM, 10, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  316. template <>
  317. Complex KernelEM1DSpec<TM, 11, INAIR, INGROUND>::BesselArg( const Real& lambda );
  318. template <>
  319. Complex KernelEM1DSpec<TM, 11, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  320. template <>
  321. Complex KernelEM1DSpec<TM, 12, INAIR, INGROUND>::BesselArg( const Real& lambda );
  322. template <>
  323. Complex KernelEM1DSpec<TM, 12, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  324. template <>
  325. Complex KernelEM1DSpec<TE, 0, INAIR, INGROUND>::BesselArg( const Real& lambda );
  326. template <>
  327. Complex KernelEM1DSpec<TE, 0, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  328. template <>
  329. Complex KernelEM1DSpec<TE, 1, INAIR, INGROUND>::BesselArg( const Real& lambda );
  330. template <>
  331. Complex KernelEM1DSpec<TE, 1, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  332. template <>
  333. Complex KernelEM1DSpec<TE, 2, INAIR, INGROUND>::BesselArg( const Real& lambda );
  334. template <>
  335. Complex KernelEM1DSpec<TE, 2, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  336. template <>
  337. Complex KernelEM1DSpec<TE, 3, INAIR, INGROUND>::BesselArg( const Real& lambda );
  338. template <>
  339. Complex KernelEM1DSpec<TE, 3, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  340. template <>
  341. Complex KernelEM1DSpec<TE, 4, INAIR, INGROUND>::BesselArg( const Real& lambda );
  342. template <>
  343. Complex KernelEM1DSpec<TE, 4, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  344. template <>
  345. Complex KernelEM1DSpec<TE, 5, INAIR, INGROUND>::BesselArg( const Real& lambda );
  346. template <>
  347. Complex KernelEM1DSpec<TE, 5, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  348. template <>
  349. Complex KernelEM1DSpec<TE, 6, INAIR, INGROUND>::BesselArg( const Real& lambda );
  350. template <>
  351. Complex KernelEM1DSpec<TE, 6, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  352. template <>
  353. Complex KernelEM1DSpec<TE, 7, INAIR, INGROUND>::BesselArg( const Real& lambda );
  354. template <>
  355. Complex KernelEM1DSpec<TE, 7, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  356. template <>
  357. Complex KernelEM1DSpec<TE, 8, INAIR, INGROUND>::BesselArg( const Real& lambda );
  358. template <>
  359. Complex KernelEM1DSpec<TE, 8, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  360. template <>
  361. Complex KernelEM1DSpec<TE, 9, INAIR, INGROUND>::BesselArg( const Real& lambda );
  362. template <>
  363. Complex KernelEM1DSpec<TE, 9, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  364. template <>
  365. Complex KernelEM1DSpec<TE, 10, INAIR, INGROUND>::BesselArg( const Real& lambda );
  366. template <>
  367. Complex KernelEM1DSpec<TE, 10, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  368. template <>
  369. Complex KernelEM1DSpec<TE, 11, INAIR, INGROUND>::BesselArg( const Real& lambda );
  370. template <>
  371. Complex KernelEM1DSpec<TE, 11, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  372. template <>
  373. Complex KernelEM1DSpec<TE, 12, INAIR, INGROUND>::BesselArg( const Real& lambda );
  374. template <>
  375. Complex KernelEM1DSpec<TE, 12, INAIR, INGROUND>::RelBesselArg( const Real& lambda );
  376. /* Get Bessel Order */
  377. template <>
  378. int KernelEM1DSpec<TM, 0, INAIR, INAIR>::GetBesselOrder( );
  379. template <>
  380. int KernelEM1DSpec<TM, 1, INAIR, INAIR>::GetBesselOrder( );
  381. template <>
  382. int KernelEM1DSpec<TM, 2, INAIR, INAIR>::GetBesselOrder( );
  383. template <>
  384. int KernelEM1DSpec<TM, 3, INAIR, INAIR>::GetBesselOrder( );
  385. template <>
  386. int KernelEM1DSpec<TM, 4, INAIR, INAIR>::GetBesselOrder( );
  387. template <>
  388. int KernelEM1DSpec<TM, 5, INAIR, INAIR>::GetBesselOrder( );
  389. template <>
  390. int KernelEM1DSpec<TM, 6, INAIR, INAIR>::GetBesselOrder( );
  391. template <>
  392. int KernelEM1DSpec<TM, 7, INAIR, INAIR>::GetBesselOrder( );
  393. template <>
  394. int KernelEM1DSpec<TM, 8, INAIR, INAIR>::GetBesselOrder( );
  395. template <>
  396. int KernelEM1DSpec<TM, 9, INAIR, INAIR>::GetBesselOrder( );
  397. template <>
  398. int KernelEM1DSpec<TM, 10, INAIR, INAIR>::GetBesselOrder( );
  399. template <>
  400. int KernelEM1DSpec<TM, 11, INAIR, INAIR>::GetBesselOrder( );
  401. template <>
  402. int KernelEM1DSpec<TM, 12, INAIR, INAIR>::GetBesselOrder( );
  403. template <>
  404. int KernelEM1DSpec<TE, 0, INAIR, INAIR>::GetBesselOrder( );
  405. template <>
  406. int KernelEM1DSpec<TE, 1, INAIR, INAIR>::GetBesselOrder( );
  407. template <>
  408. int KernelEM1DSpec<TE, 2, INAIR, INAIR>::GetBesselOrder( );
  409. template <>
  410. int KernelEM1DSpec<TE, 3, INAIR, INAIR>::GetBesselOrder( );
  411. template <>
  412. int KernelEM1DSpec<TE, 4, INAIR, INAIR>::GetBesselOrder( );
  413. template <>
  414. int KernelEM1DSpec<TE, 5, INAIR, INAIR>::GetBesselOrder( );
  415. template <>
  416. int KernelEM1DSpec<TE, 6, INAIR, INAIR>::GetBesselOrder( );
  417. template <>
  418. int KernelEM1DSpec<TE, 7, INAIR, INAIR>::GetBesselOrder( );
  419. template <>
  420. int KernelEM1DSpec<TE, 8, INAIR, INAIR>::GetBesselOrder( );
  421. template <>
  422. int KernelEM1DSpec<TE, 9, INAIR, INAIR>::GetBesselOrder( );
  423. template <>
  424. int KernelEM1DSpec<TE, 10, INAIR, INAIR>::GetBesselOrder( );
  425. template <>
  426. int KernelEM1DSpec<TE, 11, INAIR, INAIR>::GetBesselOrder( );
  427. template <>
  428. int KernelEM1DSpec<TE, 12, INAIR, INAIR>::GetBesselOrder( );
  429. template <>
  430. int KernelEM1DSpec<TM, 0, INAIR, INGROUND>::GetBesselOrder( );
  431. template <>
  432. int KernelEM1DSpec<TM, 1, INAIR, INGROUND>::GetBesselOrder( );
  433. template <>
  434. int KernelEM1DSpec<TM, 2, INAIR, INGROUND>::GetBesselOrder( );
  435. template <>
  436. int KernelEM1DSpec<TM, 3, INAIR, INGROUND>::GetBesselOrder( );
  437. template <>
  438. int KernelEM1DSpec<TM, 4, INAIR, INGROUND>::GetBesselOrder( );
  439. template <>
  440. int KernelEM1DSpec<TM, 5, INAIR, INGROUND>::GetBesselOrder( );
  441. template <>
  442. int KernelEM1DSpec<TM, 6, INAIR, INGROUND>::GetBesselOrder( );
  443. template <>
  444. int KernelEM1DSpec<TM, 7, INAIR, INGROUND>::GetBesselOrder( );
  445. template <>
  446. int KernelEM1DSpec<TM, 8, INAIR, INGROUND>::GetBesselOrder( );
  447. template <>
  448. int KernelEM1DSpec<TM, 9, INAIR, INGROUND>::GetBesselOrder( );
  449. template <>
  450. int KernelEM1DSpec<TM, 10, INAIR, INGROUND>::GetBesselOrder( );
  451. template <>
  452. int KernelEM1DSpec<TM, 11, INAIR, INGROUND>::GetBesselOrder( );
  453. template <>
  454. int KernelEM1DSpec<TM, 12, INAIR, INGROUND>::GetBesselOrder( );
  455. template <>
  456. int KernelEM1DSpec<TE, 0, INAIR, INGROUND>::GetBesselOrder( );
  457. template <>
  458. int KernelEM1DSpec<TE, 1, INAIR, INGROUND>::GetBesselOrder( );
  459. template <>
  460. int KernelEM1DSpec<TE, 2, INAIR, INGROUND>::GetBesselOrder( );
  461. template <>
  462. int KernelEM1DSpec<TE, 3, INAIR, INGROUND>::GetBesselOrder( );
  463. template <>
  464. int KernelEM1DSpec<TE, 4, INAIR, INGROUND>::GetBesselOrder( );
  465. template <>
  466. int KernelEM1DSpec<TE, 5, INAIR, INGROUND>::GetBesselOrder( );
  467. template <>
  468. int KernelEM1DSpec<TE, 6, INAIR, INGROUND>::GetBesselOrder( );
  469. template <>
  470. int KernelEM1DSpec<TE, 7, INAIR, INGROUND>::GetBesselOrder( );
  471. template <>
  472. int KernelEM1DSpec<TE, 8, INAIR, INGROUND>::GetBesselOrder( );
  473. template <>
  474. int KernelEM1DSpec<TE, 9, INAIR, INGROUND>::GetBesselOrder( );
  475. template <>
  476. int KernelEM1DSpec<TE, 10, INAIR, INGROUND>::GetBesselOrder( );
  477. template <>
  478. int KernelEM1DSpec<TE, 11, INAIR, INGROUND>::GetBesselOrder( );
  479. template <>
  480. int KernelEM1DSpec<TE, 12, INAIR, INGROUND>::GetBesselOrder( );
  481. template <>
  482. int KernelEM1DSpec<TM, 0, INGROUND, INGROUND>::GetBesselOrder( );
  483. template <>
  484. int KernelEM1DSpec<TM, 1, INGROUND, INGROUND>::GetBesselOrder( );
  485. template <>
  486. int KernelEM1DSpec<TM, 2, INGROUND, INGROUND>::GetBesselOrder( );
  487. template <>
  488. int KernelEM1DSpec<TM, 3, INGROUND, INGROUND>::GetBesselOrder( );
  489. template <>
  490. int KernelEM1DSpec<TM, 4, INGROUND, INGROUND>::GetBesselOrder( );
  491. template <>
  492. int KernelEM1DSpec<TM, 5, INGROUND, INGROUND>::GetBesselOrder( );
  493. template <>
  494. int KernelEM1DSpec<TM, 6, INGROUND, INGROUND>::GetBesselOrder( );
  495. template <>
  496. int KernelEM1DSpec<TM, 7, INGROUND, INGROUND>::GetBesselOrder( );
  497. template <>
  498. int KernelEM1DSpec<TM, 8, INGROUND, INGROUND>::GetBesselOrder( );
  499. template <>
  500. int KernelEM1DSpec<TM, 9, INGROUND, INGROUND>::GetBesselOrder( );
  501. template <>
  502. int KernelEM1DSpec<TM, 10, INGROUND, INGROUND>::GetBesselOrder( );
  503. template <>
  504. int KernelEM1DSpec<TM, 11, INGROUND, INGROUND>::GetBesselOrder( );
  505. template <>
  506. int KernelEM1DSpec<TM, 12, INGROUND, INGROUND>::GetBesselOrder( );
  507. template <>
  508. int KernelEM1DSpec<TE, 0, INGROUND, INGROUND>::GetBesselOrder( );
  509. template <>
  510. int KernelEM1DSpec<TE, 1, INGROUND, INGROUND>::GetBesselOrder( );
  511. template <>
  512. int KernelEM1DSpec<TE, 2, INGROUND, INGROUND>::GetBesselOrder( );
  513. template <>
  514. int KernelEM1DSpec<TE, 3, INGROUND, INGROUND>::GetBesselOrder( );
  515. template <>
  516. int KernelEM1DSpec<TE, 4, INGROUND, INGROUND>::GetBesselOrder( );
  517. template <>
  518. int KernelEM1DSpec<TE, 5, INGROUND, INGROUND>::GetBesselOrder( );
  519. template <>
  520. int KernelEM1DSpec<TE, 6, INGROUND, INGROUND>::GetBesselOrder( );
  521. template <>
  522. int KernelEM1DSpec<TE, 7, INGROUND, INGROUND>::GetBesselOrder( );
  523. template <>
  524. int KernelEM1DSpec<TE, 8, INGROUND, INGROUND>::GetBesselOrder( );
  525. template <>
  526. int KernelEM1DSpec<TE, 9, INGROUND, INGROUND>::GetBesselOrder( );
  527. template <>
  528. int KernelEM1DSpec<TE, 10, INGROUND, INGROUND>::GetBesselOrder( );
  529. template <>
  530. int KernelEM1DSpec<TE, 11, INGROUND, INGROUND>::GetBesselOrder( );
  531. template <>
  532. int KernelEM1DSpec<TE, 12, INGROUND, INGROUND>::GetBesselOrder( );
  533. template <>
  534. int KernelEM1DSpec<TM, 0, INGROUND, INAIR>::GetBesselOrder( );
  535. template <>
  536. int KernelEM1DSpec<TM, 1, INGROUND, INAIR>::GetBesselOrder( );
  537. template <>
  538. int KernelEM1DSpec<TM, 2, INGROUND, INAIR>::GetBesselOrder( );
  539. template <>
  540. int KernelEM1DSpec<TM, 3, INGROUND, INAIR>::GetBesselOrder( );
  541. template <>
  542. int KernelEM1DSpec<TM, 4, INGROUND, INAIR>::GetBesselOrder( );
  543. template <>
  544. int KernelEM1DSpec<TM, 5, INGROUND, INAIR>::GetBesselOrder( );
  545. template <>
  546. int KernelEM1DSpec<TM, 6, INGROUND, INAIR>::GetBesselOrder( );
  547. template <>
  548. int KernelEM1DSpec<TM, 7, INGROUND, INAIR>::GetBesselOrder( );
  549. template <>
  550. int KernelEM1DSpec<TM, 8, INGROUND, INAIR>::GetBesselOrder( );
  551. template <>
  552. int KernelEM1DSpec<TM, 9, INGROUND, INAIR>::GetBesselOrder( );
  553. template <>
  554. int KernelEM1DSpec<TM, 10, INGROUND, INAIR>::GetBesselOrder( );
  555. template <>
  556. int KernelEM1DSpec<TM, 11, INGROUND, INAIR>::GetBesselOrder( );
  557. template <>
  558. int KernelEM1DSpec<TM, 12, INGROUND, INAIR>::GetBesselOrder( );
  559. template <>
  560. int KernelEM1DSpec<TE, 0, INGROUND, INAIR>::GetBesselOrder( );
  561. template <>
  562. int KernelEM1DSpec<TE, 1, INGROUND, INAIR>::GetBesselOrder( );
  563. template <>
  564. int KernelEM1DSpec<TE, 2, INGROUND, INAIR>::GetBesselOrder( );
  565. template <>
  566. int KernelEM1DSpec<TE, 3, INGROUND, INAIR>::GetBesselOrder( );
  567. template <>
  568. int KernelEM1DSpec<TE, 4, INGROUND, INAIR>::GetBesselOrder( );
  569. template <>
  570. int KernelEM1DSpec<TE, 5, INGROUND, INAIR>::GetBesselOrder( );
  571. template <>
  572. int KernelEM1DSpec<TE, 6, INGROUND, INAIR>::GetBesselOrder( );
  573. template <>
  574. int KernelEM1DSpec<TE, 7, INGROUND, INAIR>::GetBesselOrder( );
  575. template <>
  576. int KernelEM1DSpec<TE, 8, INGROUND, INAIR>::GetBesselOrder( );
  577. template <>
  578. int KernelEM1DSpec<TE, 9, INGROUND, INAIR>::GetBesselOrder( );
  579. template <>
  580. int KernelEM1DSpec<TE, 10, INGROUND, INAIR>::GetBesselOrder( );
  581. template <>
  582. int KernelEM1DSpec<TE, 11, INGROUND, INAIR>::GetBesselOrder( );
  583. template <>
  584. int KernelEM1DSpec<TE, 12, INGROUND, INAIR>::GetBesselOrder( );
  585. /* POTENTIAL CALCULATIONS */
  586. /* Potential in air source layer*/
  587. template<>
  588. Complex KernelEM1DSpec<TM, 0, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  589. template<>
  590. Complex KernelEM1DSpec<TM, 0, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  591. template<>
  592. Complex KernelEM1DSpec<TM, 1, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  593. template<>
  594. Complex KernelEM1DSpec<TM, 1, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  595. template<>
  596. Complex KernelEM1DSpec<TM, 2, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  597. template<>
  598. Complex KernelEM1DSpec<TM, 2, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  599. template<>
  600. Complex KernelEM1DSpec<TM, 3, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  601. template<>
  602. Complex KernelEM1DSpec<TM, 3, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  603. template<>
  604. Complex KernelEM1DSpec<TM, 4, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  605. template<>
  606. Complex KernelEM1DSpec<TM, 4, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  607. template<>
  608. Complex KernelEM1DSpec<TM, 5, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  609. template<>
  610. Complex KernelEM1DSpec<TM, 5, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  611. template<>
  612. Complex KernelEM1DSpec<TM, 6, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  613. template<>
  614. Complex KernelEM1DSpec<TM, 6, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  615. template<>
  616. Complex KernelEM1DSpec<TM, 7, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  617. template<>
  618. Complex KernelEM1DSpec<TM, 7, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  619. template<>
  620. Complex KernelEM1DSpec<TM, 8, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  621. template<>
  622. Complex KernelEM1DSpec<TM, 8, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  623. template<>
  624. Complex KernelEM1DSpec<TM, 9, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  625. template<>
  626. Complex KernelEM1DSpec<TM, 9, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  627. template<>
  628. Complex KernelEM1DSpec<TM, 10, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  629. template<>
  630. Complex KernelEM1DSpec<TM, 10, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  631. template<>
  632. Complex KernelEM1DSpec<TM, 11, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  633. template<>
  634. Complex KernelEM1DSpec<TM, 11, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  635. template<>
  636. Complex KernelEM1DSpec<TM, 12, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  637. template<>
  638. Complex KernelEM1DSpec<TM, 12, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  639. /* Potential in air source layer TE*/
  640. template<>
  641. Complex KernelEM1DSpec<TE, 0, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  642. template<>
  643. Complex KernelEM1DSpec<TE, 0, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  644. template<>
  645. Complex KernelEM1DSpec<TE, 1, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  646. template<>
  647. Complex KernelEM1DSpec<TE, 1, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  648. template<>
  649. Complex KernelEM1DSpec<TE, 2, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  650. template<>
  651. Complex KernelEM1DSpec<TE, 2, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  652. template<>
  653. Complex KernelEM1DSpec<TE, 3, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  654. template<>
  655. Complex KernelEM1DSpec<TE, 3, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  656. template<>
  657. Complex KernelEM1DSpec<TE, 4, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  658. template<>
  659. Complex KernelEM1DSpec<TE, 4, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  660. template<>
  661. Complex KernelEM1DSpec<TE, 5, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  662. template<>
  663. Complex KernelEM1DSpec<TE, 5, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  664. template<>
  665. Complex KernelEM1DSpec<TE, 6, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  666. template<>
  667. Complex KernelEM1DSpec<TE, 6, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  668. template<>
  669. Complex KernelEM1DSpec<TE, 7, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  670. template<>
  671. Complex KernelEM1DSpec<TE, 7, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  672. template<>
  673. Complex KernelEM1DSpec<TE, 8, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  674. template<>
  675. Complex KernelEM1DSpec<TE, 8, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  676. template<>
  677. Complex KernelEM1DSpec<TE, 9, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  678. template<>
  679. Complex KernelEM1DSpec<TE, 9, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  680. template<>
  681. Complex KernelEM1DSpec<TE, 10, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  682. template<>
  683. Complex KernelEM1DSpec<TE, 10, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  684. template<>
  685. Complex KernelEM1DSpec<TE, 11, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  686. template<>
  687. Complex KernelEM1DSpec<TE, 11, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  688. template<>
  689. Complex KernelEM1DSpec<TE, 12, INAIR, INAIR>::PotentialInSourceLayer(const Real &ra);
  690. template<>
  691. Complex KernelEM1DSpec<TE, 12, INAIR, INAIR>::RelPotentialInSourceLayer(const Real &ra);
  692. /* Potential below source in air*/
  693. template<>
  694. Complex KernelEM1DSpec<TM, 0, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  695. template<>
  696. Complex KernelEM1DSpec<TM, 0, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  697. template<>
  698. Complex KernelEM1DSpec<TM, 1, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  699. template<>
  700. Complex KernelEM1DSpec<TM, 1, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  701. template<>
  702. Complex KernelEM1DSpec<TM, 2, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  703. template<>
  704. Complex KernelEM1DSpec<TM, 2, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  705. template<>
  706. Complex KernelEM1DSpec<TM, 3, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  707. template<>
  708. Complex KernelEM1DSpec<TM, 3, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  709. template<>
  710. Complex KernelEM1DSpec<TM, 4, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  711. template<>
  712. Complex KernelEM1DSpec<TM, 4, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  713. template<>
  714. Complex KernelEM1DSpec<TM, 5, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  715. template<>
  716. Complex KernelEM1DSpec<TM, 5, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  717. template<>
  718. Complex KernelEM1DSpec<TM, 6, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  719. template<>
  720. Complex KernelEM1DSpec<TM, 6, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  721. template<>
  722. Complex KernelEM1DSpec<TM, 7, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  723. template<>
  724. Complex KernelEM1DSpec<TM, 7, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  725. template<>
  726. Complex KernelEM1DSpec<TM, 8, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  727. template<>
  728. Complex KernelEM1DSpec<TM, 8, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  729. template<>
  730. Complex KernelEM1DSpec<TM, 9, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  731. template<>
  732. Complex KernelEM1DSpec<TM, 9, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  733. template<>
  734. Complex KernelEM1DSpec<TM, 10, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  735. template<>
  736. Complex KernelEM1DSpec<TM, 10, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  737. template<>
  738. Complex KernelEM1DSpec<TM, 11, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  739. template<>
  740. Complex KernelEM1DSpec<TM, 11, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  741. template<>
  742. Complex KernelEM1DSpec<TM, 12, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  743. template<>
  744. Complex KernelEM1DSpec<TM, 12, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  745. template<>
  746. Complex KernelEM1DSpec<TE, 0, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  747. template<>
  748. Complex KernelEM1DSpec<TE, 0, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  749. template<>
  750. Complex KernelEM1DSpec<TE, 1, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  751. template<>
  752. Complex KernelEM1DSpec<TE, 1, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  753. template<>
  754. Complex KernelEM1DSpec<TE, 2, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  755. template<>
  756. Complex KernelEM1DSpec<TE, 2, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  757. template<>
  758. Complex KernelEM1DSpec<TE, 3, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  759. template<>
  760. Complex KernelEM1DSpec<TE, 3, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  761. template<>
  762. Complex KernelEM1DSpec<TE, 4, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  763. template<>
  764. Complex KernelEM1DSpec<TE, 4, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  765. template<>
  766. Complex KernelEM1DSpec<TE, 5, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  767. template<>
  768. Complex KernelEM1DSpec<TE, 5, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  769. template<>
  770. Complex KernelEM1DSpec<TE, 6, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  771. template<>
  772. Complex KernelEM1DSpec<TE, 6, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  773. template<>
  774. Complex KernelEM1DSpec<TE, 7, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  775. template<>
  776. Complex KernelEM1DSpec<TE, 7, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  777. template<>
  778. Complex KernelEM1DSpec<TE, 8, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  779. template<>
  780. Complex KernelEM1DSpec<TE, 8, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  781. template<>
  782. Complex KernelEM1DSpec<TE, 9, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  783. template<>
  784. Complex KernelEM1DSpec<TE, 9, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  785. template<>
  786. Complex KernelEM1DSpec<TE, 10, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  787. template<>
  788. Complex KernelEM1DSpec<TE, 10, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  789. template<>
  790. Complex KernelEM1DSpec<TE, 11, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  791. template<>
  792. Complex KernelEM1DSpec<TE, 11, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  793. template<>
  794. Complex KernelEM1DSpec<TE, 12, INAIR, INGROUND>::PotentialBelowSourceLayer(const Real &ra);
  795. template<>
  796. Complex KernelEM1DSpec<TE, 12, INAIR, INGROUND>::RelPotentialBelowSourceLayer(const Real &ra);
  797. /////////////////////////////////////////////////////////////////////////////////
  798. ///////////////////////////////////////////////
  799. // Default mode definitions
  800. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  801. Complex KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::BesselArg(const Real& lambda) {
  802. static bool called = false;
  803. if (!called) {
  804. std::cout << "Unspecialised KernelEM1DSpec::BesselArg() <" << Mode << " " << Ikernel << " "
  805. << Isource << " " << Irecv << ">...slow" << std::endl;
  806. called = true;
  807. }
  808. ///////////////////////////////////////////////
  809. // Compute reflection coeffs (4) ways
  810. // 1) Member function pointer
  811. // 2) Fast Delegates way
  812. // 3) Boost::function and boost::bind way
  813. // 4) No function pointers, all logic @ each step.
  814. // For (4) about 40% of time is spent in this loop.
  815. // However, none of the other options are producing
  816. // apreciably faster code.
  817. // Function pointers used to specilized cases
  818. //(this->*ComputeReflectionCoeffs)( );
  819. // Boost::bind way and fast delegates way
  820. //ComputeReflectionCoeffs();
  821. //ComputeReflectionCoeffsTempl<TE>();
  822. // Don't use function pointers, ~ same speed right now :(
  823. ReflCalc->ComputeReflectionCoeffs(lambda);
  824. ReflCalc->id = this->JD(Ikernel);
  825. // If these params are equal they share reflection coeffs
  826. // + layr
  827. // ++ ifirst;
  828. Real ra=1.0;
  829. int i1=(Ikernel )*(Ikernel- 2)*(Ikernel- 5)*(Ikernel- 7);
  830. int i2=(Ikernel-4)*(Ikernel- 9)*(Ikernel-10)*(Ikernel-12);
  831. if(i1 == 0) ra=lambda;
  832. if(i2 == 0) ra=ReflCalc->rams;
  833. if(Ikernel == 11) ra=lambda*ReflCalc->rams;
  834. Complex pot;
  835. if (ReflCalc->lays == ReflCalc->layr) {
  836. pot = PotentialInSourceLayer(ra);
  837. } else if (ReflCalc->layr > ReflCalc->lays) {
  838. pot = PotentialBelowSourceLayer(ra);
  839. } else {
  840. pot = PotentialAboveSourceLayer(ra);
  841. }
  842. return pot/ReflCalc->uk;
  843. }
  844. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  845. int KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::GetBesselOrder( ) {
  846. std::cerr << "Calling base GetBesselOrder in KernelEM1DSpec < " << Mode
  847. << "\t" << Ikernel << "\t" << Isource << "\t" << Irecv << "\n";
  848. exit(EXIT_FAILURE);
  849. return 1;
  850. }
  851. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  852. Complex KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::RelBesselArg(const Real& lambda) {
  853. static bool called = false;
  854. if (!called) {
  855. std::cout << "Unspecialised KernelEM1DSpec::RelBesselArg <" << Mode << " " << Ikernel << " "
  856. << Isource << " " << Irecv << ">...slow" << std::endl;
  857. called = true;
  858. }
  859. return this->BesselArg(lambda);
  860. }
  861. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  862. Complex KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::PotentialAboveSourceLayer(const Real &ra) {
  863. static bool called = false;
  864. if (!called) {
  865. std::cout << "WARNING: ";
  866. std::cout << "Unspecialised PotentialAboveSourceLayer <" << Mode << " " << Ikernel << " "
  867. << Isource << " " << Irecv << ">...this function will be slow\n\n";
  868. called = true;
  869. }
  870. Complex ud;
  871. switch (ReflCalc->id) {
  872. case (2):
  873. ud = ReflCalc->um;
  874. break;
  875. case (3):
  876. ud = ReflCalc->uk;
  877. break;
  878. case (4):
  879. ud = ReflCalc->um*ReflCalc->uk;
  880. break;
  881. default:
  882. ud = Complex(1,0);
  883. }
  884. int I1 = (Ikernel )*(Ikernel- 1)*(Ikernel- 4)*(Ikernel- 7)*
  885. (Ikernel- 8)*(Ikernel- 9)*(Ikernel-10)*(Ikernel-11);
  886. Complex CC, DD(1,0);
  887. if (Mode==TM && ReflCalc->layr==0 && I1==0) {
  888. CC = (Real)(2.) * ReflCalc->rtu(ReflCalc->lays)*ReflCalc->u(1)*ReflCalc->yh(0) /
  889. (ReflCalc->yh(0)*ReflCalc->u(1)-ReflCalc->yh(1)*ReflCalc->u(0));
  890. } else {
  891. CC = ReflCalc->rtu(ReflCalc->lays)+ReflCalc->rtu(ReflCalc->lays)/ReflCalc->rtu(ReflCalc->layr+1);
  892. }
  893. if (ReflCalc->lays < ReflCalc->nlay) {
  894. DD -= ReflCalc->rtu(ReflCalc->lays) * ReflCalc->rtd(ReflCalc->lays) * ReflCalc->cf(ReflCalc->lays) ;
  895. }
  896. if (ReflCalc->layr > 0) {
  897. DD *= ( (Real)(1.) + ReflCalc->rtu(ReflCalc->layr)*ReflCalc->cf(ReflCalc->layr));
  898. }
  899. Complex A = CC/DD;
  900. int LS = ReflCalc->layr + 1;
  901. int LE = ReflCalc->lays - 1;
  902. if (LE >= LS) {
  903. for (int N=LS; N<=LE; ++N) {
  904. A *= (ReflCalc->rtu(N)+ReflCalc->rtu(N)/ReflCalc->rtu(N+1)) /
  905. ( (Real)(1.)+ReflCalc->rtu(N)*ReflCalc->cf(N));
  906. }
  907. }
  908. Complex P(0);
  909. Complex CON(0);
  910. if (ReflCalc->layr == 0) {
  911. P = - ReflCalc->u(0)*ReflCalc->rx_z;
  912. if (LE > 0) {
  913. for (int N=1; N<=LE; ++N) {
  914. P += (Real)(2.)*ReflCalc->u(N)*ReflCalc->LayerThickness(N)+(ReflCalc->u(N+1)-ReflCalc->u(N))*ReflCalc->LayerDepth(N);
  915. }
  916. }
  917. CON = RS_SN(ReflCalc->id-1, 2) * std::exp(-P-ReflCalc->uk*(ReflCalc->tx_z-(Real)(2.)*ReflCalc->LayerDepth(ReflCalc->lays-1)));
  918. if (ReflCalc->lays < ReflCalc->nlay-1) {
  919. CON += RS_SN(ReflCalc->id-1, 3)*ReflCalc->rtd(ReflCalc->lays) *
  920. std::exp(-P-ReflCalc->uk*((Real)(2.)*ReflCalc->LayerThickness(ReflCalc->lays)-ReflCalc->tx_z));
  921. }
  922. } else {
  923. for (int N=ReflCalc->layr; N<=LE; ++N) {
  924. P += (Real)(2.)*ReflCalc->u(N)*ReflCalc->LayerThickness(N)+(ReflCalc->u(N+1)-ReflCalc->u(N))*ReflCalc->LayerDepth(N);
  925. }
  926. CON = RS_SN(ReflCalc->id-1, 0)*ReflCalc->rtu(ReflCalc->layr) *
  927. std::exp(-P-ReflCalc->uk*(ReflCalc->tx_z-(Real)(2.)*ReflCalc->LayerDepth(ReflCalc->lays-1))-ReflCalc->um*ReflCalc->rx_z) +
  928. RS_SN(ReflCalc->id-1, 2) *
  929. std::exp(-P-ReflCalc->uk*(ReflCalc->tx_z-(Real)(2.)*ReflCalc->LayerDepth(ReflCalc->lays-1))-
  930. ReflCalc->um*((Real)(2.)*ReflCalc->LayerDepth(ReflCalc->layr-1)-ReflCalc->rx_z));
  931. if (ReflCalc->layr < ReflCalc->nlay-1) {
  932. CON += ReflCalc->rtd(ReflCalc->lays)*(RS_SN(ReflCalc->id-1,1)*ReflCalc->rtu(ReflCalc->layr) *
  933. std::exp(-P-ReflCalc->uk*( (Real)(2.)*ReflCalc->LayerThickness(ReflCalc->lays)-ReflCalc->tx_z)-
  934. ReflCalc->um*ReflCalc->rx_z) + RS_SN(ReflCalc->id-1,3)*
  935. std::exp(-P-ReflCalc->uk*( (Real)(2.)*ReflCalc->LayerThickness(ReflCalc->lays)-ReflCalc->tx_z)-
  936. ReflCalc->um*( (Real)(2.)*ReflCalc->LayerDepth(ReflCalc->layr-1)-ReflCalc->rx_z)));
  937. }
  938. }
  939. return ra*A*CON*ud;
  940. }
  941. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  942. Complex KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::RelPotentialBelowSourceLayer(const Real &ra) {
  943. static bool called = false;
  944. if (!called) {
  945. std::cout << "WARNING\n";
  946. std::cout << "Unspecialised PotentialBelowSourceLayer <" << Mode << " " << Ikernel << " "
  947. << Isource << " " << Irecv << ">...this function will be slow\n\n";
  948. called = true;
  949. }
  950. return PotentialBelowSourceLayer(ra);
  951. }
  952. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  953. Complex KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::PotentialBelowSourceLayer(const Real &ra) {
  954. static bool called = false;
  955. if (!called) {
  956. std::cout << "WARNING\n";
  957. std::cout << "Unspecialised PotentialBelowSourceLayer <" << Mode << " " << Ikernel << " "
  958. << Isource << " " << Irecv << ">...this function will be slow\n\n";
  959. called = true;
  960. }
  961. Complex ud;
  962. switch (ReflCalc->id) {
  963. case 2:
  964. ud = ReflCalc->um;
  965. break;
  966. case 3:
  967. ud = ReflCalc->uk;
  968. break;
  969. case 4:
  970. ud = ReflCalc->um*ReflCalc->uk;
  971. break;
  972. default:
  973. ud = 1.;
  974. }
  975. Complex dd(1.,0);
  976. if (ReflCalc->lays > 0) {
  977. dd -= ReflCalc->rtu(ReflCalc->lays)*ReflCalc->rtd(ReflCalc->lays)*ReflCalc->cf(ReflCalc->lays);
  978. }
  979. if (ReflCalc->lays < ReflCalc->nlay) {
  980. dd *= ((Real)(1.)+ReflCalc->rtd(ReflCalc->lays+1)*ReflCalc->cf(ReflCalc->lays+1));
  981. }
  982. Complex a = ((Real)(1.) + ReflCalc->rtd(ReflCalc->lays)) / dd;
  983. if (ReflCalc->layr >= ReflCalc->lays+2) {
  984. for (int n=ReflCalc->lays+2; n<=ReflCalc->layr; ++n) {
  985. a *= ((Real)(1.)+ReflCalc->rtd(n-1));
  986. if (n < ReflCalc->nlay-1) {
  987. a /= ((Real)(1.)+ReflCalc->rtd(n)*ReflCalc->cf(n));
  988. }
  989. }
  990. }
  991. Complex p(0,0);
  992. for (int n=ReflCalc->lays+1; n<=ReflCalc->layr; ++n) {
  993. Complex ut = ReflCalc->u(0);
  994. if (n>1) {
  995. ut = ReflCalc->u(n-1);
  996. }
  997. p += (ReflCalc->u(n)-ut) * ReflCalc->LayerDepth(n-1);
  998. }
  999. Complex con = SR_SN(ReflCalc->id-1, 0) * std::exp(ReflCalc->uk*ReflCalc->tx_z - ReflCalc->um*ReflCalc->rx_z + p);
  1000. if (ReflCalc->layr < ReflCalc->Earth->GetNumberOfLayers()-1) {
  1001. con += SR_SN(ReflCalc->id-1, 2) * ReflCalc->rtd(ReflCalc->layr) * std::exp(ReflCalc->uk*ReflCalc->tx_z-
  1002. ReflCalc->um*((Real)(2.)*ReflCalc->LayerDepth(ReflCalc->layr)-ReflCalc->rx_z)+p);
  1003. }
  1004. if (ReflCalc->lays > 0) {
  1005. con += SR_SN(ReflCalc->id-1, 1) * ReflCalc->rtu(ReflCalc->lays)*std::exp(ReflCalc->uk*( (Real)(2.)*
  1006. ReflCalc->LayerDepth(ReflCalc->lays-1)-ReflCalc->tx_z)-ReflCalc->um*ReflCalc->rx_z+p);
  1007. if (ReflCalc->layr < ReflCalc->Earth->GetNumberOfLayers()-1) {
  1008. con += SR_SN(ReflCalc->id-1, 3) * ReflCalc->rtu(ReflCalc->lays)*ReflCalc->rtd(ReflCalc->layr) *
  1009. std::exp(ReflCalc->uk*((Real)(2.)*ReflCalc->LayerDepth(ReflCalc->lays-1)-ReflCalc->tx_z)-ReflCalc->um*
  1010. ((Real)(2.)*ReflCalc->LayerDepth(ReflCalc->layr)-ReflCalc->rx_z)+p);
  1011. }
  1012. }
  1013. return ra*a*con*ud;
  1014. }
  1015. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  1016. Complex KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::RelPotentialInSourceLayer(const Real &ra) {
  1017. static bool called = false;
  1018. if (!called) {
  1019. std::cout << "Unspecialised KernelEM1DSpec::RelPotentialInSourceLayer() <" << Mode << " " << Ikernel << " "
  1020. << Isource << " " << Irecv << ">...slow" << std::endl;
  1021. called = true;
  1022. }
  1023. return PotentialInSourceLayer(ra);
  1024. }
  1025. template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
  1026. Complex KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::PotentialInSourceLayer(const Real &ra) {
  1027. static bool called = false;
  1028. if (!called) {
  1029. std::cout << "WARNING\n";
  1030. std::cout << "Unspecialised PotentialInSourceLayer <" << Mode << " " << Ikernel << " "
  1031. << Isource << " " << Irecv << ">...this function will be slow\n\n";
  1032. called = true;
  1033. }
  1034. int iud(0);
  1035. if (ReflCalc->rx_z <= ReflCalc->tx_z) iud=1;
  1036. Real adz = std::abs(ReflCalc->rx_z - ReflCalc->tx_z);
  1037. Complex con;
  1038. Complex ud;
  1039. switch (ReflCalc->id) {
  1040. case (1):
  1041. ud = 1.;
  1042. break;
  1043. case (4):
  1044. ud = ReflCalc->uk*ReflCalc->uk;
  1045. break;
  1046. default:
  1047. ud = ReflCalc->uk;
  1048. }
  1049. if (ReflCalc->lays == 0) {
  1050. con = ReflCalc->rtd(0)*std::exp(ReflCalc->u(0)*(ReflCalc->rx_z+ReflCalc->tx_z));
  1051. } else {
  1052. if (ReflCalc->lays == ReflCalc->Earth->GetNumberOfLayers() - 1) {
  1053. con = SS_SN(ReflCalc->id-1, 0)*ReflCalc->rtu(ReflCalc->nlay-1)*std::exp(ReflCalc->u(ReflCalc->nlay-1) *
  1054. ((Real)(2.)*ReflCalc->LayerDepth(ReflCalc->nlay-2)-ReflCalc->rx_z-ReflCalc->tx_z));
  1055. } else {
  1056. con = ReflCalc->rtu(ReflCalc->lays)*(SS_SN(ReflCalc->id-1,0)*
  1057. std::exp(ReflCalc->uk*((Real)(2.)*ReflCalc->LayerDepth(ReflCalc->lays-1) -
  1058. ReflCalc->rx_z-ReflCalc->tx_z)) + SS_SN(ReflCalc->id-1, 1)*ReflCalc->rtd(ReflCalc->lays) *
  1059. std::exp(ReflCalc->uk*(ReflCalc->tx_z-ReflCalc->rx_z-(Real)(2.)* ReflCalc->LayerThickness(ReflCalc->lays)))) +
  1060. ReflCalc->rtd(ReflCalc->lays)*(SS_SN(ReflCalc->id-1, 2)* std::exp(ReflCalc->uk*(ReflCalc->rx_z+ReflCalc->tx_z-(Real)(2.) *
  1061. ReflCalc->LayerDepth(ReflCalc->lays))) + SS_SN(ReflCalc->id-1, 3)*ReflCalc->rtu(ReflCalc->lays) *
  1062. std::exp(ReflCalc->uk*(ReflCalc->rx_z-ReflCalc->tx_z-(Real)(2.) * ReflCalc->LayerThickness(ReflCalc->lays)))) ;
  1063. con /= ((Real)(1.)-ReflCalc->rtu(ReflCalc->lays)*ReflCalc->rtd(ReflCalc->lays)*ReflCalc->cf(ReflCalc->lays)) ;
  1064. }
  1065. }
  1066. // Add singular term (source term)
  1067. con += SS_SL(ReflCalc->id-1, iud)*std::exp(-ReflCalc->uk*adz);
  1068. return ra*ud*con;
  1069. }
  1070. } // ----- end of Lemma name -----
  1071. #endif // ----- #ifndef KERNELEM1DSPEC_INC -----