123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
-
-
-
-
-
-
- #ifndef KERNELEM1DREFLBASE_INC
- #define KERNELEM1DREFLBASE_INC
-
- #include "dipolesource.h"
- #include "kernelem1dbase.h"
- #include "layeredearthem.h"
-
-
- namespace Lemma {
-
-
-
- enum DIPOLE_LOCATION { INAIR, INGROUND };
-
-
- template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
- class KernelEm1DSpec;
-
-
-
-
-
-
-
- class KernelEM1DReflBase : public LemmaObject {
-
- template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
- friend class KernelEm1DSpec;
- friend class KernelEM1DManager;
-
- public:
-
-
-
-
-
-
-
- void Initialise(LayeredEarthEM* EarthIn) {
-
- nlay = EarthIn->GetNumberOfLayers();
- zh = VectorXcr::Zero(nlay);
- yh = VectorXcr::Zero(nlay);
- u = VectorXcr::Zero(nlay);
- cf = VectorXcr::Zero(nlay);
- rtu = VectorXcr::Zero(nlay);
- rtd = VectorXcr::Zero(nlay);
- kk = VectorXcr::Zero(nlay);
- Zyu = VectorXcr::Zero(nlay);
- Zyd = VectorXcr::Zero(nlay);
- Zyi = VectorXcr::Zero(nlay);
- th = VectorXcr::Zero(nlay);
-
-
-
-
-
-
-
-
- Earth = EarthIn;
-
- LayerThickness.resize(nlay);
- for (int ilay=0; ilay<nlay; ++ilay) {
- LayerThickness(ilay) = Earth->GetLayerThickness(ilay);
- }
-
- LayerDepth.resize(nlay);
- for (int ilay=0; ilay<nlay; ++ilay) {
- LayerDepth(ilay) = Earth->GetLayerDepth(ilay);
- }
-
- }
-
- void SetUpSource(DipoleSource *Dipole, const int &ifreq) {
-
- zh(0) = Complex(0, Dipole->GetAngularFrequency(ifreq)*MU0);
- yh(0) = Complex(0, Dipole->GetAngularFrequency(ifreq)*EPSILON0);
- kk(0) = -zh(0) * yh(0);
-
- Earth->EvaluateColeColeModel(Dipole->GetAngularFrequency(ifreq));
-
- for (int ilay=1; ilay<Earth->GetNumberOfLayers(); ++ilay) {
- zh(ilay) = zh(0) * Earth->GetLayerSusceptibility(ilay);
- yh(ilay) = Earth->GetLayerConductivity(ilay) +
- yh(0)*Earth->GetLayerPermitivity(ilay);
- kk(ilay) = -zh(ilay)*yh(ilay);
- }
-
- tx_z = Dipole->GetLocation(2);
- lays = 0;
- Real Depth(0);
- for (int ilay=1; ilay<nlay; ++ilay) {
- if (tx_z > Depth) {
- lays = ilay;
- }
- Depth += LayerThickness(ilay);
- }
- }
-
- void SetUpReceiver(const Real &rz) {
- rx_z = rz;
- Real Depth(0.);
- layr = 0;
- for (int ilay=1; ilay<Earth->GetNumberOfLayers(); ++ilay) {
- if (rx_z > Depth) {
- layr = ilay;
- }
- Depth += LayerThickness(ilay);
- }
- }
-
-
- Complex GetYm() {
- return yh(layr);
- }
-
- Complex GetZm() {
- return zh(layr);
- }
-
- Complex GetZs() {
- return zh(lays);
- }
-
- Complex GetKs() {
- return kk(lays);
- }
-
-
-
- protected:
-
-
-
-
- KernelEM1DReflBase (const std::string& name) : LemmaObject(name)
- {
- }
-
-
- ~KernelEM1DReflBase () {
- if (this->NumberOfReferences > 0)
- throw DeleteObjectWithReferences( this );
- }
-
- void Release() {
- delete this;
- }
-
-
-
-
-
- virtual void ComputeReflectionCoeffs(const Real& lambda)=0;
-
-
-
- virtual void PreComputePotentialTerms()=0;
-
-
-
-
- int id;
-
-
- int lays;
-
-
- int layr;
-
-
- int nlay;
-
-
- int nRelated;
-
-
- int relIud;
-
-
- Real rx_z;
-
-
- Real tx_z;
-
-
- Real rams;
-
-
- Complex relCon;
-
- Complex relenukadz;
-
- Complex relexp_pbs1;
-
- Complex relexp_pbs2;
-
- Complex rel_a;
-
-
- EMMODE mode;
-
-
- LayeredEarthEM *Earth;
-
- Complex uk;
- Complex um;
- VectorXcr cf;
- VectorXcr u;
- VectorXcr yh;
- VectorXcr zh;
- VectorXcr kk;
- VectorXcr Zyu;
- VectorXcr Zyd;
- VectorXcr Zyi;
- VectorXcr th;
- VectorXr LayerThickness;
- VectorXr LayerDepth;
-
-
-
- VectorXcr rtu;
-
-
-
- VectorXcr rtd;
-
- private:
-
- };
-
- }
-
- #endif
|