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 template<>
21 double
22 ExactSolutionCBND_PHI<2>::value(const Point<2>& r,
23  const unsigned int component) const
24 {
25  return (log(b) - log(r.norm())) / (log(b) - log(a));
26 }
27 
28 template<>
29 Tensor<1, 2>
30 ExactSolutionCBND_PHI<2>::gradient(const Point<2>& r,
31  const unsigned int component) const
32 {
33  return -1.0 / (log(b) - log(a)) * r / r.square();
34 }
35 
36 template<>
37 double
38 ExactSolutionCBND_PHI<3>::value(const Point<3>& r,
39  const unsigned int component) const
40 {
41  return (a * b / (b - a)) * (1 / r.norm() - 1 / b);
42 }
43 
44 template<>
45 Tensor<1, 3>
46 ExactSolutionCBND_PHI<3>::gradient(const Point<3>& r,
47  const unsigned int component) const
48 {
49  return -a * b / (b - a) * r / pow(r.norm(), 3);
50 }
51 
52 #pragma GCC diagnostic pop
Describes exact solution, , of the Effect of curved boundaries (cbnd/) numerical experiment.