Main Lemma Repository
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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