123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363 |
-
-
-
-
-
-
- #ifndef __DIPOLESOURCE_H
- #define __DIPOLESOURCE_H
-
- #include <memory>
- #include "LemmaObject.h"
- #include "LayeredEarthEM.h"
-
-
- #ifdef LEMMAUSEVTK
- #include "vtkActor.h"
- #include "vtkLineSource.h"
- #include "vtkSphereSource.h"
- #include "vtkPolyDataMapper.h"
- #include "vtkTubeFilter.h"
- #include "vtkRegularPolygonSource.h"
- #include "vtkProperty.h"
- #endif
-
- namespace Lemma {
-
-
- class KernelEM1DManager;
- class FieldPoints;
- class HankelTransform;
-
-
-
-
-
-
-
-
-
-
-
- class DipoleSource : public LemmaObject {
-
-
-
- friend std::ostream &operator<<(std::ostream &stream, const DipoleSource &ob);
-
- friend class EMEarth1D;
- friend class PolygonalWireAntenna;
-
- public:
-
-
-
-
-
-
- explicit DipoleSource ( const ctor_key& );
-
-
- DipoleSource ( const YAML::Node& node, const ctor_key& );
-
-
- ~DipoleSource ();
-
-
-
- static std::shared_ptr< DipoleSource > NewSP();
-
-
-
- YAML::Node Serialize() const;
-
-
-
- static std::shared_ptr< DipoleSource > DeSerialize(const YAML::Node& node);
-
-
-
- static std::shared_ptr<DipoleSource> DeSerialize( const std::string& node ) {
- return DipoleSource::DeSerialize(YAML::LoadFile(node));
- }
-
-
-
- std::shared_ptr< DipoleSource > Clone();
-
-
-
-
-
-
-
-
- void SetLocation(const Vector3r &posin);
-
-
-
- void SetLocation(const Real &xp, const Real &yp, const Real &zp);
-
-
-
- void SetPolarisation(const Vector3r &dir);
-
-
-
- void SetPolarisation(const Real& x, const Real& y, const Real& z );
-
-
-
- void SetPolarisation(const DipoleSourcePolarisation &pol);
-
-
-
-
- void SetType(const DIPOLESOURCETYPE &stype);
-
-
- void SetMoment(const Real &moment);
-
-
- void SetPhase(const Real &phase);
-
-
- void SetPolarity(const DipoleSourcePolarity& pol);
-
-
- void SetNumberOfFrequencies(const int &nfreq);
-
-
-
-
- void SetFrequency(const int &ifreq, const Real &freq);
-
-
-
-
- void SetFrequencies(const VectorXr& freqs);
-
-
-
-
-
- Vector3r GetPolarisation();
-
-
- Vector3r GetLocation();
-
-
-
- Real GetLocation(const int &coordinate);
-
-
- DIPOLESOURCETYPE GetDipoleSourceType();
-
-
- DIPOLESOURCETYPE GetType();
-
-
- std::shared_ptr<KernelEM1DManager> GetKernelManager();
-
-
-
-
-
- Real GetMoment();
-
-
- Real GetAngularFrequency(const int &ifreq);
-
-
- Real GetFrequency(const int &ifreq);
-
-
- VectorXr GetFrequencies( );
-
-
- Real GetPhase();
-
-
- int GetNumberOfFrequencies();
-
- #ifdef LEMMAUSEVTK
-
-
-
- vtkActor* GetVtkActor();
- #endif
-
-
- virtual std::string GetName() const ;
-
- protected:
-
-
-
-
-
- void SetKernels(const int& ifreq, const FIELDCALCULATIONS& Fields,
- std::shared_ptr<FieldPoints> Receivers, const int& irec,
- std::shared_ptr<LayeredEarthEM> Earth );
-
-
-
- void SetupLight(const int& ifreq, const FIELDCALCULATIONS& Fields, const int& irec);
-
-
- virtual void ReSetKernels(const int& ifreq, const FIELDCALCULATIONS& Fields,
- std::shared_ptr<FieldPoints> Receivers,
- const int& irec, std::shared_ptr<LayeredEarthEM> Earth );
-
-
- virtual void UpdateFields(const int& ifreq, HankelTransform* Hankel, const Real& wavef);
-
- private:
-
-
-
-
- DIPOLESOURCETYPE Type;
-
-
-
-
-
-
-
-
- int irec;
- int lays;
- int layr;
-
-
- Real Phase;
-
-
- Real Moment;
-
- Real xxp;
- Real yyp;
- Real rho;
- Real sp;
- Real cp;
- Real scp;
- Real sps;
- Real cps;
- Real c2p;
- Real kernelFreq;
-
- FIELDCALCULATIONS FieldsToCalculate = BOTH;
-
- VectorXcr f;
- VectorXi ik;
-
-
- Vector3r Location;
-
-
- Vector3r Phat;
-
-
- VectorXr Freqs;
-
-
- std::shared_ptr<KernelEM1DManager> KernelManager;
-
-
- std::shared_ptr<FieldPoints> Receivers;
-
-
- std::shared_ptr<LayeredEarthEM> Earth;
-
-
- static constexpr auto CName = "DipoleSource";
-
- };
-
-
-
- class NullDipoleSource : public std::runtime_error {
- public:
-
-
- NullDipoleSource ( );
- };
-
-
-
- class NonValidDipoleTypeAssignment : public std::runtime_error {
- public:
- NonValidDipoleTypeAssignment( );
- };
-
-
-
- class NonValidDipoleType : public std::runtime_error {
- public:
-
-
- NonValidDipoleType( );
-
-
- NonValidDipoleType( LemmaObject *ptr );
- };
-
-
-
- class NonValidDipolePolarisation : public std::runtime_error {
- public:
- NonValidDipolePolarisation( );
- };
-
-
-
- class NonValidDipolePolarity : public std::runtime_error {
- public:
- NonValidDipolePolarity( );
- };
-
-
-
- class NonValidDipolePolarisationAssignment : public std::runtime_error {
- public:
- NonValidDipolePolarisationAssignment( );
- };
-
-
-
- class NonValidLocationCoordinate : public std::runtime_error {
- public:
- NonValidLocationCoordinate( );
- };
-
- }
-
- #endif
|