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 using namespace std;
19 
20 void
21 ExactSolutionSSOLIIIAXI_B::vector_value_list(
22  const std::vector<Point<2>>& r,
23  std::vector<Vector<double>>& values) const
24 {
25  Assert(values.size() == r.size(),
26  ExcDimensionMismatch(values.size(), r.size()));
27 
28  Tensor<1, 3> B;
29 
30  for (unsigned int i = 0; i < values.size(); i++) {
31  B = magnetic_field_coil(0.0, r[i][0], r[i][1], K_0, mu_0, a2, b2) +
32  magnetic_field_core(0.0, r[i][0], r[i][1], H_0, mu_r, mu_0, a1, b1);
33 
34  values[i][0] = r[i][0] * B[1];
35  values[i][1] = r[i][0] * B[2];
36  }
37 }
38 
39 void
40 ExactSolutionSSOLIIIAXI_H::vector_value_list(
41  const std::vector<Point<2>>& r,
42  std::vector<Vector<double>>& values) const
43 {
44  Assert(values.size() == r.size(),
45  ExcDimensionMismatch(values.size(), r.size()));
46 
47  B.vector_value_list(r, values);
48 
49  double coef;
50 
51  for (unsigned int i = 0; i < r.size(); i++) {
52  if ((r[i].norm() > a1) && (r[i].norm() < b1)) {
53  coef = mu;
54  } else {
55  coef = mu_0;
56  }
57 
58  values[i][0] = values[i][0] / coef;
59  values[i][1] = values[i][1] / coef;
60  }
61 }
62 
63 #pragma GCC diagnostic pop