174 libmesh_assert_equal_to (system_name,
"Elasticity");
188 std::unique_ptr<FEBase> fe (FEBase::build(
dim, fe_type));
190 fe->attach_quadrature_rule (&qrule);
192 std::unique_ptr<FEBase> fe_face (FEBase::build(
dim, fe_type));
194 fe_face->attach_quadrature_rule (&qface);
196 const std::vector<Real> & JxW = fe->get_JxW();
197 const std::vector<std::vector<RealGradient>> & dphi = fe->get_dphi();
211 std::vector<dof_id_type> dof_indices;
212 std::vector<dof_id_type> dof_indices_u;
213 std::vector<dof_id_type> dof_indices_v;
214 std::vector<dof_id_type> dof_indices_lambda;
218 for (
const auto & elem :
mesh.active_local_element_ptr_range())
223 dof_map.
dof_indices (elem, dof_indices_lambda, lambda_var);
225 const unsigned int n_dofs = dof_indices.size();
226 const unsigned int n_u_dofs = dof_indices_u.size();
227 const unsigned int n_v_dofs = dof_indices_v.size();
228 const unsigned int n_lambda_dofs = dof_indices_lambda.size();
232 Ke.
resize (n_dofs, n_dofs);
235 Kuu.reposition (u_var*n_u_dofs, u_var*n_u_dofs, n_u_dofs, n_u_dofs);
236 Kuv.reposition (u_var*n_u_dofs, v_var*n_u_dofs, n_u_dofs, n_v_dofs);
238 Kvu.reposition (v_var*n_v_dofs, u_var*n_v_dofs, n_v_dofs, n_u_dofs);
239 Kvv.reposition (v_var*n_v_dofs, v_var*n_v_dofs, n_v_dofs, n_v_dofs);
242 Kv_lambda.reposition (v_var*n_u_dofs, v_var*n_u_dofs+n_v_dofs, n_v_dofs, 1);
243 Klambda_v.reposition (v_var*n_v_dofs+n_v_dofs, v_var*n_v_dofs, 1, n_v_dofs);
245 Fu.reposition (u_var*n_u_dofs, n_u_dofs);
246 Fv.reposition (v_var*n_u_dofs, n_v_dofs);
248 for (
unsigned int qp=0; qp<qrule.n_points(); qp++)
250 for (
unsigned int i=0; i<n_u_dofs; i++)
251 for (
unsigned int j=0; j<n_u_dofs; j++)
254 unsigned int C_i, C_j, C_k, C_l;
270 for (
unsigned int i=0; i<n_u_dofs; i++)
271 for (
unsigned int j=0; j<n_v_dofs; j++)
274 unsigned int C_i, C_j, C_k, C_l;
290 for (
unsigned int i=0; i<n_v_dofs; i++)
291 for (
unsigned int j=0; j<n_u_dofs; j++)
294 unsigned int C_i, C_j, C_k, C_l;
310 for (
unsigned int i=0; i<n_v_dofs; i++)
311 for (
unsigned int j=0; j<n_v_dofs; j++)
314 unsigned int C_i, C_j, C_k, C_l;
332 std::vector<boundary_id_type> bc_ids;
333 for (
auto side : elem->side_index_range())
334 if (elem->neighbor_ptr(side) ==
nullptr)
338 const std::vector<std::vector<Real>> & phi_face = fe_face->get_phi();
339 const std::vector<Real> & JxW_face = fe_face->get_JxW();
341 fe_face->reinit(elem, side);
343 for (std::vector<boundary_id_type>::const_iterator b =
344 bc_ids.begin(); b != bc_ids.end(); ++b)
347 for (
unsigned int qp=0; qp<qface.n_points(); qp++)
351 for (
unsigned int i=0; i<n_v_dofs; i++)
352 Fv(i) += JxW_face[qp] * (-1.) * phi_face[i][qp];
357 for (
unsigned int i=0; i<n_v_dofs; i++)
358 for (
unsigned int j=0; j<n_lambda_dofs; j++)
359 Kv_lambda(i,j) += JxW_face[qp] * (-1.) * phi_face[i][qp];
361 for (
unsigned int i=0; i<n_lambda_dofs; i++)
362 for (
unsigned int j=0; j<n_v_dofs; j++)
363 Klambda_v(i,j) += JxW_face[qp] * (-1.) * phi_face[j][qp];
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
void constrain_element_matrix_and_vector(DenseMatrix< Number > &matrix, DenseVector< Number > &rhs, std::vector< dof_id_type > &elem_dofs, bool asymmetric_constraint_rows=true) const
Constrains the element matrix and vector.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and linear solvers ...
void resize(const unsigned int n)
Resize the vector.
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
Computes , where v is a pointer and each dof_indices[i] specifies where to add value v[i]...
const FEType & variable_type(const unsigned int c) const
NumericVector< Number > * rhs
The system matrix.
Order default_quadrature_order() const
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
const T_sys & get_system(std::string_view name) const
This is the MeshBase class.
unsigned int variable_number(std::string_view var) const
Defines a dense subvector for use in finite element computations.
This class handles the numbering of degrees of freedom on a mesh.
virtual void add_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols)=0
Add the full matrix dm to the SparseMatrix.
Defines a dense submatrix for use in Finite Element-type computations.
const MeshBase & get_mesh() const
void resize(const unsigned int new_m, const unsigned int new_n)
Resizes the matrix to the specified size and calls zero().
This class implements specific orders of Gauss quadrature.
unsigned int mesh_dimension() const
Real eval_elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
const DofMap & get_dof_map() const
const SparseMatrix< Number > & get_system_matrix() const