Main Lemma Repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

KernelEM1DSpec.h 52KB

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