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>
91 Assert(result.
size() == n_dofs, ExcDimensionMismatch(result.
size(), n_dofs));
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)
169 template <
int dim,
typename number>
173 const VectorSlice<
const std::vector<std::vector<double> > > &input,
175 const VectorSlice<
const std::vector<std::vector<double> > > &data,
186 const double dx = factor * fe.
JxW(k);
188 for (
unsigned int i=0; i<n_dofs; ++i)
189 for (
unsigned int d1=0; d1<dim; ++d1)
191 const double u= input[d1][k];
193 const double g= data[d1][k];
194 result(i) += dx * 2.*penalty * (u-g) * v;
196 for (
unsigned int d2=0; d2<dim; ++d2)
199 result(i) -= .5*dx* v * Dinput[d1][k][d2] * n[d2];
201 result(i) -= .5*dx* v * Dinput[d2][k][d1] * n[d2];
226 template <
int dim,
typename number>
230 const VectorSlice<
const std::vector<std::vector<double> > > &input,
241 const double dx = factor * fe.
JxW(k);
243 for (
unsigned int i=0; i<n_dofs; ++i)
244 for (
unsigned int d1=0; d1<dim; ++d1)
246 const double u= input[d1][k];
248 result(i) += dx * 2.*penalty * u * v;
250 for (
unsigned int d2=0; d2<dim; ++d2)
253 result(i) -= .5*dx* v * Dinput[d1][k][d2] * n[d2];
255 result(i) -= .5*dx* v * Dinput[d2][k][d1] * n[d2];
277 const double int_factor = 1.,
278 const double ext_factor = -1.)
293 const double nu1 = int_factor;
294 const double nu2 = (ext_factor < 0) ? int_factor : ext_factor;
295 const double penalty = .5 * pen * (nu1 + nu2);
299 const double dx = fe1.
JxW(k);
301 for (
unsigned int i=0; i<n_dofs; ++i)
302 for (
unsigned int j=0; j<n_dofs; ++j)
303 for (
unsigned int d1=0; d1<dim; ++d1)
310 M11(i,j) += dx * penalty * u1*v1;
311 M12(i,j) -= dx * penalty * u2*v1;
312 M21(i,j) -= dx * penalty * u1*v2;
313 M22(i,j) += dx * penalty * u2*v2;
315 for (
unsigned int d2=0; d2<dim; ++d2)
347 template<
int dim,
typename number>
354 const VectorSlice<
const std::vector<std::vector<double> > > &input1,
356 const VectorSlice<
const std::vector<std::vector<double> > > &input2,
359 double int_factor = 1.,
360 double ext_factor = -1.)
371 const double nu1 = int_factor;
372 const double nu2 = (ext_factor < 0) ? int_factor : ext_factor;
373 const double penalty = .5 * pen * (nu1 + nu2);
378 const double dx = fe1.
JxW(k);
381 for (
unsigned int i=0; i<n1; ++i)
382 for (
unsigned int d1=0; d1<dim; ++d1)
386 const double u1 = input1[d1][k];
387 const double u2 = input2[d1][k];
389 result1(i) += dx * penalty * u1*v1;
390 result1(i) -= dx * penalty * u2*v1;
391 result2(i) -= dx * penalty * u1*v2;
392 result2(i) += dx * penalty * u2*v2;
394 for (
unsigned int d2=0; d2<dim; ++d2)
397 result1(i) -= .25*dx* (nu1*Dinput1[d1][k][d2]+nu2*Dinput2[d1][k][d2]) * n[d2] * v1;
398 result2(i) += .25*dx* (nu1*Dinput1[d1][k][d2]+nu2*Dinput2[d1][k][d2]) * n[d2] * v2;
400 result1(i) -= .25*dx* (nu1*Dinput1[d2][k][d1]+nu2*Dinput2[d2][k][d1]) * n[d2] * v1;
401 result2(i) += .25*dx* (nu1*Dinput1[d2][k][d1]+nu2*Dinput2[d2][k][d1]) * n[d2] * v2;
415 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
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)
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.)
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