Logbook  (07-04-2025)
Static problems
exact_solution.hpp
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 #ifndef ExactSolutionsSLDII_H__
13 #define ExactSolutionsSLDII_H__
14 
15 #include <deal.II/base/function.h>
16 #include <deal.II/base/point.h>
17 #include <deal.II/base/tensor.h>
18 
19 #include <deal.II/lac/vector.h>
20 
21 #include <cmath>
22 
23 #include "constants.hpp"
24 #include "settings.hpp"
25 
26 using namespace dealii;
27 
33 template<int dim>
35  : public Function<dim>
36  , public SettingsSLDII
37 {
38 public:
40 
41  virtual double value(const Point<dim>& r,
42  const unsigned int component = 0) const override final;
43 
44  virtual Tensor<1, dim> gradient(
45  const Point<dim>& r,
46  const unsigned int component = 0) const override final;
47 
48 private:
49  double OMEGA, alpha_1, beta_1, gamma_1, delta_1;
50 };
51 
57 template<int dim>
59  : public Function<dim>
60  , public SettingsSLDII
61 {
62 public:
64  : Function<dim>(dim)
65  {
66  }
67 
68  virtual void vector_value_list(
69  const std::vector<Point<dim>>& r,
70  std::vector<Vector<double>>& values) const final;
71 
72 private:
74 };
75 
76 template<int dim>
77 void
79  const std::vector<Point<dim>>& r,
80  std::vector<Vector<double>>& values) const
81 {
82  Assert(values.size() == r.size(),
83  ExcDimensionMismatch(values.size(), r.size()));
84 
85  Tensor<1, dim> grad;
86 
87  for (unsigned int i = 0; i < r.size(); i++) {
88  grad = theta.gradient(r[i]);
89 
90  for (unsigned int j = 0; j < dim; j++)
91  values[i][j] = -grad[j];
92  }
93 }
94 
95 #endif
Describes exact solution, , of the Magnetostatic shield - 2 (sld-ii/) numerical experiment in two and...
Describes exact solution, , of the Magnetostatic shield - 2 (sld-ii/) numerical experiment in two and...
Global settings for the Magnetostatic shield - 2 (sld-ii/) numerical experiment.
Definition: settings.hpp:32