Logbook  (07-04-2025)
Static problems
exact_solution.hpp
1 /******************************************************************************
2  * Copyright (C) Siarhei Uzunbajakau, 2023.
3  *
4  * This program is free software. You can use, modify, and redistribute it under
5  * the terms of the GNU Lesser General Public License as published by the Free
6  * Software Foundation, either version 3 or (at your option) any later version.
7  * This program is distributed without any warranty.
8  *
9  * Refer to COPYING.LESSER for more details.
10  ******************************************************************************/
11 
12 #ifndef ExactSolutionsMMSVTII_H__
13 #define ExactSolutionsMMSVTII_H__
14 
15 #include "constants.hpp"
16 #include "settings.hpp"
17 #include <deal.II/base/function.h>
18 #include <deal.II/lac/vector.h>
19 
20 #include <cmath>
21 
22 using namespace dealii;
23 
24 inline double
25 permeability(double x, double y, double mu_0)
26 {
27  return mu_0 * (pow(x, 2) + pow(y, 2) + 1.0);
28 }
29 
30 inline double
31 robin_gamma(double x, double y, double mu_0)
32 {
33  return (sqrt(pow(x, 2) + pow(y, 2)) + 2.0) / permeability(x, y, mu_0);
34 }
35 
36 inline Tensor<1, 2>
37 volume_free_current_density(double x, double y, double mu_0, double k)
38 {
39  Tensor<1, 2> J;
40  const double mu = permeability(x, y, mu_0);
41 
42  J[0] = (1.0 / mu) * ((mu_0 / mu) * (-2.0 * y * (cos(k * x) + cos(k * y))) -
43  k * sin(k * y));
44  J[1] = -(1.0 / mu) * ((mu_0 / mu) * (-2.0 * x * (cos(k * x) + cos(k * y))) -
45  k * sin(k * x));
46 
47  return J;
48 }
49 
50 inline Tensor<1, 2>
51 magnetic_vector_potential(double x, double y, double k)
52 {
53  Tensor<1, 2> A;
54 
55  A[0] = -sin(k * y) / k;
56  A[1] = sin(k * x) / k;
57 
58  return A;
59 }
60 
61 inline double
62 magnetic_field(double x, double y, double k)
63 {
64  return (cos(k * x) + cos(k * y));
65 }
66 
67 inline double
68 current_vector_potential(double x, double y, double mu_0, double k)
69 {
70  double T;
71  const double mu = permeability(x, y, mu_0);
72  const double B = magnetic_field(x, y, k);
73 
74  T = B / mu;
75 
76  return T;
77 }
78 
85  : public Function<2>
86  , public SettingsMMSVTII
87 {
88 public:
90 
91  virtual double value(const Point<2>& r,
92  const unsigned int component = 0) const override final;
93 
94  virtual Tensor<1, 2> gradient(
95  const Point<2>& r,
96  const unsigned int component = 0) const override final;
97 };
98 
105  : public Function<2>
106  , public SettingsMMSVTII
107 {
108 public:
110  : Function<2>(2)
111  {
112  }
113 
114  virtual void vector_value_list(
115  const std::vector<Point<2>>& r,
116  std::vector<Vector<double>>& values) const override final;
117 };
118 
125  : public Function<2>
126  , public SettingsMMSVTII
127 {
128 public:
130 
131  virtual void value_list(const std::vector<Point<2>>& r,
132  std::vector<double>& values,
133  const unsigned int component) const override final;
134 };
135 
142  : public Function<2>
143  , public SettingsMMSVTII
144 {
145 public:
147 
148  virtual void value_list(const std::vector<Point<2>>& r,
149  std::vector<double>& values,
150  const unsigned int component) const override final;
151 };
152 
159  : public Function<2>
160  , public SettingsMMSVTII
161 {
162 public:
164  : Function<2>(2)
165  {
166  }
167 
168  virtual void vector_value_list(
169  const std::vector<Point<2>>& r,
170  std::vector<Vector<double>>& values) const override final;
171 };
172 
173 #endif
Describes the Dirichlet boundary condition for , in the Method of manufactured solutions,...
Describes the Dirichlet boundary condition for , in the Method of manufactured solutions,...
Describes exact solution, , of the Method of manufactured solutions, vector potential (mms-vt-ii/) nu...
Describes exact solution, , of the Method of manufactured solutions, vector potential (mms-vt-ii/) nu...
Describes exact solution, , of the Method of manufactured solutions, vector potential (mms-vt-ii/) nu...
Global settings for the Method of manufactured solutions, vector potential (mms-vt-ii/) numerical exp...
Definition: settings.hpp:26