Galerkin FEM for elliptic PDEs
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

LinearMag.h 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 01:39:32 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, Lemma Software, LLC
  16. */
  17. #ifndef LINEARMAG_INC
  18. #define LINEARMAG_INC
  19. #include <vtkCellIterator.h>
  20. #include "FEM4EllipticPDE.h"
  21. namespace Lemma {
  22. /** \addtogroup FEM4EllipticPDE
  23. @{
  24. */
  25. /**
  26. \brief Provides modelling of linear magnetic media
  27. \details This class solves the problem
  28. \f{equation}{
  29. \nabla^2 u(\mathbf{r}) = \nabla \cdot \kappa(\mathbf{r}) \mathbf{H}_0,
  30. \f}
  31. where \f$ \mathbf{H}_0\f$ is the static <B>homogeneous</B> inducing field, \f$ \kappa \f$
  32. is the <B>isotropic</B> magnetic suceptibility. The secondary field can be calculated
  33. \f$ \mathbf{H} = -\nabla \cdot u \f$
  34. */
  35. class LinearMag : public FEM4EllipticPDE {
  36. friend std::ostream &operator << (std::ostream &stream, const LinearMag &ob);
  37. public:
  38. // ==================== LIFECYCLE =======================
  39. /**
  40. * @copybrief LemmaObject::NewSP()
  41. * @copydetails LemmaObject::NewSP()
  42. */
  43. static std::shared_ptr<LinearMag> NewSP();
  44. /** Default protected constructor, use New */
  45. LinearMag (const ctor_key& key);
  46. /** Protected DeDerializing constructor, use factory DeSerialize method*/
  47. LinearMag (const YAML::Node& node, const ctor_key& key);
  48. /** Default protected destructor, use Delete */
  49. ~LinearMag ();
  50. /**
  51. * Uses YAML to serialize this object.
  52. * @return a YAML::Node
  53. */
  54. YAML::Node Serialize() const;
  55. /**
  56. * Constructs an object from a YAML::Node.
  57. */
  58. static std::shared_ptr<LinearMag> DeSerialize(const YAML::Node& node);
  59. // ==================== OPERATORS =======================
  60. // ==================== OPERATIONS =======================
  61. // ==================== ACCESS =======================
  62. /**
  63. * @param[in] B0 is the incident magnetic (-induction) field
  64. * @param[in] U is a MAGUNITS enum specifying the units of measurement
  65. */
  66. void SetInducingMagFieldVector( const Vector3r& B0, const MAGUNITS& U );
  67. /**
  68. * @param[in] intensity is the incident magnetic (-induction) field intensity
  69. * @param[in] inc is the incident magnetic (-induction) field inclination in degrees
  70. * @param[in] dec is the incident magnetic (-induction) field declination in degrees
  71. * @param[in] U is a MAGUNITS enum specifying the units of intensity
  72. */
  73. void SetInducingMagField( const Real& intensity, const Real& inclination,
  74. const Real& declination, const MAGUNITS& U );
  75. /**
  76. * Calculates the right hand side of the equation
  77. * \f$ \nabla \cdot \kappa \mathbf{H}_0 \f$
  78. */
  79. void CalculateRHS( const std::string& susName );
  80. // ==================== INQUIRY =======================
  81. /** Returns the name of the underlying class, similiar to Python's type */
  82. virtual std::string GetName() const { return this->CName; }
  83. protected:
  84. // ==================== LIFECYCLE =======================
  85. private:
  86. // ==================== DATA MEMBERS =========================
  87. Vector3r B0;
  88. /**
  89. * Used internally to scale mag units into Tesla
  90. */
  91. void ScaleB0 ( const MAGUNITS& U);
  92. static constexpr auto CName = "LinearMag";
  93. }; // ----- end of class LinearMag -----
  94. /*! @} */ // End of group
  95. } // ----- end of Lemma name -----
  96. #endif // ----- #ifndef LINEARMAG_INC -----