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 ExactSolutionCVPI_Jf::ExactSolutionCVPI_Jf()
20  : Function<3>(3)
21 {
22 }
23 
24 void
25 ExactSolutionCVPI_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  auto v = values.begin();
33  for (auto p : r) {
34  if ((p.norm() > SettingsCVPI::a) && (p.norm() < SettingsCVPI::b)) {
35  (*v)[0] = -p[1];
36  (*v)[1] = p[0];
37  (*v)[2] = 0.0;
38  } else {
39  (*v)[0] = 0.0;
40  (*v)[1] = 0.0;
41  (*v)[2] = 0.0;
42  }
43  v++;
44  }
45 }
46 
47 DirichletBC_CVPI::DirichletBC_CVPI()
48  : Function<3>(3)
49 {
50 }
51 
52 void
53 DirichletBC_CVPI::vector_value_list(const std::vector<Point<3>>& r,
54  std::vector<Vector<double>>& values) const
55 {
56  Assert(values.size() == r.size(),
57  ExcDimensionMismatch(values.size(), r.size()));
58 
59  for (unsigned int i = 0; i < values.size(); i++) {
60  values[i][0] = 0.0;
61  values[i][1] = 0.0;
62  values[i][2] = 0.0;
63  }
64 }
const double a
The inner radius of the coil.
Definition: settings.hpp:50
const double b
The outer radius of the coil.
Definition: settings.hpp:55