12 #include "exact_solution.hpp"
15 #pragma GCC diagnostic push
16 #pragma GCC diagnostic ignored "-Wunused-parameter"
17 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
19 using namespace dealii;
21 ExactSolutionSSOLI_B::ExactSolutionSSOLI_B()
23 , B_0(2.0 * mu_0 * K_0 / 3.0)
28 ExactSolutionSSOLI_B::vector_value_list(
29 const std::vector<Point<3>>& r,
30 std::vector<Vector<double>>& values)
const
32 Assert(values.size() == r.size(),
33 ExcDimensionMismatch(values.size(), r.size()));
42 Tensor<1, 3> theta_hat;
46 auto v = values.begin();
48 cos_theta = p(2) / p.norm();
49 sin_theta = sqrt(pow(p(0), 2) + pow(p(1), 2)) / p.norm();
51 cos_phi = p(0) / sqrt(pow(p(0), 2) + pow(p(1), 2));
52 sin_phi = p(1) / sqrt(pow(p(0), 2) + pow(p(1), 2));
54 r_hat[0] = p(0) / p.norm();
55 r_hat[1] = p(1) / p.norm();
56 r_hat[2] = p(2) / p.norm();
58 theta_hat[0] = cos_theta * cos_phi;
59 theta_hat[1] = cos_theta * sin_phi;
60 theta_hat[2] = -sin_theta;
63 B = B_0 *
a * (cos_theta * r_hat - sin_theta * theta_hat);
65 B = B_0 * (pow(
a, 4) / pow(p.norm(), 3)) *
66 (cos_theta * r_hat + 0.5 * sin_theta * theta_hat);
77 #pragma GCC diagnostic pop
const double a
The radius of the coil.