16 #ifndef dealii__integrators_elasticity_h 17 #define dealii__integrators_elasticity_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
51 const double factor = 1.)
61 const double dx = factor * fe.
JxW(k);
62 for (
unsigned int i=0; i<n_dofs; ++i)
63 for (
unsigned int j=0; j<n_dofs; ++j)
64 for (
unsigned int d1=0; d1<dim; ++d1)
65 for (
unsigned int d2=0; d2<dim; ++d2)
78 template <
int dim,
typename number>
93 for (
unsigned int k=0; k<nq; ++k)
95 const double dx = factor * fe.
JxW(k);
96 for (
unsigned int i=0; i<n_dofs; ++i)
97 for (
unsigned int d1=0; d1<dim; ++d1)
98 for (
unsigned int d2=0; d2<dim; ++d2)
100 result(i) += dx * .25 *
101 (input[d1][k][d2] + input[d2][k][d1]) *
129 const double dx = factor * fe.
JxW(k);
131 for (
unsigned int i=0; i<n_dofs; ++i)
132 for (
unsigned int j=0; j<n_dofs; ++j)
133 for (
unsigned int d1=0; d1<dim; ++d1)
137 M(i,j) += dx * 2. * penalty * u * v;
138 for (
unsigned int d2=0; d2<dim; ++d2)
174 const double dx = factor * fe.
JxW(k);
176 for (
unsigned int i=0; i<n_dofs; ++i)
177 for (
unsigned int j=0; j<n_dofs; ++j)
184 for (
unsigned int d=0; d<dim; ++d)
191 for (
unsigned int d1=0; d1<dim; ++d1)
195 M(i,j) += dx * 2. * penalty * u * v;
197 M(i,j) += dx * (ngradun * v + ngradvn * u);
198 for (
unsigned int d2=0; d2<dim; ++d2)
230 template <
int dim,
typename number>
234 const VectorSlice<
const std::vector<std::vector<double> > > &input,
236 const VectorSlice<
const std::vector<std::vector<double> > > &data,
247 const double dx = factor * fe.
JxW(k);
249 for (
unsigned int i=0; i<n_dofs; ++i)
250 for (
unsigned int d1=0; d1<dim; ++d1)
252 const double u= input[d1][k];
254 const double g= data[d1][k];
255 result(i) += dx * 2.*penalty * (u-g) * v;
257 for (
unsigned int d2=0; d2<dim; ++d2)
260 result(i) -= .5*dx* v * Dinput[d1][k][d2] * n[d2];
262 result(i) -= .5*dx* v * Dinput[d2][k][d1] * n[d2];
278 template <
int dim,
typename number>
282 const VectorSlice<
const std::vector<std::vector<double> > > &input,
284 const VectorSlice<
const std::vector<std::vector<double> > > &data,
295 const double dx = factor * fe.
JxW(k);
297 for (
unsigned int i=0; i<n_dofs; ++i)
305 for (
unsigned int d=0; d<dim; ++d)
307 udotn += n[d]*input[d][k];
308 gdotn += n[d]*data[d][k];
310 ngradun += n*Dinput[d][k]*n[d];
313 for (
unsigned int d1=0; d1<dim; ++d1)
315 const double u= input[d1][k] - udotn*n[d1];
317 const double g= data[d1][k] - gdotn*n[d1];
318 result(i) += dx * 2.*penalty * (u-g) * v;
320 result(i) += dx * (ngradun * v + ngradvn * (u-g));
321 for (
unsigned int d2=0; d2<dim; ++d2)
325 result(i) -= .5*dx* Dinput[d1][k][d2] *n[d2]* v;
327 result(i) -= .5*dx* Dinput[d2][k][d1] *n[d2]* v;
353 template <
int dim,
typename number>
357 const VectorSlice<
const std::vector<std::vector<double> > > &input,
368 const double dx = factor * fe.
JxW(k);
370 for (
unsigned int i=0; i<n_dofs; ++i)
371 for (
unsigned int d1=0; d1<dim; ++d1)
373 const double u= input[d1][k];
375 result(i) += dx * 2.*penalty * u * v;
377 for (
unsigned int d2=0; d2<dim; ++d2)
380 result(i) -= .5*dx* v * Dinput[d1][k][d2] * n[d2];
382 result(i) -= .5*dx* v * Dinput[d2][k][d1] * n[d2];
404 const double int_factor = 1.,
405 const double ext_factor = -1.)
420 const double nu1 = int_factor;
421 const double nu2 = (ext_factor < 0) ? int_factor : ext_factor;
422 const double penalty = .5 * pen * (nu1 + nu2);
426 const double dx = fe1.
JxW(k);
428 for (
unsigned int i=0; i<n_dofs; ++i)
429 for (
unsigned int j=0; j<n_dofs; ++j)
430 for (
unsigned int d1=0; d1<dim; ++d1)
437 M11(i,j) += dx * penalty * u1*v1;
438 M12(i,j) -= dx * penalty * u2*v1;
439 M21(i,j) -= dx * penalty * u1*v2;
440 M22(i,j) += dx * penalty * u2*v2;
442 for (
unsigned int d2=0; d2<dim; ++d2)
474 template<
int dim,
typename number>
481 const VectorSlice<
const std::vector<std::vector<double> > > &input1,
483 const VectorSlice<
const std::vector<std::vector<double> > > &input2,
486 double int_factor = 1.,
487 double ext_factor = -1.)
498 const double nu1 = int_factor;
499 const double nu2 = (ext_factor < 0) ? int_factor : ext_factor;
500 const double penalty = .5 * pen * (nu1 + nu2);
505 const double dx = fe1.
JxW(k);
508 for (
unsigned int i=0; i<n1; ++i)
509 for (
unsigned int d1=0; d1<dim; ++d1)
513 const double u1 = input1[d1][k];
514 const double u2 = input2[d1][k];
516 result1(i) += dx * penalty * u1*v1;
517 result1(i) -= dx * penalty * u2*v1;
518 result2(i) -= dx * penalty * u1*v2;
519 result2(i) += dx * penalty * u2*v2;
521 for (
unsigned int d2=0; d2<dim; ++d2)
524 result1(i) -= .25*dx* (nu1*Dinput1[d1][k][d2]+nu2*Dinput2[d1][k][d2]) * n[d2] * v1;
525 result2(i) += .25*dx* (nu1*Dinput1[d1][k][d2]+nu2*Dinput2[d1][k][d2]) * n[d2] * v2;
527 result1(i) -= .25*dx* (nu1*Dinput1[d2][k][d1]+nu2*Dinput2[d2][k][d1]) * n[d2] * v1;
528 result2(i) += .25*dx* (nu1*Dinput1[d2][k][d1]+nu2*Dinput2[d2][k][d1]) * n[d2] * v2;
542 DEAL_II_NAMESPACE_CLOSE
void nitsche_residual_homogeneous(Vector< number > &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, double penalty, double factor=1.)
#define AssertDimension(dim1, dim2)
const unsigned int dofs_per_cell
#define AssertVectorVectorDimension(vec, dim1, dim2)
const FiniteElement< dim, spacedim > & get_fe() const
void nitsche_tangential_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, double penalty, double factor=1.)
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.
void cell_residual(Vector< number > &result, const FEValuesBase< dim > &fe, const VectorSlice< const std::vector< std::vector< Tensor< 1, dim > > > > &input, double factor=1.)
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void ip_matrix(FullMatrix< double > &M11, FullMatrix< double > &M12, FullMatrix< double > &M21, FullMatrix< double > &M22, const FEValuesBase< dim > &fe1, const FEValuesBase< dim > &fe2, const double pen, const double int_factor=1., const double ext_factor=-1.)
const unsigned int n_quadrature_points
void nitsche_residual(Vector< number > &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.)
void nitsche_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, double penalty, double factor=1.)
void nitsche_tangential_residual(Vector< number > &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.)
double JxW(const unsigned int quadrature_point) const
void ip_residual(Vector< number > &result1, Vector< number > &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.)
void cell_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const double factor=1.)
const Tensor< 1, spacedim > & normal_vector(const unsigned int i) const
Tensor< 1, spacedim > shape_grad_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const