Galerkin FEM for elliptic PDEs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Sphere.cpp 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 03/21/2016 09:59:10 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2016, University of Utah
  15. * @copyright Copyright (c) 2016, Trevor Irons & Lemma Software, LLC
  16. */
  17. #include "LemmaCore"
  18. #include "LinearMag.h"
  19. using namespace Lemma;
  20. int main( int argc, char** argv ) {
  21. std::cout << "###################################################\n";
  22. std::cout << "# Example of LinearMag class #\n";
  23. std::cout << "# #\n";
  24. std::cout << "# This program solves for the secondary magnetic #\n";
  25. std::cout << "# field from a low susceptibily model in the #\n";
  26. std::cout << "# presence of a homogeneous static inducing field #\n";
  27. std::cout << "# #\n";
  28. std::cout << "# (C) University of Utah, 2016 #\n";
  29. std::cout << "# #\n";
  30. std::cout << "###################################################\n\n";
  31. if (argc < 3) {
  32. std::cout << "\e[1museage\e[0m:\n";
  33. std::cout << "./Sphere in.vtu out.vtu\n\n" << std::endl;
  34. exit(EXIT_SUCCESS);
  35. }
  36. auto Mag = LinearMag::NewSP();
  37. Mag->SetInducingMagField( 55234., 0, 0, NANOTESLA );
  38. Mag->SetVTUGridFile( argv[1] );
  39. Mag->CalculateRHS( "kappa" );
  40. Mag->Solve( argv[2] );
  41. // Print out YAML serialization of class
  42. std::cout << *Mag << std::endl;
  43. exit(EXIT_SUCCESS);
  44. }