Galerkin FEM for elliptic PDEs
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

Sphere.cpp 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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\n";
  28. if (argc < 3) {
  29. std::cout << "\e[1museage\e[0m:\n";
  30. std::cout << "./Sphere in.vtu out.vtu\n\n" << std::endl;
  31. exit(EXIT_SUCCESS);
  32. }
  33. LinearMag* Mag = LinearMag::New();
  34. Mag->SetInducingMagField( 55234., 60, 14, NANOTESLA );
  35. Mag->SetVTUGridFile( argv[1] );
  36. Mag->CalculateRHS( "kappa" );
  37. Mag->Solve( argv[2] );
  38. // Print out YAML serialization of class
  39. std::cout << *Mag << std::endl;
  40. Mag->Delete();
  41. exit(EXIT_SUCCESS);
  42. }