16 #ifndef dealii_integrators_grad_div_h 17 #define dealii_integrators_grad_div_h 20 #include <deal.II/base/config.h> 21 #include <deal.II/base/exceptions.h> 22 #include <deal.II/base/quadrature.h> 23 #include <deal.II/lac/full_matrix.h> 24 #include <deal.II/fe/mapping.h> 25 #include <deal.II/fe/fe_values.h> 26 #include <deal.II/meshworker/dof_info.h> 28 DEAL_II_NAMESPACE_OPEN
65 const double dx = factor * fe.
JxW(k);
66 for (
unsigned int i=0; i<n_dofs; ++i)
67 for (
unsigned int j=0; j<n_dofs; ++j)
72 M(i,j) += dx * divu * divv;
86 template <
int dim,
typename number>
91 const double factor = 1.)
100 const double dx = factor * fetest.
JxW(k);
101 for (
unsigned int i=0; i<n_dofs; ++i)
105 for (
unsigned int d=0; d<dim; ++d)
106 du += input[d][k][d];
108 result(i) += dx * du * divv;
135 const double dx = factor * fe.
JxW(k);
137 for (
unsigned int i=0; i<n_dofs; ++i)
138 for (
unsigned int j=0; j<n_dofs; ++j)
142 double un = 0., vn = 0.;
143 for (
unsigned int d=0; d<dim; ++d)
149 M(i,j) += dx * 2. * penalty * un * vn;
150 M(i,j) -= dx*(divu*vn+divv*un);
177 const VectorSlice<
const std::vector<std::vector<double> > > &input,
179 const VectorSlice<
const std::vector<std::vector<double> > > &data,
191 const double dx = factor * fe.
JxW(k);
196 for (
unsigned int d=0; d<dim; ++d)
198 umgn += (input[d][k] - data[d][k]) * n[d];
199 divu += Dinput[d][k][d];
202 for (
unsigned int i=0; i<n_dofs; ++i)
206 for (
unsigned int d=0; d<dim; ++d)
209 result(i) += dx*(2.*penalty*umgn*vn - divv*umgn - divu*vn);
232 double factor2 = -1.)
244 const double fi = factor1;
245 const double fe = (factor2 < 0) ? factor1 : factor2;
246 const double f = .5*(fi+fe);
250 const double dx = fe1.
JxW(k);
252 for (
unsigned int i=0; i<n_dofs; ++i)
253 for (
unsigned int j=0; j<n_dofs; ++j)
264 for (
unsigned int d=0; d<dim; ++d)
271 M11(i,j) += dx*(-.5*fi*divvi*uni-.5*fi*divui*vni+f*penalty*uni*vni);
272 M12(i,j) += dx*( .5*fi*divvi*une-.5*fe*divue*vni-f*penalty*vni*une);
273 M21(i,j) += dx*(-.5*fe*divve*uni+.5*fi*divui*vne-f*penalty*uni*vne);
274 M22(i,j) += dx*( .5*fe*divve*une+.5*fe*divue*vne+f*penalty*une*vne);
300 const VectorSlice<
const std::vector<std::vector<double> > > &input1,
302 const VectorSlice<
const std::vector<std::vector<double> > > &input2,
305 double int_factor = 1.,
306 double ext_factor = -1.)
316 const double fi = int_factor;
317 const double fe = (ext_factor < 0) ? int_factor : ext_factor;
318 const double penalty = .5 * pen * (fi + fe);
323 const double dx = fe1.
JxW(k);
329 for (
unsigned int d=0; d<dim; ++d)
331 uni += input1[d][k]*n[d];
332 une += input2[d][k]*n[d];
333 divui += Dinput1[d][k][d];
334 divue += Dinput2[d][k][d];
337 for (
unsigned int i=0; i<n1; ++i)
343 for (
unsigned int d=0; d<dim; ++d)
349 result1(i) += dx*(-.5*fi*divvi*uni-.5*fi*divui*vni+penalty*uni*vni);
350 result1(i) += dx*( .5*fi*divvi*une-.5*fe*divue*vni-penalty*vni*une);
351 result2(i) += dx*(-.5*fe*divve*uni+.5*fi*divui*vne-penalty*uni*vne);
352 result2(i) += dx*( .5*fe*divve*une+.5*fe*divue*vne+penalty*une*vne);
359 DEAL_II_NAMESPACE_CLOSE
void nitsche_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, double penalty, double factor=1.)
#define AssertDimension(dim1, dim2)
void ip_residual(Vector< double > &result1, Vector< double > &result2, const FEValuesBase< dim > &fe1, const FEValuesBase< dim > &fe2, const VectorSlice< const std::vector< std::vector< double > > > &input1, const VectorSlice< const std::vector< std::vector< Tensor< 1, dim > > > > &Dinput1, const VectorSlice< const std::vector< std::vector< double > > > &input2, const VectorSlice< const std::vector< std::vector< Tensor< 1, dim > > > > &Dinput2, double pen, double int_factor=1., double ext_factor=-1.)
const unsigned int dofs_per_cell
void cell_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, double factor=1.)
void ip_matrix(FullMatrix< double > &M11, FullMatrix< double > &M12, FullMatrix< double > &M21, FullMatrix< double > &M22, const FEValuesBase< dim > &fe1, const FEValuesBase< dim > &fe2, double penalty, double factor1=1., double factor2=-1.)
#define AssertVectorVectorDimension(vec, dim1, dim2)
const FiniteElement< dim, spacedim > & get_fe() const
double shape_value_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
Library of integrals over cells and faces.
const unsigned int n_quadrature_points
double JxW(const unsigned int quadrature_point) const
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.)
void nitsche_residual(Vector< double > &result, const FEValuesBase< dim > &fe, const VectorSlice< const std::vector< std::vector< double > > > &input, const VectorSlice< const std::vector< std::vector< Tensor< 1, dim > > > > &Dinput, const VectorSlice< const std::vector< std::vector< double > > > &data, double penalty, double factor=1.)
const Tensor< 1, spacedim > & normal_vector(const unsigned int i) const