12 #include "exact_solution.hpp"
14 #pragma GCC diagnostic push
15 #pragma GCC diagnostic ignored "-Wunused-parameter"
17 using namespace dealii;
21 ExactSolutionSSOLIAXI_A::value(
const Point<2>& p,
22 const unsigned int component)
const
26 double M = mu_0 * K_0 * a * pow(r, 2) / 3.0;
31 return M * pow(a, 3) / pow(s, 3);
36 ExactSolutionSSOLIAXI_A::gradient(
const Point<2>& p,
37 const unsigned int component)
const
43 double M1 = mu_0 * K_0 * a / 3.0;
44 double M2 = M1 * pow(a, 3);
49 grad_A(0) = 2.0 * M1 * r;
52 grad_A(0) = M2 * (2.0 * r / pow(s, 3) - 3.0 * pow(r, 3) / pow(s, 5));
53 grad_A(1) = -M2 * (3.0 * z * pow(r, 2) / pow(s, 5));
60 ExactSolutionSSOLIAXI_B::vector_value_list(
61 const std::vector<Point<2>>& r,
62 std::vector<Vector<double>>& values)
const
71 Tensor<1, 3> theta_hat;
75 auto v = values.begin();
77 Point<3> p(0.0, pp(0), pp(1));
79 cos_theta = p(2) / p.norm();
80 sin_theta = sqrt(pow(p(0), 2) + pow(p(1), 2)) / p.norm();
82 cos_phi = p(0) / sqrt(pow(p(0), 2) + pow(p(1), 2));
83 sin_phi = p(1) / sqrt(pow(p(0), 2) + pow(p(1), 2));
85 r_hat[0] = p(0) / p.norm();
86 r_hat[1] = p(1) / p.norm();
87 r_hat[2] = p(2) / p.norm();
89 theta_hat[0] = cos_theta * cos_phi;
90 theta_hat[1] = cos_theta * sin_phi;
91 theta_hat[2] = -sin_theta;
94 B = B_0 * a * (cos_theta * r_hat - sin_theta * theta_hat);
96 B = B_0 * (pow(a, 4) / pow(p.norm(), 3)) *
97 (cos_theta * r_hat + 0.5 * sin_theta * theta_hat);
100 (*v)[0] = pp[0] * B[1];
101 (*v)[1] = pp[0] * B[2];
107 #pragma GCC diagnostic pop