35 , aux_gradients(dim + 1)
54 const unsigned int n_points = points.size();
55 Assert(values.size() == n_points,
60 std::lock_guard<std::mutex> lock(mutex);
62 for (
unsigned int d = 0; d < dim + 1; ++d)
63 aux_values[d].resize(n_points);
64 vector_values(points, aux_values);
66 for (
unsigned int k = 0; k < n_points; ++k)
68 Assert(values[k].size() == dim + 1,
70 for (
unsigned int d = 0; d < dim + 1; ++d)
71 values[k](d) = aux_values[d][k];
81 Assert(value.size() == dim + 1,
84 const unsigned int n_points = 1;
85 std::vector<Point<dim>> points(1);
90 std::lock_guard<std::mutex> lock(mutex);
92 for (
unsigned int d = 0; d < dim + 1; ++d)
93 aux_values[d].resize(n_points);
94 vector_values(points, aux_values);
96 for (
unsigned int d = 0; d < dim + 1; ++d)
97 value(d) = aux_values[d][0];
104 const unsigned int comp)
const
107 const unsigned int n_points = 1;
108 std::vector<Point<dim>> points(1);
113 std::lock_guard<std::mutex> lock(mutex);
115 for (
unsigned int d = 0; d < dim + 1; ++d)
116 aux_values[d].resize(n_points);
117 vector_values(points, aux_values);
119 return aux_values[comp][0];
129 const unsigned int n_points = points.size();
130 Assert(values.size() == n_points,
135 std::lock_guard<std::mutex> lock(mutex);
137 for (
unsigned int d = 0; d < dim + 1; ++d)
138 aux_gradients[d].resize(n_points);
139 vector_gradients(points, aux_gradients);
141 for (
unsigned int k = 0; k < n_points; ++k)
143 Assert(values[k].size() == dim + 1,
145 for (
unsigned int d = 0; d < dim + 1; ++d)
146 values[k][d] = aux_gradients[d][k];
157 const unsigned int n_points = points.size();
158 Assert(values.size() == n_points,
163 std::lock_guard<std::mutex> lock(mutex);
165 for (
unsigned int d = 0; d < dim + 1; ++d)
166 aux_values[d].resize(n_points);
167 vector_laplacians(points, aux_values);
169 for (
unsigned int k = 0; k < n_points; ++k)
171 Assert(values[k].size() == dim + 1,
173 for (
unsigned int d = 0; d < dim + 1; ++d)
174 values[k](d) = aux_values[d][k];
192 : inv_sqr_radius(1 / r / r)
204 std::vector<std::vector<double>> &values)
const
206 const unsigned int n = points.size();
208 Assert(values.size() == dim + 1,
210 for (
unsigned int d = 0; d < dim + 1; ++d)
213 for (
unsigned int k = 0; k < n; ++k)
219 for (
unsigned int d = 1; d < dim; ++d)
221 r2 *= inv_sqr_radius;
224 values[0][k] = 1. - r2;
226 for (
unsigned int d = 1; d < dim; ++d)
229 values[dim][k] = -2 * (dim - 1) * inv_sqr_radius * p(0) / Reynolds +
242 const unsigned int n = points.size();
244 Assert(values.size() == dim + 1,
246 for (
unsigned int d = 0; d < dim + 1; ++d)
249 for (
unsigned int k = 0; k < n; ++k)
253 values[0][k][0] = 0.;
254 for (
unsigned int d = 1; d < dim; ++d)
255 values[0][k][d] = -2. * p(d) * inv_sqr_radius;
257 for (
unsigned int d = 1; d < dim; ++d)
260 values[dim][k][0] = -2 * (dim - 1) * inv_sqr_radius / Reynolds;
261 for (
unsigned int d = 1; d < dim; ++d)
262 values[dim][k][d] = 0.;
272 std::vector<std::vector<double>> &values)
const
274 const unsigned int n = points.size();
276 Assert(values.size() == dim + 1,
278 for (
unsigned int d = 0; d < dim + 1; ++d)
281 for (
auto &point_values : values)
282 std::fill(point_values.begin(), point_values.end(), 0.);
308 std::vector<std::vector<double>> &values)
const
310 unsigned int n = points.size();
312 Assert(values.size() == dim + 1,
314 for (
unsigned int d = 0; d < dim + 1; ++d)
317 for (
unsigned int k = 0; k < n; ++k)
329 values[0][k] = cx * cx * cy * sy;
330 values[1][k] = -cx * sx * cy * cy;
331 values[2][k] = cx * sx * cy * sy + this->mean_pressure;
339 values[0][k] = cx * cx * cy * sy * cz * sz;
340 values[1][k] = cx * sx * cy * cy * cz * sz;
341 values[2][k] = -2. * cx * sx * cy * sy * cz * cz;
342 values[3][k] = cx * sx * cy * sy * cz * sz + this->mean_pressure;
359 unsigned int n = points.size();
361 Assert(values.size() == dim + 1,
363 for (
unsigned int d = 0; d < dim + 1; ++d)
366 for (
unsigned int k = 0; k < n; ++k)
375 const double cx2 = .5 + .5 * c2x;
376 const double cy2 = .5 + .5 * c2y;
392 const double cz2 = .5 + .5 * c2z;
394 values[0][k][0] = -.125 *
numbers::PI * s2x * s2y * s2z;
395 values[0][k][1] = .25 *
numbers::PI * cx2 * c2y * s2z;
396 values[0][k][2] = .25 *
numbers::PI * cx2 * s2y * c2z;
398 values[1][k][0] = .25 *
numbers::PI * c2x * cy2 * s2z;
399 values[1][k][1] = -.125 *
numbers::PI * s2x * s2y * s2z;
400 values[1][k][2] = .25 *
numbers::PI * s2x * cy2 * c2z;
402 values[2][k][0] = -.5 *
numbers::PI * c2x * s2y * cz2;
403 values[2][k][1] = -.5 *
numbers::PI * s2x * c2y * cz2;
404 values[2][k][2] = .25 *
numbers::PI * s2x * s2y * s2z;
406 values[3][k][0] = .125 *
numbers::PI * c2x * s2y * s2z;
407 values[3][k][1] = .125 *
numbers::PI * s2x * c2y * s2z;
408 values[3][k][2] = .125 *
numbers::PI * s2x * s2y * c2z;
423 std::vector<std::vector<double>> &values)
const
425 unsigned int n = points.size();
427 Assert(values.size() == dim + 1,
429 for (
unsigned int d = 0; d < dim + 1; ++d)
434 vector_values(points, values);
435 for (
unsigned int d = 0; d < dim; ++d)
436 for (
double &point_value : values[d])
437 point_value *= -reaction;
441 for (
unsigned int d = 0; d < dim; ++d)
442 std::fill(values[d].begin(), values[d].end(), 0.);
446 for (
unsigned int k = 0; k < n; ++k)
459 values[0][k] += -viscosity * pi2 * (1. + 2. * c2x) * s2y -
461 values[1][k] += viscosity * pi2 * s2x * (1. + 2. * c2y) -
472 -.5 * viscosity * pi2 * (1. + 2. * c2x) * s2y * s2z -
474 values[1][k] += .5 * viscosity * pi2 * s2x * (1. + 2. * c2y) * s2z -
477 -.5 * viscosity * pi2 * s2x * s2y * (1. + 2. * c2z) -
495 , coslo(
std::cos(lambda * omega))
547 const std::vector<
Point<2>> & points,
548 std::vector<std::vector<double>> &values)
const
550 unsigned int n = points.size();
553 for (
unsigned int d = 0; d < 2 + 1; ++d)
556 for (
unsigned int k = 0; k < n; ++k)
559 const double x = p(0);
560 const double y = p(1);
562 if ((x < 0) || (y < 0))
564 const double phi = std::atan2(y, -x) +
numbers::PI;
565 const double r2 = x * x + y * y;
577 for (
unsigned int d = 0; d < 3; ++d)
587 const std::vector<
Point<2>> & points,
590 unsigned int n = points.size();
593 for (
unsigned int d = 0; d < 2 + 1; ++d)
596 for (
unsigned int k = 0; k < n; ++k)
599 const double x = p(0);
600 const double y = p(1);
602 if ((x < 0) || (y < 0))
604 const double phi = std::atan2(y, -x) +
numbers::PI;
605 const double r2 = x * x + y * y;
610 const double psi =
Psi(phi);
611 const double psi1 =
Psi_1(phi);
612 const double psi2 =
Psi_2(phi);
617 const double udr =
lambda * rl1 * (
lp * sinp * psi + cosp * psi1);
618 const double udp = rl * (
lp * cosp * psi +
lp * sinp * psi1 -
619 sinp * psi1 + cosp * psi2);
621 const double vdr =
lambda * rl1 * (
lp * cosp * psi - sinp * psi1);
622 const double vdp = rl * (
lp * (cosp * psi1 - sinp * psi) -
623 cosp * psi1 - sinp * psi2);
627 const double pdp = -rl1 * (
lp *
lp * psi2 +
Psi_4(phi)) /
lm;
628 values[0][k][0] = cosp * udr - sinp / r * udp;
629 values[0][k][1] = -sinp * udr - cosp / r * udp;
630 values[1][k][0] = cosp * vdr - sinp / r * vdp;
631 values[1][k][1] = -sinp * vdr - cosp / r * vdp;
632 values[2][k][0] = cosp * pdr - sinp / r * pdp;
633 values[2][k][1] = -sinp * pdr - cosp / r * pdp;
637 for (
unsigned int d = 0; d < 3; ++d)
647 const std::vector<
Point<2>> & points,
648 std::vector<std::vector<double>> &values)
const
650 unsigned int n = points.size();
653 for (
unsigned int d = 0; d < 2 + 1; ++d)
656 for (
auto &point_values : values)
657 std::fill(point_values.begin(), point_values.end(), 0.);
669 long double l = -b / (r2 +
std::sqrt(r2 * r2 + b));
681 std::vector<std::vector<double>> &values)
const
683 unsigned int n = points.size();
686 for (
unsigned int d = 0; d < 2 + 1; ++d)
689 for (
unsigned int k = 0; k < n; ++k)
692 const double x = p(0);
696 values[0][k] = 1. - elx *
std::cos(y);
705 const std::vector<
Point<2>> & points,
706 std::vector<std::vector<
Tensor<1, 2>>> &gradients)
const
708 unsigned int n = points.size();
711 Assert(gradients[0].size() == n,
714 for (
unsigned int i = 0; i < n; ++i)
716 const double x = points[i](0);
717 const double y = points[i](1);
724 gradients[0][i][0] = -
lbda * elx * cy;
727 gradients[1][i][1] =
lbda * elx * cy;
729 gradients[2][i][0] = -
lbda * elx * elx;
730 gradients[2][i][1] = 0.;
738 std::vector<std::vector<double>> &values)
const
740 unsigned int n = points.size();
742 for (
unsigned int d = 0; d < 2 + 1; ++d)
748 for (
unsigned int k = 0; k < n; ++k)
751 const double x = p(0);
752 const double y = zp * p(1);
754 const double u = 1. - elx *
std::cos(y);
756 const double uy = elx * zp *
std::sin(y);
761 values[0][k] = u * ux + v * uy;
762 values[1][k] = u * vx + v * vy;
768 for (
auto &point_values : values)
769 std::fill(point_values.begin(), point_values.end(), 0.);
virtual void vector_value_list(const std::vector< Point< dim > > &points, std::vector< Vector< double > > &values) const override
void pressure_adjustment(double p)
virtual void vector_gradient_list(const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim > > > &gradients) const override
virtual void vector_laplacian_list(const std::vector< Point< dim > > &points, std::vector< Vector< double > > &values) const override
virtual std::size_t memory_consumption() const override
virtual void vector_value(const Point< dim > &points, Vector< double > &value) const override
virtual double value(const Point< dim > &points, const unsigned int component) const override
Kovasznay(const double Re, bool Stokes=false)
virtual void vector_values(const std::vector< Point< 2 > > &points, std::vector< std::vector< double > > &values) const override
virtual void vector_gradients(const std::vector< Point< 2 > > &points, std::vector< std::vector< Tensor< 1, 2 > > > &gradients) const override
virtual void vector_laplacians(const std::vector< Point< 2 > > &points, std::vector< std::vector< double > > &values) const override
double lambda() const
The value of lambda.
PoisseuilleFlow(const double r, const double Re)
virtual void vector_gradients(const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim > > > &gradients) const override
virtual void vector_values(const std::vector< Point< dim > > &points, std::vector< std::vector< double > > &values) const override
virtual void vector_laplacians(const std::vector< Point< dim > > &points, std::vector< std::vector< double > > &values) const override
virtual void vector_values(const std::vector< Point< dim > > &points, std::vector< std::vector< double > > &values) const override
StokesCosine(const double viscosity=1., const double reaction=0.)
void set_parameters(const double viscosity, const double reaction)
virtual void vector_gradients(const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim > > > &gradients) const override
virtual void vector_laplacians(const std::vector< Point< dim > > &points, std::vector< std::vector< double > > &values) const override
static const double lambda
virtual void vector_gradients(const std::vector< Point< 2 > > &points, std::vector< std::vector< Tensor< 1, 2 > > > &gradients) const override
virtual void vector_values(const std::vector< Point< 2 > > &points, std::vector< std::vector< double > > &values) const override
double Psi_1(double phi) const
The derivative of Psi()
double Psi(double phi) const
The auxiliary function Psi.
const double lp
Auxiliary variable 1+lambda.
const double lm
Auxiliary variable 1-lambda.
virtual void vector_laplacians(const std::vector< Point< 2 > > &points, std::vector< std::vector< double > > &values) const override
double Psi_3(double phi) const
The 3rd derivative of Psi()
StokesLSingularity()
Constructor setting up some data.
double Psi_4(double phi) const
The 4th derivative of Psi()
double Psi_2(double phi) const
The 2nd derivative of Psi()
const double coslo
Cosine of lambda times omega.
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
static constexpr double PI
::VectorizedArray< Number, width > exp(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > cos(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sin(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)