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 #include <cmath>
14 
15 #pragma GCC diagnostic push
16 #pragma GCC diagnostic ignored "-Wunused-parameter"
17 
18 using namespace dealii;
19 using namespace std;
20 
21 template<>
22 double
23 ExactSolutionSCHAXI_PHI<true>::value(const Point<2>& p,
24  const unsigned int component) const
25 {
26  Point<2> r;
27  r[0] = p[0];
28  r[1] = 0.0;
29 
30  if (r.norm() > a) {
31  return (log(b) - log(sqrt(r.square()))) / (log(b) - log(a));
32  }
33 
34  return 1.0;
35 }
36 
37 template<>
38 Tensor<1, 2>
40  const unsigned int component) const
41 {
42  Point<2> r;
43  r[0] = p[0];
44  r[1] = 0.0;
45 
46  if (r.norm() > a) {
47  return -1.0 / (log(b) - log(a)) * r / r.square();
48  }
49 
50  return Point<2>();
51 }
52 
53 template<>
54 double
56  const unsigned int component) const
57 {
58  Point<2> r;
59  r[0] = p[0];
60  r[1] = p[1];
61 
62  if (r.norm() > a) {
63  return (a * b / (b - a)) * (1 / sqrt(r.square()) - 1 / b);
64  }
65 
66  return 1.0;
67 }
68 
69 template<>
70 Tensor<1, 2>
72  const unsigned int component) const
73 {
74  Point<2> r;
75  r[0] = p[0];
76  r[1] = p[1];
77 
78  if (r.norm() > a) {
79  return -a * b / (b - a) * r / pow(sqrt(r.square()), 3);
80  }
81 
82  return Point<2>();
83 }
84 
85 #pragma GCC diagnostic pop
Describes exact solution, , of the Axisymmetric - surface charge (sch-axi/) numerical experiment.