CArl
Code Arlequin / C++ implementation
common_assemble_functions_elasticity_3D.h
Go to the documentation of this file.
1 /*
2  * common_functions_elasticity_3D.h
3  *
4  * Created on: Apr 17, 2017
5  * Author: Thiago Milanetto Schlittler
6  */
7 
8 #ifndef COMMON_FUNCTIONS_ELASTICITY_3D_H_
9 #define COMMON_FUNCTIONS_ELASTICITY_3D_H_
10 
13 
15 class border_displacement_function : public libMesh::FunctionBase<libMesh::Number>
16 {
17  private:
18  const unsigned int _u_var, _v_var, _w_var;
19  const libMesh::Real _x_displ, _y_displ, _z_displ;
20 
21  public:
22  border_displacement_function ( unsigned int u_var,
23  unsigned int v_var,
24  unsigned int w_var,
25  libMesh::Real x_displ = 0,
26  libMesh::Real y_displ = 0,
27  libMesh::Real z_displ = 0)
28  : _u_var(u_var),
29  _v_var(v_var),
30  _w_var(w_var),
31  _x_displ(x_displ),
32  _y_displ(y_displ),
33  _z_displ(z_displ)
34  {
35  this->_initialized = true;
36  }
37 
38  virtual libMesh::Number operator() (const libMesh::Point&, const libMesh::Real = 0)
39  {
40  libmesh_not_implemented();
41  }
42 
43  virtual void operator() ( const libMesh::Point& p,
44  const libMesh::Real,
45  libMesh::DenseVector<libMesh::Number>& output)
46  {
47  output.resize(3);
48  output.zero();
49 
50  output(_u_var) = _x_displ;
51  output(_v_var) = _y_displ;
52  output(_w_var) = _z_displ;
53  }
54 
55  virtual libMesh::UniquePtr<FunctionBase<libMesh::Number> > clone() const
56  {
57  return libMesh::UniquePtr<FunctionBase<libMesh::Number> >
58  (new border_displacement_function( _u_var, _v_var, _w_var,
59  _x_displ, _y_displ, _z_displ));
60  }
61 };
62 
65 {
66  double x_displ;
67  double y_displ;
68  double z_displ;
69 };
70 
72 void set_displaced_border_translation(libMesh::ImplicitSystem& elasticity_system, border_displacement_values& displ, int boundary_id);
73 
75 void set_clamped_border(libMesh::ImplicitSystem& elasticity_system, int boundary_id);
76 
78 libMesh::ExplicitSystem& add_stress(libMesh::EquationSystems& input_systems);
79 
81 libMesh::LinearImplicitSystem& add_elasticity( libMesh::EquationSystems& input_systems,
82  libMesh::Order order = libMesh::FIRST,
83  libMesh::FEFamily family = libMesh::LAGRANGE);
84 
85 #endif /* COMMON_FUNCTIONS_ELASTICITY_3D_H_ */
virtual libMesh::UniquePtr< FunctionBase< libMesh::Number > > clone() const
Small structure with the 3D border displacement values.
3D border displacement class, derived from libMesh::FunctionBase.
libMesh::LinearImplicitSystem & add_elasticity(libMesh::EquationSystems &input_systems, libMesh::Order order=libMesh::FIRST, libMesh::FEFamily family=libMesh::LAGRANGE)
Add a linear elasticity libMesh::LinearImplicitSystem to the input libMesh::EquationSystems& input_sy...
void set_clamped_border(libMesh::ImplicitSystem &elasticity_system, int boundary_id)
Set a clamped border.
border_displacement_function(unsigned int u_var, unsigned int v_var, unsigned int w_var, libMesh::Real x_displ=0, libMesh::Real y_displ=0, libMesh::Real z_displ=0)
virtual libMesh::Number operator()(const libMesh::Point &, const libMesh::Real=0)
void set_displaced_border_translation(libMesh::ImplicitSystem &elasticity_system, border_displacement_values &displ, int boundary_id)
Set a displacement border.
libMesh::ExplicitSystem & add_stress(libMesh::EquationSystems &input_systems)
Add a stress libMesh::ExplicitSystem to the input libMesh::EquationSystems.