libMesh
elasticity_system.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2025 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 // DiffSystem framework files
19 #include "libmesh/fem_system.h"
20 
21 using namespace libMesh;
22 
23 // boundary IDs
24 extern boundary_id_type
34 
35 // The Navier-Stokes system class.
36 // FEMSystem, TimeSolver and NewtonSolver will handle most tasks,
37 // but we must specify element residuals
39 {
40 public:
41  // Constructor
43  const std::string & name_in,
44  const unsigned int number_in)
45  : FEMSystem(es, name_in, number_in),
46  _dim(3),
47  _fe_type(),
48  _rho(1.0)
49  {}
50 
51  // System initialization
52  virtual void init_data ();
53 
54  // Context initialization
55  virtual void init_context(DiffContext & context);
56 
57  // Element residual and jacobian calculations
58  // Time dependent parts
59  virtual bool element_time_derivative (bool request_jacobian,
60  DiffContext & context);
61 
62  virtual bool side_time_derivative (bool request_jacobian,
63  DiffContext & context);
64 
65  // Mass matrix part
66  virtual bool mass_residual (bool request_jacobian,
67  DiffContext & context);
68 
69  void set_dim(unsigned int dim) { _dim = dim; }
70 
71  void set_fe_type(const FEType & fe_type) { _fe_type = fe_type; }
72 
73 private:
74 
75  unsigned int _dim;
76 
78 
79  // Indices for each variable;
80  unsigned int _u_var, _v_var, _w_var;
81 
83 
84  Real kronecker_delta(unsigned int i, unsigned int j)
85  {
86  return i == j ? 1. : 0.;
87  }
88 
89  Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l);
90 };
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Definition: fe_type.h:196
boundary_id_type boundary_id_min_x
This is the EquationSystems class.
const boundary_id_type edge_boundary_id
This class provides all data required for a physics package (e.g.
Definition: diff_context.h:55
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
Definition: assembly.C:43
boundary_id_type boundary_id_max_z
unsigned int dim
void set_dim(unsigned int dim)
The libMesh namespace provides an interface to certain functionality in the library.
boundary_id_type boundary_id_max_y
This class provides a specific system class.
Definition: fem_system.h:53
int8_t boundary_id_type
Definition: id_types.h:51
const boundary_id_type node_boundary_id
ElasticitySystem(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
void set_fe_type(const FEType &fe_type)
const boundary_id_type pressure_boundary_id
boundary_id_type boundary_id_max_x
boundary_id_type boundary_id_min_z
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const boundary_id_type fixed_u_boundary_id
boundary_id_type boundary_id_min_y
static const boundary_id_type & traction_boundary_id
Real kronecker_delta(unsigned int i, unsigned int j)
const boundary_id_type fixed_v_boundary_id
unsigned int _w_var