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 ExactSolutionsMMSVTI_H__
13 #define ExactSolutionsMMSVTI_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, 3>
37 volume_free_current_density(double x, double y, double mu_0, double k)
38 {
39  Tensor<1, 3> J;
40  const double mu = permeability(x, y, mu_0);
41 
42  J[0] = (1 / mu) *
43  ((mu_0 / mu) * (-2 * y * (cos(k * x) + cos(k * y))) - k * sin(k * y));
44  J[1] = -(1 / mu) *
45  ((mu_0 / mu) * (-2 * x * (cos(k * x) + cos(k * y))) - k * sin(k * x));
46  J[2] = 0.0;
47 
48  return J;
49 }
50 
51 inline Tensor<1, 3>
52 current_vector_potential(double x, double y, double mu_0, double k)
53 {
54  Tensor<1, 3> T;
55  const double mu = permeability(x, y, mu_0);
56 
57  T[0] = 0.0;
58  T[1] = 0.0;
59  T[2] = (cos(k * x) + cos(k * y)) / mu;
60 
61  return T;
62 }
63 
64 inline Tensor<1, 3>
65 magnetic_vector_potential(double x, double y, double k)
66 {
67  Tensor<1, 3> A;
68 
69  A[0] = -sin(k * y) / k;
70  A[1] = sin(k * x) / k;
71  A[2] = 0.0;
72 
73  return A;
74 }
75 
76 inline Tensor<1, 3>
77 magnetic_field(double x, double y, double k)
78 {
79  Tensor<1, 3> B;
80 
81  B[0] = 0.0;
82  B[1] = 0.0;
83  B[2] = (cos(k * x) + cos(k * y));
84 
85  return B;
86 }
87 
94  : public Function<3>
95  , public SettingsMMSVTI
96 {
97 public:
99 
100  virtual void vector_value_list(
101  const std::vector<Point<3>>& r,
102  std::vector<Vector<double>>& values) const override final;
103 };
104 
111  : public Function<3>
112  , public SettingsMMSVTI
113 {
114 public:
116 
117  virtual void vector_value_list(
118  const std::vector<Point<3>>& r,
119  std::vector<Vector<double>>& values) const override final;
120 };
121 
128  : public Function<3>
129  , public SettingsMMSVTI
130 {
131 public:
133 
134  virtual void vector_value_list(
135  const std::vector<Point<3>>& r,
136  std::vector<Vector<double>>& values) const override final;
137 };
138 
145  : public Function<3>
146  , public SettingsMMSVTI
147 {
148 public:
150 
151  virtual void vector_value_list(
152  const std::vector<Point<3>>& r,
153  std::vector<Vector<double>>& values) const override final;
154 };
155 
156 #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-i/) num...
Describes exact solution, , of the Method of manufactured solutions, vector potential (mms-vt-i/) num...
Global settings for the Method of manufactured solutions, vector potential (mms-vt-i/) numerical expe...
Definition: settings.hpp:26