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 ExactSolutionPLS_PHI<2>::value(const Point<2>& r, unsigned int component) const
24 {
25  return (cos(k * r[0]) + cos(k * r[1]));
26 }
27 
28 template<>
29 Tensor<1, 2>
30 ExactSolutionPLS_PHI<2>::gradient(const Point<2>& r,
31  unsigned int component) const
32 {
33  Tensor<1, 2> p;
34 
35  p[0] = -k * sin(k * r[0]);
36  p[1] = -k * sin(k * r[1]);
37 
38  return p;
39 }
40 
41 template<>
42 double
43 ExactSolutionPLS_PHI<3>::value(const Point<3>& r, unsigned int componet) const
44 {
45  return (cos(k * r[0]) + cos(k * r[1]) + cos(k * r[2]));
46 }
47 
48 template<>
49 Tensor<1, 3>
50 ExactSolutionPLS_PHI<3>::gradient(const Point<3>& r,
51  unsigned int component) const
52 {
53  Tensor<1, 3> p;
54 
55  p[0] = -k * sin(k * r[0]);
56  p[1] = -k * sin(k * r[1]);
57  p[2] = -k * sin(k * r[2]);
58 
59  return p;
60 }
61 
62 #pragma GCC diagnostic pop
Describes the exact solution, , of the Planes of symmetry (pls/) numerical experiment in two and thre...