16#ifndef dealii_integrators_advection_h
17#define dealii_integrators_advection_h
79 const double factor = 1.)
81 const unsigned int n_dofs = fe.dofs_per_cell;
83 const unsigned int n_components = fe.get_fe().n_components();
100 for (
unsigned k = 0;
k < fe.n_quadrature_points; ++
k)
102 const double dx = factor * fe.JxW(
k);
105 for (
unsigned j = 0;
j < n_dofs; ++
j)
106 for (
unsigned i = 0; i <
t_dofs; ++i)
107 for (
unsigned int c = 0; c < n_components; ++c)
111 for (
unsigned int d = 1; d < dim; ++d)
114 M(i,
j) -= dx *
wgradv * fe.shape_value_component(
j,
k, c);
137 const unsigned int nq = fe.n_quadrature_points;
138 const unsigned int n_dofs = fe.dofs_per_cell;
150 for (
unsigned k = 0;
k <
nq; ++
k)
152 const double dx = factor * fe.JxW(
k);
153 for (
unsigned i = 0; i < n_dofs; ++i)
154 for (
unsigned int d = 0; d < dim; ++d)
155 result(i) += dx * input[
k][d] * fe.shape_value(i,
k) *
180 const unsigned int nq = fe.n_quadrature_points;
181 const unsigned int n_dofs = fe.dofs_per_cell;
182 const unsigned int n_comp = fe.get_fe().n_components();
195 for (
unsigned k = 0;
k <
nq; ++
k)
197 const double dx = factor * fe.JxW(
k);
198 for (
unsigned i = 0; i < n_dofs; ++i)
199 for (
unsigned int c = 0; c <
n_comp; ++c)
200 for (
unsigned int d = 0; d < dim; ++d)
201 result(i) += dx * input[c][
k][d] *
202 fe.shape_value_component(i,
k, c) *
218 const std::vector<double> & input,
222 const unsigned int nq = fe.n_quadrature_points;
223 const unsigned int n_dofs = fe.dofs_per_cell;
235 for (
unsigned k = 0;
k <
nq; ++
k)
237 const double dx = factor * fe.JxW(
k);
238 for (
unsigned i = 0; i < n_dofs; ++i)
239 for (
unsigned int d = 0; d < dim; ++d)
240 result(i) -= dx * input[
k] * fe.shape_grad(i,
k)[d] *
258 const ArrayView<
const std::vector<double>> &input,
262 const unsigned int nq = fe.n_quadrature_points;
263 const unsigned int n_dofs = fe.dofs_per_cell;
264 const unsigned int n_comp = fe.get_fe().n_components();
277 for (
unsigned k = 0;
k <
nq; ++
k)
279 const double dx = factor * fe.JxW(
k);
280 for (
unsigned i = 0; i < n_dofs; ++i)
281 for (
unsigned int c = 0; c <
n_comp; ++c)
282 for (
unsigned int d = 0; d < dim; ++d)
283 result(i) -= dx * input[c][
k] *
284 fe.shape_grad_component(i,
k, c)[d] *
316 const unsigned int n_dofs = fe.dofs_per_cell;
318 unsigned int n_components = fe.get_fe().n_components();
329 for (
unsigned k = 0;
k < fe.n_quadrature_points; ++
k)
331 const double dx = factor * fe.JxW(
k);
334 for (
unsigned int d = 0; d < dim; ++d)
339 for (
unsigned i = 0; i <
t_dofs; ++i)
340 for (
unsigned j = 0;
j < n_dofs; ++
j)
342 if (fe.get_fe().is_primitive())
344 dx *
nv * fe.shape_value(i,
k) * fe.shape_value(
j,
k);
346 for (
unsigned int c = 0; c < n_components; ++c)
348 fetest.shape_value_component(i,
k, c) *
349 fe.shape_value_component(
j,
k, c);
385 const std::vector<double> & input,
386 const std::vector<double> & data,
390 const unsigned int n_dofs = fe.dofs_per_cell;
403 for (
unsigned k = 0;
k < fe.n_quadrature_points; ++
k)
405 const double dx = factor * fe.JxW(
k);
408 for (
unsigned int d = 0; d < dim; ++d)
412 const double val = (
nv > 0.) ? input[
k] : -data[
k];
414 for (
unsigned i = 0; i < n_dofs; ++i)
416 const double v = fe.shape_value(i,
k);
452 const ArrayView<
const std::vector<double>> &input,
453 const ArrayView<
const std::vector<double>> &data,
457 const unsigned int n_dofs = fe.dofs_per_cell;
458 const unsigned int n_comp = fe.get_fe().n_components();
471 for (
unsigned k = 0;
k < fe.n_quadrature_points; ++
k)
473 const double dx = factor * fe.JxW(
k);
476 for (
unsigned int d = 0; d < dim; ++d)
479 std::vector<double> val(
n_comp);
481 for (
unsigned int d = 0; d <
n_comp; ++d)
483 val[d] = (
nv > 0.) ? input[d][
k] : -data[d][
k];
484 for (
unsigned i = 0; i < n_dofs; ++i)
486 const double v = fe.shape_value_component(i,
k, d);
526 const double factor = 1.)
528 const unsigned int n1 =
fe1.dofs_per_cell;
540 for (
unsigned k = 0;
k <
fe1.n_quadrature_points; ++
k)
543 for (
unsigned int d = 1; d < dim; ++d)
551 for (
unsigned i = 0; i <
n1; ++i)
552 for (
unsigned j = 0;
j <
n1; ++
j)
554 if (
fe1.get_fe().is_primitive())
563 for (
unsigned int d = 0; d <
fe1.get_fe().n_components();
567 fe.shape_value_component(
j,
k, d) *
568 fetest.shape_value_component(i,
k, d);
570 fe.shape_value_component(
j,
k, d) *
571 fetestn.shape_value_component(i,
k, d);
606 const std::vector<double> &
input1,
607 const std::vector<double> &
input2,
609 const double factor = 1.)
616 const unsigned int n1 =
fe1.dofs_per_cell;
628 for (
unsigned k = 0;
k <
fe1.n_quadrature_points; ++
k)
631 for (
unsigned int d = 1; d < dim; ++d)
635 for (
unsigned i = 0; i <
n1; ++i)
637 const double v1 =
fe1.shape_value(i,
k);
638 const double v2 =
fe2.shape_value(i,
k);
686 const double factor = 1.)
688 const unsigned int n_comp =
fe1.get_fe().n_components();
689 const unsigned int n1 =
fe1.dofs_per_cell;
704 for (
unsigned k = 0;
k <
fe1.n_quadrature_points; ++
k)
707 for (
unsigned int d = 1; d < dim; ++d)
711 for (
unsigned i = 0; i <
n1; ++i)
712 for (
unsigned int d = 0; d <
n_comp; ++d)
714 const double v1 =
fe1.shape_value_component(i,
k, d);
715 const double v2 =
fe2.shape_value_component(i,
k, d);
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define AssertVectorVectorDimension(VEC, DIM1, DIM2)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void upwind_face_residual(Vector< double > &result1, Vector< double > &result2, const FEValuesBase< dim > &fe1, const FEValuesBase< dim > &fe2, const std::vector< double > &input1, const std::vector< double > &input2, const ArrayView< const std::vector< double > > &velocity, const double factor=1.)
void cell_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const FEValuesBase< dim > &fetest, const ArrayView< const std::vector< double > > &velocity, const double factor=1.)
void cell_residual(Vector< double > &result, const FEValuesBase< dim > &fe, const std::vector< Tensor< 1, dim > > &input, const ArrayView< const std::vector< double > > &velocity, double factor=1.)
void upwind_value_residual(Vector< double > &result, const FEValuesBase< dim > &fe, const std::vector< double > &input, const std::vector< double > &data, const ArrayView< const std::vector< double > > &velocity, double factor=1.)
void upwind_value_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const FEValuesBase< dim > &fetest, const ArrayView< const std::vector< double > > &velocity, double factor=1.)
Library of integrals over cells and faces.
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)