Logbook  (07-04-2025)
Static problems
exact_solution.cpp
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 #include "exact_solution.hpp"
13 
14 #pragma GCC diagnostic push
15 #pragma GCC diagnostic ignored "-Wunused-parameter"
16 
17 using namespace dealii;
18 
19 ExactSolutionSSOLIII_Jf::ExactSolutionSSOLIII_Jf()
20  : Function<3>(3)
21 {
22 }
23 
24 void
25 ExactSolutionSSOLIII_Jf::vector_value_list(
26  const std::vector<Point<3>>& r,
27  std::vector<Vector<double>>& values) const
28 {
29  Assert(values.size() == r.size(),
30  ExcDimensionMismatch(values.size(), r.size()));
31 
32  Tensor<1, 3> Jf;
33 
34  for (unsigned int i = 0; i < values.size(); i++) {
35  Jf = volume_free_current_density(r[i][0], r[i][1], r[i][2], K_0, a2, b2);
36 
37  values[i][0] = Jf[0];
38  values[i][1] = Jf[1];
39  values[i][2] = Jf[2];
40  }
41 }
42 
43 ExactSolutionSSOLIII_B::ExactSolutionSSOLIII_B()
44  : Function<3>(3)
45 {
46 }
47 
48 void
49 ExactSolutionSSOLIII_B::vector_value_list(
50  const std::vector<Point<3>>& r,
51  std::vector<Vector<double>>& values) const
52 {
53  Assert(values.size() == r.size(),
54  ExcDimensionMismatch(values.size(), r.size()));
55 
56  Tensor<1, 3> B;
57 
58  for (unsigned int i = 0; i < values.size(); i++) {
59  B = magnetic_field_coil(r[i][0], r[i][1], r[i][2], K_0, mu_0, a2, b2) +
60  magnetic_field_core(r[i][0], r[i][1], r[i][2], H_0, mu_r, mu_0, a1, b1);
61 
62  values[i][0] = B[0];
63  values[i][1] = B[1];
64  values[i][2] = B[2];
65  }
66 }
const double mu_0
The permeability of free space.
Definition: settings.hpp:39
const double mu_r
The relative permeability of the material of the magnetic core.
Definition: settings.hpp:44
const double a1
The inner radius of the magnetic core.
Definition: settings.hpp:65
const double a2
The inner radius of the coil.
Definition: settings.hpp:75
const double H_0
The magnitude of the H-field induced by the coil at its center in absence of the magnetic core.
Definition: settings.hpp:103
const double b2
The outer radius of the coil.
Definition: settings.hpp:80
const double b1
The outer radius of the magnetic core.
Definition: settings.hpp:70
const double K_0
A constant that defines the magnitude of the surface free-current density.
Definition: settings.hpp:97