16#ifndef dealii_integrators_laplace_h
17#define dealii_integrators_laplace_h
54 const double factor = 1.)
61 const double dx = fe.
JxW(k) * factor;
62 for (
unsigned int i = 0; i < n_dofs; ++i)
65 for (
unsigned int d = 0; d < n_components; ++d)
71 for (
unsigned int j = i + 1; j < n_dofs; ++j)
74 for (
unsigned int d = 0; d < n_components; ++d)
103 for (
unsigned int k = 0; k < nq; ++k)
105 const double dx = factor * fe.
JxW(k);
106 for (
unsigned int i = 0; i < n_dofs; ++i)
107 result(i) += dx * (input[k] * fe.
shape_grad(i, k));
132 for (
unsigned int k = 0; k < nq; ++k)
134 const double dx = factor * fe.
JxW(k);
135 for (
unsigned int i = 0; i < n_dofs; ++i)
136 for (
unsigned int d = 0; d < n_comp; ++d)
170 const double dx = fe.
JxW(k) * factor;
172 for (
unsigned int i = 0; i < n_dofs; ++i)
173 for (
unsigned int j = 0; j < n_dofs; ++j)
174 for (
unsigned int d = 0; d < n_comp; ++d)
210 const double dx = fe.
JxW(k) * factor;
212 for (
unsigned int i = 0; i < n_dofs; ++i)
213 for (
unsigned int j = 0; j < n_dofs; ++j)
220 for (
unsigned int d = 0; d < dim; ++d)
228 for (
unsigned int d = 0; d < dim; ++d)
239 M(i, j) += dx * (2. * penalty * u_t * v_t - dnu_t * v_t -
263 const std::vector<double> & input,
265 const std::vector<double> & data,
276 const double dx = factor * fe.
JxW(k);
278 for (
unsigned int i = 0; i < n_dofs; ++i)
281 const double dnu = Dinput[k] * n;
283 const double u = input[k];
284 const double g = data[k];
287 dx * (2. * penalty * (u - g) * v - dnv * (u - g) - dnu * v);
310 const ArrayView<
const std::vector<double>> & input,
312 const ArrayView<
const std::vector<double>> & data,
324 const double dx = factor * fe.
JxW(k);
326 for (
unsigned int i = 0; i < n_dofs; ++i)
327 for (
unsigned int d = 0; d < n_comp; ++d)
330 const double dnu = Dinput[d][k] * n;
332 const double u = input[d][k];
333 const double g = data[d][k];
336 dx * (2. * penalty * (u - g) * v - dnv * (u - g) - dnu * v);
367 double factor2 = -1.)
379 const double nui = factor1;
380 const double nue = (factor2 < 0) ? factor1 : factor2;
381 const double nu = .5 * (nui + nue);
385 const double dx = fe1.
JxW(k);
389 for (
unsigned int i = 0; i < n_dofs; ++i)
391 for (
unsigned int j = 0; j < n_dofs; ++j)
402 dx * (-.5 * nui * dnvi * ui - .5 * nui * dnui * vi +
403 nu * penalty * ui * vi);
405 dx * (.5 * nui * dnvi * ue - .5 * nue * dnue * vi -
406 nu * penalty * vi * ue);
408 dx * (-.5 * nue * dnve * ui + .5 * nui * dnui * ve -
409 nu * penalty * ui * ve);
411 dx * (.5 * nue * dnve * ue + .5 * nue * dnue * ve +
412 nu * penalty * ue * ve);
440 double factor2 = -1.)
454 const double nui = factor1;
455 const double nue = (factor2 < 0) ? factor1 : factor2;
456 const double nu = .5 * (nui + nue);
460 const double dx = fe1.
JxW(k);
462 for (
unsigned int i = 0; i < n_dofs; ++i)
467 for (
unsigned int j = 0; j < n_dofs; ++j)
474 double ngradu1n = 0.;
475 double ngradv1n = 0.;
476 double ngradu2n = 0.;
477 double ngradv2n = 0.;
479 for (
unsigned int d = 0; d < dim; ++d)
495 for (
unsigned int d = 0; d < dim; ++d)
518 dx * (-.5 * nui * dnvi * ui - .5 * nui * dnui * vi +
519 nu * penalty * ui * vi);
521 dx * (.5 * nui * dnvi * ue - .5 * nue * dnue * vi -
522 nu * penalty * vi * ue);
524 dx * (-.5 * nue * dnve * ui + .5 * nui * dnui * ve -
525 nu * penalty * ui * ve);
527 dx * (.5 * nue * dnve * ue + .5 * nue * dnue * ve +
528 nu * penalty * ue * ve);
548 const std::vector<double> & input1,
550 const std::vector<double> & input2,
553 double int_factor = 1.,
554 double ext_factor = -1.)
561 const double nui = int_factor;
562 const double nue = (ext_factor < 0) ? int_factor : ext_factor;
563 const double penalty = .5 * pen * (nui + nue);
569 const double dx = fe1.
JxW(k);
572 for (
unsigned int i = 0; i < n_dofs; ++i)
576 const double dnvi = Dvi * n;
579 const double dnve = Dve * n;
581 const double ui = input1[k];
583 const double dnui = Dui * n;
584 const double ue = input2[k];
586 const double dnue = Due * n;
588 result1(i) += dx * (-.5 * nui * dnvi * ui - .5 * nui * dnui * vi +
590 result1(i) += dx * (.5 * nui * dnvi * ue - .5 * nue * dnue * vi -
592 result2(i) += dx * (-.5 * nue * dnve * ui + .5 * nui * dnui * ve -
594 result2(i) += dx * (.5 * nue * dnve * ue + .5 * nue * dnue * ve +
615 const ArrayView<
const std::vector<double>> & input1,
617 const ArrayView<
const std::vector<double>> & input2,
620 double int_factor = 1.,
621 double ext_factor = -1.)
631 const double nui = int_factor;
632 const double nue = (ext_factor < 0) ? int_factor : ext_factor;
633 const double penalty = .5 * pen * (nui + nue);
638 const double dx = fe1.
JxW(k);
641 for (
unsigned int i = 0; i < n1; ++i)
642 for (
unsigned int d = 0; d < n_comp; ++d)
646 const double dnvi = Dvi * n;
649 const double dnve = Dve * n;
651 const double ui = input1[d][k];
653 const double dnui = Dui * n;
654 const double ue = input2[d][k];
656 const double dnue = Due * n;
658 result1(i) += dx * (-.5 * nui * dnvi * ui -
659 .5 * nui * dnui * vi + penalty * ui * vi);
660 result1(i) += dx * (.5 * nui * dnvi * ue -
661 .5 * nue * dnue * vi - penalty * vi * ue);
662 result2(i) += dx * (-.5 * nue * dnve * ui +
663 .5 * nui * dnui * ve - penalty * ui * ve);
664 result2(i) += dx * (.5 * nue * dnve * ue +
665 .5 * nue * dnue * ve + penalty * ue * ve);
683 template <
int dim,
int spacedim,
typename number>
690 const unsigned int normal1 =
692 const unsigned int normal2 =
694 const unsigned int deg1sq = (deg1 == 0) ? 1 : deg1 * (deg1 + 1);
695 const unsigned int deg2sq = (deg2 == 0) ? 1 : deg2 * (deg2 + 1);
697 double penalty1 = deg1sq / dinfo1.
cell->extent_in_direction(normal1);
698 double penalty2 = deg2sq / dinfo2.
cell->extent_in_direction(normal2);
699 if (dinfo1.
cell->has_children() ^ dinfo2.
cell->has_children())
705 const double penalty = 0.5 * (penalty1 + penalty2);
const unsigned int dofs_per_cell
const Tensor< 1, spacedim > & normal_vector(const unsigned int q_point) const
double shape_value_component(const unsigned int i, const unsigned int q_point, const unsigned int component) const
const unsigned int n_quadrature_points
Tensor< 1, spacedim > shape_grad_component(const unsigned int i, const unsigned int q_point, const unsigned int component) const
const Tensor< 1, spacedim > & shape_grad(const unsigned int i, const unsigned int q_point) const
const FiniteElement< dim, spacedim > & get_fe() const
double JxW(const unsigned int q_point) const
const double & shape_value(const unsigned int i, const unsigned int q_point) const
unsigned int n_components() const
Triangulation< dim, spacedim >::face_iterator face
The current face.
Triangulation< dim, spacedim >::cell_iterator cell
The current cell.
#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 & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void ip_tangential_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.)
void cell_residual(Vector< double > &result, const FEValuesBase< dim > &fe, const std::vector< Tensor< 1, dim > > &input, double factor=1.)
void cell_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const double factor=1.)
double compute_penalty(const MeshWorker::DoFInfo< dim, spacedim, number > &dinfo1, const MeshWorker::DoFInfo< dim, spacedim, number > &dinfo2, unsigned int deg1, unsigned int deg2)
void nitsche_residual(Vector< double > &result, const FEValuesBase< dim > &fe, const std::vector< double > &input, const std::vector< Tensor< 1, dim > > &Dinput, const std::vector< double > &data, double penalty, 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.)
void nitsche_tangential_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, double penalty, double factor=1.)
void ip_residual(Vector< double > &result1, Vector< double > &result2, const FEValuesBase< dim > &fe1, const FEValuesBase< dim > &fe2, const std::vector< double > &input1, const std::vector< Tensor< 1, dim > > &Dinput1, const std::vector< double > &input2, const std::vector< Tensor< 1, dim > > &Dinput2, double pen, double int_factor=1., double ext_factor=-1.)
void nitsche_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, double penalty, double factor=1.)
Library of integrals over cells and faces.