17 #ifndef __deal2__integrators_divergence_h
18 #define __deal2__integrators_divergence_h
21 #include <deal.II/base/config.h>
23 #include <deal.II/base/quadrature.h>
24 #include <deal.II/lac/full_matrix.h>
25 #include <deal.II/fe/mapping.h>
26 #include <deal.II/fe/fe_values.h>
27 #include <deal.II/meshworker/dof_info.h>
60 for (
unsigned int d=0; d<dim; ++d)
62 result[d] += h0[d][0];
63 if (dim >=2) result[d] += h1[d][1];
64 if (dim >=3) result[d] += h2[d][2];
90 unsigned int fecomp = fe.
get_fe().n_components();
100 const double dx = fe.
JxW(k) * factor;
101 for (
unsigned int i=0; i<t_dofs; ++i)
104 for (
unsigned int d=0; d<dim; ++d)
105 for (
unsigned int j=0; j<n_dofs; ++j)
108 M(i,j) += dx * du * vv;
129 template <
int dim,
typename number>
134 const double factor = 1.)
143 const double dx = factor * fetest.
JxW(k);
145 for (
unsigned int i=0; i<t_dofs; ++i)
146 for (
unsigned int d=0; d<dim; ++d)
147 result(i) += dx * input[d][k][d] * fetest.
shape_value(i,k);
167 template <
int dim,
typename number>
171 const VectorSlice<
const std::vector<std::vector<double> > > &input,
172 const double factor = 1.)
181 const double dx = factor * fetest.
JxW(k);
183 for (
unsigned int i=0; i<t_dofs; ++i)
184 for (
unsigned int d=0; d<dim; ++d)
185 result(i) -= dx * input[d][k] * fetest.
shape_grad(i,k)[d];
209 unsigned int fecomp = fetest.
get_fe().n_components();
220 const double dx = fe.
JxW(k) * factor;
221 for (
unsigned int d=0; d<dim; ++d)
222 for (
unsigned int i=0; i<t_dofs; ++i)
225 for (
unsigned int j=0; j<n_dofs; ++j)
228 M(i,j) += dx * vv * Du[d];
248 template <
int dim,
typename number>
253 const double factor = 1.)
262 const double dx = factor * fetest.
JxW(k);
264 for (
unsigned int i=0; i<t_dofs; ++i)
265 for (
unsigned int d=0; d<dim; ++d)
284 template <
int dim,
typename number>
288 const std::vector<double> &input,
289 const double factor = 1.)
298 const double dx = factor * fetest.
JxW(k);
300 for (
unsigned int i=0; i<t_dofs; ++i)
301 for (
unsigned int d=0; d<dim; ++d)
323 unsigned int fecomp = fe.
get_fe().n_components();
335 for (
unsigned int i=0; i<t_dofs; ++i)
336 for (
unsigned int j=0; j<n_dofs; ++j)
337 for (
unsigned int d=0; d<dim; ++d)
356 template<
int dim,
typename number>
362 const VectorSlice<
const std::vector<std::vector<double> > > &data,
365 unsigned int fecomp = fe.
get_fe().n_components();
377 for (
unsigned int i=0; i<t_dofs; ++i)
378 for (
unsigned int d=0; d<dim; ++d)
379 result(i) += ndx[d] * fetest.
shape_value(i,k) * data[d][k];
396 template<
int dim,
typename number>
401 const std::vector<double> &data,
414 for (
unsigned int i=0; i<t_dofs; ++i)
415 for (
unsigned int d=0; d<dim; ++d)
464 const double dx = factor * fe1.
JxW(k);
465 for (
unsigned int i=0; i<t_dofs; ++i)
466 for (
unsigned int j=0; j<n_dofs; ++j)
467 for (
unsigned int d=0; d<dim; ++d)
474 M11(i,j) += .5 * dx * un1 * v1;
475 M12(i,j) += .5 * dx * un2 * v1;
476 M21(i,j) += .5 * dx * un1 * v2;
477 M22(i,j) += .5 * dx * un2 * v2;
505 const double dx = factor * fe.
JxW(k);
506 for (
unsigned int i=0; i<n_dofs; ++i)
507 for (
unsigned int j=0; j<n_dofs; ++j)
511 for (
unsigned int d=0; d<dim; ++d)
517 M(i,j) += dx * du * dv;
560 const double dx = factor * fe1.
JxW(k);
561 for (
unsigned int i=0; i<n_dofs; ++i)
562 for (
unsigned int j=0; j<n_dofs; ++j)
563 for (
unsigned int d=0; d<dim; ++d)
570 M11(i,j) += dx * un1 * vn1;
571 M12(i,j) += dx * un2 * vn1;
572 M21(i,j) += dx * un1 * vn2;
573 M22(i,j) += dx * un2 * vn2;
594 unsigned int fecomp = fe.
get_fe().n_components();
602 double div = Du[0][k][0];
603 for (
unsigned int d=1; d<dim; ++d)
605 result += div*div*fe.
JxW(k);
614 DEAL_II_NAMESPACE_CLOSE
#define AssertDimension(dim1, dim2)
const unsigned int dofs_per_cell
#define AssertVectorVectorDimension(vec, dim1, dim2)
void cell_residual(Vector< number > &result, const FEValuesBase< dim > &fetest, const VectorSlice< const std::vector< std::vector< Tensor< 1, dim > > > > &input, const double factor=1.)
const Point< spacedim > & normal_vector(const unsigned int i) const
Library of integrals over cells and faces.
const double & shape_value(const unsigned int function_no, const unsigned int point_no) const
void cell_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const FEValuesBase< dim > &fetest, double factor=1.)
double JxW(const unsigned int quadrature_point) const
#define Assert(cond, exc)
void gradient_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const FEValuesBase< dim > &fetest, double factor=1.)
void u_dot_n_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const FEValuesBase< dim > &fetest, double factor=1.)
Tensor< 1, spacedim > shape_grad_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
void u_dot_n_jump_matrix(FullMatrix< double > &M11, FullMatrix< double > &M12, FullMatrix< double > &M21, FullMatrix< double > &M22, const FEValuesBase< dim > &fe1, const FEValuesBase< dim > &fe2, double factor=1.)
void u_times_n_residual(Vector< number > &result, const FEValuesBase< dim > &fetest, const std::vector< double > &data, double factor=1.)
double norm(const FEValuesBase< dim > &fe, const VectorSlice< const std::vector< std::vector< Tensor< 1, dim > > > > &Du)
double shape_value_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
void u_dot_n_residual(Vector< number > &result, const FEValuesBase< dim > &fe, const FEValuesBase< dim > &fetest, const VectorSlice< const std::vector< std::vector< double > > > &data, double factor=1.)
const FiniteElement< dim, spacedim > & get_fe() const
void gradient_residual(Vector< number > &result, const FEValuesBase< dim > &fetest, const std::vector< Tensor< 1, dim > > &input, const double factor=1.)
const Tensor< 1, spacedim > & shape_grad(const unsigned int function_no, const unsigned int quadrature_point) const
Tensor< 1, dim > grad_div(const Tensor< 2, dim > &h0, const Tensor< 2, dim > &h1, const Tensor< 2, dim > &h2)
::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
const unsigned int n_quadrature_points
void grad_div_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, double factor=1.)