123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
-
-
-
-
-
-
- #ifndef KERNELEM1DMANAGER_INC
- #define KERNELEM1DMANAGER_INC
-
-
-
- #include "kernelem1dbase.h"
- #include "kernelem1dspec.h"
-
- namespace Lemma {
-
- class DipoleSource;
- class KernelEM1DReflBase;
-
-
-
-
-
-
- class KernelEM1DManager : public LemmaObject {
-
- public:
-
- friend std::ostream &operator<<(std::ostream &stream,
- const KernelEM1DManager &ob);
-
-
-
-
-
- static KernelEM1DManager* New();
-
-
-
- void Delete();
-
-
-
-
-
- template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
- int AddKernel( );
-
-
-
- void ResetSource(const int& ifreq);
-
-
-
- void ComputeReflectionCoeffs(const Real& lambda, const int& idx, const Real& rho0);
-
-
- void ClearVec() {
- for (unsigned int ik=0; ik<this->KernelVec.size(); ++ik) {
- this->KernelVec[ik]->Delete();
- }
- KernelVec.clear();
- }
-
-
-
-
-
- void SetEarth( LayeredEarthEM* Earth);
-
-
- void SetDipoleSource( DipoleSource* Dipole, const int& ifreq, const Real& rx_zin);
-
-
-
- KernelEm1DBase* GetKernel(const unsigned int& ik);
-
-
-
- DipoleSource* GetDipole( );
-
- inline std::vector<KernelEm1DBase*> GetSTLVector() {
- return KernelVec;
- }
-
-
-
- protected:
-
-
-
-
- KernelEM1DManager (const std::string& name);
-
-
- ~KernelEM1DManager ();
-
-
-
- void Release();
-
-
-
-
- std::vector<KernelEm1DBase*> KernelVec;
-
-
- KernelEM1DReflBase* TEReflBase;
-
-
- KernelEM1DReflBase* TMReflBase;
-
-
- LayeredEarthEM* Earth;
-
-
- DipoleSource* Dipole;
-
-
- int ifreq;
-
-
- Real rx_z;
-
- private:
-
- };
-
-
- template<EMMODE Mode, int Ikernel, DIPOLE_LOCATION Isource, DIPOLE_LOCATION Irecv>
- int KernelEM1DManager::AddKernel( ) {
-
- KernelEm1DSpec<Mode, Ikernel, Isource, Irecv>* NewKern =
- KernelEm1DSpec<Mode, Ikernel, Isource, Irecv>::New();
- KernelVec.push_back( NewKern );
- NewKern->managerIdx = KernelVec.size()-1;
- switch (Mode) {
- case TE:
- if (TEReflBase == NULL) {
- TEReflBase = KernelEM1DReflSpec<TE, Isource, Irecv>::New();
- TEReflBase->Initialise(Earth);
- TEReflBase->SetUpSource(Dipole, ifreq);
- TEReflBase->SetUpReceiver( rx_z );
- }
- NewKern->SetReflBase(TEReflBase);
- break;
- case TM:
- if (TMReflBase == NULL) {
- TMReflBase = KernelEM1DReflSpec<TM, Isource, Irecv>::New();
- TMReflBase->Initialise(Earth);
- TMReflBase->SetUpSource(Dipole, ifreq);
- TMReflBase->SetUpReceiver( rx_z );
- }
- NewKern->SetReflBase(TMReflBase);
- break;
- }
- return static_cast<int>(KernelVec.size()-1);
- }
-
-
-
-
-
-
-
-
-
-
- }
-
- #endif
|