/* 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 02:44:37 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 using namespace Lemma; std::shared_ptr CircularLoop ( int nd, Real radius, Real Offsetx, Real Offsety ) ; int main() { auto earth = LayeredEarthEM::NewSP(); earth->SetNumberOfLayers(3); earth->SetLayerConductivity( (VectorXcr(3) << Complex(0.,0), Complex(1./50.,0), Complex(1./100.)).finished() ); earth->SetLayerThickness( (VectorXr(1) << 10).finished() ); // Transmitter loops auto Tx1 = CircularLoop(60, 15, 100, 100); auto Tx2 = CircularLoop(60, 15, 100, 120); //auto Tx1 = CircularLoop(60, 15, 0, 0); // was 60 auto Kern = KernelV0::NewSP(); Kern->PushCoil( "Coil 1", Tx1 ); Kern->PushCoil( "Coil 2", Tx2 ); Kern->SetLayeredEarthEM( earth ); // std::cout << *Kern << std::endl; // We could, I suppose, take the earth model in here? For non-linear that // may be more natural to work with? std::vector tx = {std::string("Coil 1")}; std::vector rx = {std::string("Coil 2")}; Kern->CalculateK0( tx, rx , true ); //, false ); //Kern->CalculateK0( "Coil 1", "Coil 1" ); } std::shared_ptr CircularLoop ( int nd, Real Radius, Real Offsetx, Real Offsety ) { auto Tx1 = Lemma::PolygonalWireAntenna::NewSP(); Tx1->SetNumberOfPoints(nd); VectorXr range = VectorXr::LinSpaced(nd, 0, 2*PI); int ii; for (ii=0; iiSetPoint(ii, Vector3r(Offsetx+Radius*std::cos(range(ii)), Offsety+Radius*std::sin(range(ii)), -1e-3)); } Tx1->SetPoint(ii, Vector3r(Offsetx+Radius*1, Offsety, -1e-3)); Tx1->SetCurrent(1.); Tx1->SetNumberOfTurns(1); Tx1->SetNumberOfFrequencies(1); Tx1->SetFrequency(0,2500); return Tx1; }