Galerkin FEM for elliptic PDEs
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

Sphere.cpp 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "Lemma"
  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. LinearMag* Mag = LinearMag::New();
  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. Mag->Delete();
  44. exit(EXIT_SUCCESS);
  45. }