123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- /* This file is part of Lemma, a geophysical modelling and inversion API.
- * More information is available at http://lemmasoftware.org
- */
-
- /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
- /**
- * @file
- * @date 11/11/2016 01:47:25 PM
- * @version $Id$
- * @author Trevor Irons (ti)
- * @email tirons@egi.utah.edu
- * @copyright Copyright (c) 2016, University of Utah
- * @copyright Copyright (c) 2016, Lemma Software, LLC
- */
-
-
- #include "KernelV0.h"
- #include "EMEarth1D.h"
- #include "FieldPoints.h"
-
- namespace Lemma {
-
- // ==================== FRIEND METHODS =====================
-
- std::ostream &operator << (std::ostream &stream, const KernelV0 &ob) {
- stream << ob.Serialize() << "\n---\n"; // End of doc ---
- return stream;
- }
-
- // ==================== LIFECYCLE =======================
-
- //--------------------------------------------------------------------------------------
- // Class: KernelV0
- // Method: KernelV0
- // Description: constructor (locked)
- //--------------------------------------------------------------------------------------
- KernelV0::KernelV0 (const ctor_key&) : LemmaObject( ) {
-
- } // ----- end of method KernelV0::KernelV0 (constructor) -----
-
- //--------------------------------------------------------------------------------------
- // Class: KernelV0
- // Method: KernelV0
- // Description: DeSerializing constructor (locked)
- //--------------------------------------------------------------------------------------
- KernelV0::KernelV0 (const YAML::Node& node, const ctor_key&) : LemmaObject(node) {
-
- } // ----- end of method KernelV0::KernelV0 (constructor) -----
-
- //--------------------------------------------------------------------------------------
- // Class: KernelV0
- // Method: NewSP()
- // Description: public constructor returing a shared_ptr
- //--------------------------------------------------------------------------------------
- std::shared_ptr< KernelV0 > KernelV0::NewSP() {
- return std::make_shared< KernelV0 >( ctor_key() );
- }
-
- //--------------------------------------------------------------------------------------
- // Class: KernelV0
- // Method: ~KernelV0
- // Description: destructor (protected)
- //--------------------------------------------------------------------------------------
- KernelV0::~KernelV0 () {
-
- } // ----- end of method KernelV0::~KernelV0 (destructor) -----
-
- //--------------------------------------------------------------------------------------
- // Class: KernelV0
- // Method: Serialize
- //--------------------------------------------------------------------------------------
- YAML::Node KernelV0::Serialize ( ) const {
- YAML::Node node = LemmaObject::Serialize();
- node.SetTag( GetName() );
-
- // Coils Transmitters & Receivers
- for ( auto txm : TxRx) {
- node[txm.first] = txm.second->Serialize();
- }
-
- // LayeredEarthEM
- node["SigmaModel"] = SigmaModel->Serialize();
-
- return node;
- } // ----- end of method KernelV0::Serialize -----
-
- //--------------------------------------------------------------------------------------
- // Class: KernelV0
- // Method: DeSerialize
- //--------------------------------------------------------------------------------------
- std::shared_ptr<KernelV0> KernelV0::DeSerialize ( const YAML::Node& node ) {
- if (node.Tag() != "KernelV0" ) {
- throw DeSerializeTypeMismatch( "KernelV0", node.Tag());
- }
- return std::make_shared< KernelV0 > ( node, ctor_key() );
- } // ----- end of method KernelV0::DeSerialize -----
-
- //--------------------------------------------------------------------------------------
- // Class: KernelV0
- // Method: DeSerialize
- //--------------------------------------------------------------------------------------
- void KernelV0::CalculateK0 (const std::vector< std::string>& Tx, const std::vector<std::string >& Rx ) {
-
- for (auto tx : Tx) {
- // Set up EMEarth
- auto EmEarth = EMEarth1D::NewSP();
- EmEarth->AttachWireAntenna(TxRx[tx]);
- EmEarth->AttachLayeredEarthEM(SigmaModel);
- EmEarth->SetFieldsToCalculate(H);
- // TODO query for method, altough with flat antennae, this is fastest
- EmEarth->SetHankelTransformMethod(ANDERSON801);
-
- // EmEarth->AttachFieldPoints(receivers);
- // //EmEarth->SetHankelTransformMethod(FHTKEY101);
- // EmEarth->CalculateWireAntennaFields();
- // Vector3Xcr Rx1 = receivers->GetHfield(0);
- // //receivers->ClearFields();
- //
- // //EmEarth->AttachWireAntenna(Tx2);
- // EmEarth->CalculateWireAntennaFields();
- // Rx1 += receivers->GetHfield(0);
-
- }
-
- }
-
- void KernelV0::CalculateK0 ( const char* tx, const char* rx ) {
-
- }
-
- } // ---- end of namespace Lemma ----
-
- /* vim: set tabstop=4 expandtab: */
- /* vim: set filetype=cpp: */
|