/* 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::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& 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: */