34 , aux_gradients(dim + 1)
53 const unsigned int n_points = points.size();
54 Assert(values.size() == n_points,
59 std::lock_guard<std::mutex> lock(mutex);
61 for (
unsigned int d = 0; d < dim + 1; ++d)
62 aux_values[d].resize(n_points);
63 vector_values(points, aux_values);
65 for (
unsigned int k = 0; k < n_points; ++k)
67 Assert(values[k].size() == dim + 1,
69 for (
unsigned int d = 0; d < dim + 1; ++d)
70 values[k](d) = aux_values[d][k];
80 Assert(value.size() == dim + 1,
83 const unsigned int n_points = 1;
84 std::vector<Point<dim>> points(1);
89 std::lock_guard<std::mutex> lock(mutex);
91 for (
unsigned int d = 0; d < dim + 1; ++d)
92 aux_values[d].resize(n_points);
93 vector_values(points, aux_values);
95 for (
unsigned int d = 0; d < dim + 1; ++d)
96 value(d) = aux_values[d][0];
103 const unsigned int comp)
const
106 const unsigned int n_points = 1;
107 std::vector<Point<dim>> points(1);
112 std::lock_guard<std::mutex> lock(mutex);
114 for (
unsigned int d = 0; d < dim + 1; ++d)
115 aux_values[d].resize(n_points);
116 vector_values(points, aux_values);
118 return aux_values[comp][0];
128 const unsigned int n_points = points.size();
129 Assert(values.size() == n_points,
134 std::lock_guard<std::mutex> lock(mutex);
136 for (
unsigned int d = 0; d < dim + 1; ++d)
137 aux_gradients[d].resize(n_points);
138 vector_gradients(points, aux_gradients);
140 for (
unsigned int k = 0; k < n_points; ++k)
142 Assert(values[k].size() == dim + 1,
144 for (
unsigned int d = 0; d < dim + 1; ++d)
145 values[k][d] = aux_gradients[d][k];
156 const unsigned int n_points = points.size();
157 Assert(values.size() == n_points,
162 std::lock_guard<std::mutex> lock(mutex);
164 for (
unsigned int d = 0; d < dim + 1; ++d)
165 aux_values[d].resize(n_points);
166 vector_laplacians(points, aux_values);
168 for (
unsigned int k = 0; k < n_points; ++k)
170 Assert(values[k].size() == dim + 1,
172 for (
unsigned int d = 0; d < dim + 1; ++d)
173 values[k](d) = aux_values[d][k];
191 : inv_sqr_radius(1 / r / r)
203 std::vector<std::vector<double>> &values)
const
205 const unsigned int n = points.size();
207 Assert(values.size() == dim + 1,
209 for (
unsigned int d = 0; d < dim + 1; ++d)
212 for (
unsigned int k = 0; k < n; ++k)
218 for (
unsigned int d = 1; d < dim; ++d)
220 r2 *= inv_sqr_radius;
223 values[0][k] = 1. - r2;
225 for (
unsigned int d = 1; d < dim; ++d)
228 values[dim][k] = -2 * (dim - 1) * inv_sqr_radius * p[0] / Reynolds +
241 const unsigned int n = points.size();
243 Assert(values.size() == dim + 1,
245 for (
unsigned int d = 0; d < dim + 1; ++d)
248 for (
unsigned int k = 0; k < n; ++k)
252 values[0][k][0] = 0.;
253 for (
unsigned int d = 1; d < dim; ++d)
254 values[0][k][d] = -2. * p[d] * inv_sqr_radius;
256 for (
unsigned int d = 1; d < dim; ++d)
259 values[dim][k][0] = -2 * (dim - 1) * inv_sqr_radius / Reynolds;
260 for (
unsigned int d = 1; d < dim; ++d)
261 values[dim][k][d] = 0.;
271 std::vector<std::vector<double>> &values)
const
273 const unsigned int n = points.size();
275 Assert(values.size() == dim + 1,
277 for (
unsigned int d = 0; d < dim + 1; ++d)
280 for (
auto &point_values : values)
281 std::fill(point_values.begin(), point_values.end(), 0.);
307 std::vector<std::vector<double>> &values)
const
309 unsigned int n = points.size();
311 Assert(values.size() == dim + 1,
313 for (
unsigned int d = 0; d < dim + 1; ++d)
316 for (
unsigned int k = 0; k < n; ++k)
328 values[0][k] = cx * cx * cy * sy;
329 values[1][k] = -cx * sx * cy * cy;
330 values[2][k] = cx * sx * cy * sy + this->mean_pressure;
338 values[0][k] = cx * cx * cy * sy * cz * sz;
339 values[1][k] = cx * sx * cy * cy * cz * sz;
340 values[2][k] = -2. * cx * sx * cy * sy * cz * cz;
341 values[3][k] = cx * sx * cy * sy * cz * sz + this->mean_pressure;
358 unsigned int n = points.size();
360 Assert(values.size() == dim + 1,
362 for (
unsigned int d = 0; d < dim + 1; ++d)
365 for (
unsigned int k = 0; k < n; ++k)
374 const double cx2 = .5 + .5 * c2x;
375 const double cy2 = .5 + .5 * c2y;
391 const double cz2 = .5 + .5 * c2z;
393 values[0][k][0] = -.125 *
numbers::PI * s2x * s2y * s2z;
394 values[0][k][1] = .25 *
numbers::PI * cx2 * c2y * s2z;
395 values[0][k][2] = .25 *
numbers::PI * cx2 * s2y * c2z;
397 values[1][k][0] = .25 *
numbers::PI * c2x * cy2 * s2z;
398 values[1][k][1] = -.125 *
numbers::PI * s2x * s2y * s2z;
399 values[1][k][2] = .25 *
numbers::PI * s2x * cy2 * c2z;
401 values[2][k][0] = -.5 *
numbers::PI * c2x * s2y * cz2;
402 values[2][k][1] = -.5 *
numbers::PI * s2x * c2y * cz2;
403 values[2][k][2] = .25 *
numbers::PI * s2x * s2y * s2z;
405 values[3][k][0] = .125 *
numbers::PI * c2x * s2y * s2z;
406 values[3][k][1] = .125 *
numbers::PI * s2x * c2y * s2z;
407 values[3][k][2] = .125 *
numbers::PI * s2x * s2y * c2z;
422 std::vector<std::vector<double>> &values)
const
424 unsigned int n = points.size();
426 Assert(values.size() == dim + 1,
428 for (
unsigned int d = 0; d < dim + 1; ++d)
433 vector_values(points, values);
434 for (
unsigned int d = 0; d < dim; ++d)
435 for (
double &point_value : values[d])
436 point_value *= -reaction;
440 for (
unsigned int d = 0; d < dim; ++d)
441 std::fill(values[d].begin(), values[d].end(), 0.);
445 for (
unsigned int k = 0; k < n; ++k)
458 values[0][k] += -viscosity * pi2 * (1. + 2. * c2x) * s2y -
460 values[1][k] += viscosity * pi2 * s2x * (1. + 2. * c2y) -
471 -.5 * viscosity * pi2 * (1. + 2. * c2x) * s2y * s2z -
473 values[1][k] += .5 * viscosity * pi2 * s2x * (1. + 2. * c2y) * s2z -
476 -.5 * viscosity * pi2 * s2x * s2y * (1. + 2. * c2z) -
494 , coslo(
std::cos(lambda * omega))
546 const std::vector<
Point<2>> &points,
547 std::vector<std::vector<double>> &values)
const
549 unsigned int n = points.size();
552 for (
unsigned int d = 0; d < 2 + 1; ++d)
555 for (
unsigned int k = 0; k < n; ++k)
558 const double x = p[0];
559 const double y = p[1];
561 if ((x < 0) || (y < 0))
563 const double phi = std::atan2(y, -x) +
numbers::PI;
564 const double r2 = x * x + y * y;
576 for (
unsigned int d = 0; d < 3; ++d)
586 const std::vector<
Point<2>> &points,
589 unsigned int n = points.size();
592 for (
unsigned int d = 0; d < 2 + 1; ++d)
595 for (
unsigned int k = 0; k < n; ++k)
598 const double x = p[0];
599 const double y = p[1];
601 if ((x < 0) || (y < 0))
603 const double phi = std::atan2(y, -x) +
numbers::PI;
604 const double r2 = x * x + y * y;
609 const double psi =
Psi(phi);
610 const double psi1 =
Psi_1(phi);
611 const double psi2 =
Psi_2(phi);
616 const double udr =
lambda * rl1 * (
lp * sinp * psi + cosp * psi1);
617 const double udp = rl * (
lp * cosp * psi +
lp * sinp * psi1 -
618 sinp * psi1 + cosp * psi2);
620 const double vdr =
lambda * rl1 * (
lp * cosp * psi - sinp * psi1);
621 const double vdp = rl * (
lp * (cosp * psi1 - sinp * psi) -
622 cosp * psi1 - sinp * psi2);
626 const double pdp = -rl1 * (
lp *
lp * psi2 +
Psi_4(phi)) /
lm;
627 values[0][k][0] = cosp * udr - sinp / r * udp;
628 values[0][k][1] = -sinp * udr - cosp / r * udp;
629 values[1][k][0] = cosp * vdr - sinp / r * vdp;
630 values[1][k][1] = -sinp * vdr - cosp / r * vdp;
631 values[2][k][0] = cosp * pdr - sinp / r * pdp;
632 values[2][k][1] = -sinp * pdr - cosp / r * pdp;
636 for (
unsigned int d = 0; d < 3; ++d)
646 const std::vector<
Point<2>> &points,
647 std::vector<std::vector<double>> &values)
const
649 unsigned int n = points.size();
652 for (
unsigned int d = 0; d < 2 + 1; ++d)
655 for (
auto &point_values : values)
656 std::fill(point_values.begin(), point_values.end(), 0.);
668 long double l = -b / (r2 +
std::sqrt(r2 * r2 + b));
680 std::vector<std::vector<double>> &values)
const
682 unsigned int n = points.size();
685 for (
unsigned int d = 0; d < 2 + 1; ++d)
688 for (
unsigned int k = 0; k < n; ++k)
691 const double x = p[0];
695 values[0][k] = 1. - elx *
std::cos(y);
704 const std::vector<
Point<2>> &points,
705 std::vector<std::vector<
Tensor<1, 2>>> &gradients)
const
707 unsigned int n = points.size();
710 Assert(gradients[0].size() == n,
713 for (
unsigned int i = 0; i < n; ++i)
715 const double x = points[i][0];
716 const double y = points[i][1];
723 gradients[0][i][0] = -
lbda * elx * cy;
726 gradients[1][i][1] =
lbda * elx * cy;
728 gradients[2][i][0] = -
lbda * elx * elx;
729 gradients[2][i][1] = 0.;
737 std::vector<std::vector<double>> &values)
const
739 unsigned int n = points.size();
741 for (
unsigned int d = 0; d < 2 + 1; ++d)
747 for (
unsigned int k = 0; k < n; ++k)
750 const double x = p[0];
751 const double y = zp * p[1];
753 const double u = 1. - elx *
std::cos(y);
755 const double uy = elx * zp *
std::sin(y);
760 values[0][k] = u * ux + v * uy;
761 values[1][k] = u * vx + v * vy;
767 for (
auto &point_values : values)
768 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
#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)
#define DEAL_II_NOT_IMPLEMENTED()
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)