libMesh
elasticity_system.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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 // boundary IDs
22 #define BOUNDARY_ID_MIN_Z 0
23 #define BOUNDARY_ID_MIN_Y 1
24 #define BOUNDARY_ID_MAX_X 2
25 #define BOUNDARY_ID_MAX_Y 3
26 #define BOUNDARY_ID_MIN_X 4
27 #define BOUNDARY_ID_MAX_Z 5
28 #define NODE_BOUNDARY_ID 10
29 #define EDGE_BOUNDARY_ID 20
30 
31 using namespace libMesh;
32 
33 // The Navier-Stokes system class.
34 // FEMSystem, TimeSolver and NewtonSolver will handle most tasks,
35 // but we must specify element residuals
37 {
38 public:
39  // Constructor
41  const std::string & name_in,
42  const unsigned int number_in)
43  : FEMSystem(es, name_in, number_in),
44  _rho(1.0)
45  {}
46 
47  // System initialization
48  virtual void init_data ();
49 
50  // Context initialization
51  virtual void init_context(DiffContext & context);
52 
53  // Element residual and jacobian calculations
54  // Time dependent parts
55  virtual bool element_time_derivative (bool request_jacobian,
56  DiffContext & context);
57 
58  virtual bool side_time_derivative (bool request_jacobian,
59  DiffContext & context);
60 
61  // Mass matrix part
62  virtual bool mass_residual (bool request_jacobian,
63  DiffContext & context);
64 
65 private:
66 
67  // Indices for each variable;
68  unsigned int _u_var, _v_var, _w_var;
69 
71 
72  Real kronecker_delta(unsigned int i, unsigned int j)
73  {
74  return i == j ? 1. : 0.;
75  }
76 
77  Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l);
78 };
This is the EquationSystems class.
This class provides all data required for a physics package (e.g.
Definition: diff_context.h:54
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
Definition: assembly.C:38
The libMesh namespace provides an interface to certain functionality in the library.
This class provides a specific system class.
Definition: fem_system.h:53
ElasticitySystem(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real kronecker_delta(unsigned int i, unsigned int j)
unsigned int _w_var