libMesh
Loading...
Searching...
No Matches
elasticity_system.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 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
21using namespace libMesh;
22
23// boundary IDs
34
35// The Navier-Stokes system class.
36// FEMSystem, TimeSolver and NewtonSolver will handle most tasks,
37// but we must specify element residuals
39{
40public:
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
73private:
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};
unsigned int dim
virtual bool mass_residual(bool request_jacobian, DiffContext &context)
Subtracts a mass vector contribution on elem from elem_residual.
void set_dim(unsigned int dim)
void set_fe_type(const FEType &fe_type)
virtual void init_data()
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used.
virtual bool element_time_derivative(bool request_jacobian, DiffContext &context)
Adds the time derivative contribution on elem to elem_residual.
virtual bool side_time_derivative(bool request_jacobian, DiffContext &context)
Adds the time derivative contribution on side of elem to elem_residual.
Real kronecker_delta(unsigned int i, unsigned int j)
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
virtual void init_context(DiffContext &context)
ElasticitySystem(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
This class provides all data required for a physics package (e.g.
This is the EquationSystems class.
This class provides a specific system class.
Definition fem_system.h:55
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Definition fe_type.h:197
const boundary_id_type fixed_v_boundary_id
boundary_id_type boundary_id_max_x
boundary_id_type boundary_id_min_y
boundary_id_type boundary_id_max_z
static const boundary_id_type & traction_boundary_id
const boundary_id_type edge_boundary_id
const boundary_id_type pressure_boundary_id
const boundary_id_type node_boundary_id
boundary_id_type boundary_id_max_y
boundary_id_type boundary_id_min_z
const boundary_id_type fixed_u_boundary_id
boundary_id_type boundary_id_min_x
The libMesh namespace provides an interface to certain functionality in the library.
int8_t boundary_id_type
Definition id_types.h:51
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real