166{
167 libmesh_assert_equal_to (system_name, "Elasticity");
168
170
172
174
177
182 fe->attach_quadrature_rule (&qrule);
183
186 fe_face->attach_quadrature_rule (&qface);
187
188 const std::vector<Real> & JxW = fe->get_JxW();
189 const std::vector<std::vector<RealGradient>> & dphi = fe->get_dphi();
190
193
195 Kuu(Ke), Kuv(Ke),
196 Kvu(Ke), Kvv(Ke);
197
199 Fu(Fe),
200 Fv(Fe);
201
202 std::vector<dof_id_type> dof_indices;
203 std::vector<dof_id_type> dof_indices_u;
204 std::vector<dof_id_type> dof_indices_v;
205
207
208 for (
const auto & elem :
mesh.active_local_element_ptr_range())
209 {
213
214 const unsigned int n_dofs = dof_indices.size();
215 const unsigned int n_u_dofs = dof_indices_u.size();
216 const unsigned int n_v_dofs = dof_indices_v.size();
217
218 fe->reinit (elem);
219
220 Ke.
resize (n_dofs, n_dofs);
222
223 Kuu.reposition (u_var*n_u_dofs, u_var*n_u_dofs, n_u_dofs, n_u_dofs);
224 Kuv.reposition (u_var*n_u_dofs, v_var*n_u_dofs, n_u_dofs, n_v_dofs);
225
226 Kvu.reposition (v_var*n_v_dofs, u_var*n_v_dofs, n_v_dofs, n_u_dofs);
227 Kvv.reposition (v_var*n_v_dofs, v_var*n_v_dofs, n_v_dofs, n_v_dofs);
228
229 Fu.reposition (u_var*n_u_dofs, n_u_dofs);
230 Fv.reposition (v_var*n_u_dofs, n_v_dofs);
231
232 for (unsigned int qp=0; qp<qrule.n_points(); qp++)
233 {
234 for (unsigned int i=0; i<n_u_dofs; i++)
235 for (unsigned int j=0; j<n_u_dofs; j++)
236 {
237
238 unsigned int C_i, C_j, C_k, C_l;
239 C_i=0, C_k=0;
240
241 C_j=0, C_l=0;
243
244 C_j=1, C_l=0;
246
247 C_j=0, C_l=1;
249
250 C_j=1, C_l=1;
252 }
253
254 for (unsigned int i=0; i<n_u_dofs; i++)
255 for (unsigned int j=0; j<n_v_dofs; j++)
256 {
257
258 unsigned int C_i, C_j, C_k, C_l;
259 C_i=0, C_k=1;
260
261 C_j=0, C_l=0;
263
264 C_j=1, C_l=0;
266
267 C_j=0, C_l=1;
269
270 C_j=1, C_l=1;
272 }
273
274 for (unsigned int i=0; i<n_v_dofs; i++)
275 for (unsigned int j=0; j<n_u_dofs; j++)
276 {
277
278 unsigned int C_i, C_j, C_k, C_l;
279 C_i=1, C_k=0;
280
281 C_j=0, C_l=0;
283
284 C_j=1, C_l=0;
286
287 C_j=0, C_l=1;
289
290 C_j=1, C_l=1;
292 }
293
294 for (unsigned int i=0; i<n_v_dofs; i++)
295 for (unsigned int j=0; j<n_v_dofs; j++)
296 {
297
298 unsigned int C_i, C_j, C_k, C_l;
299 C_i=1, C_k=1;
300
301 C_j=0, C_l=0;
303
304 C_j=1, C_l=0;
306
307 C_j=0, C_l=1;
309
310 C_j=1, C_l=1;
312 }
313 }
314
315 {
316 for (auto side : elem->side_index_range())
317 if (elem->neighbor_ptr(side) == nullptr)
318 {
319 const std::vector<std::vector<Real>> & phi_face = fe_face->get_phi();
320 const std::vector<Real> & JxW_face = fe_face->get_JxW();
321
322 fe_face->reinit(elem, side);
323
325 {
326 for (unsigned int qp=0; qp<qface.n_points(); qp++)
327 for (unsigned int i=0; i<n_v_dofs; i++)
328 Fv(i) += JxW_face[qp] * (-1.) * phi_face[i][qp];
329 }
330 }
331 }
332
334
337 }
338}
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
Defines a dense matrix for use in Finite Element-type computations.
void resize(const unsigned int new_m, const unsigned int new_n)
Resizes the matrix to the specified size and calls zero().
Defines a dense submatrix for use in Finite Element-type computations.
Defines a dense subvector for use in finite element computations.
Defines a dense vector for use in Finite Element-type computations.
void resize(const unsigned int n)
Resize the vector.
This class handles the numbering of degrees of freedom on a mesh.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
const FEType & variable_type(const unsigned int i) const
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.
const MeshBase & get_mesh() const
const T_sys & get_system(std::string_view name) const
NumericVector< Number > * rhs
The system matrix.
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Order default_quadrature_order() const
const SparseMatrix< Number > & get_system_matrix() const
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and linear solvers ...
This is the MeshBase class.
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
unsigned int mesh_dimension() const
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].
This class implements specific orders of Gauss quadrature.
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.
unsigned int variable_number(std::string_view var) const
const DofMap & get_dof_map() const
Real eval_elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)