Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
kin2DFrame2.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // Seismo Virtual Laboratory
4 // Module for Serial and Parallel Analysis of seismic
5 // wave propagation and soil-structure interaction simulation
6 // Copyright (C) 2018-2021, The California Institute of Technology
7 // All Rights Reserved.
8 //
9 // Commercial use of this program without express permission of the California
10 // Institute of Technology, is strictly prohibited. See file "COPYRIGHT" in
11 // main directory for information on usage and redistribution, and for a
12 // DISCLAIMER OF ALL WARRANTIES.
13 //
14 //==============================================================================
15 //
16 // Written by:
17 // Danilo S. Kusanovic (dkusanov@caltech.edu)
18 // Elnaz E. Seylabi (elnaze@unr.edu)
19 //
20 // Supervised by:
21 // Domniki M. Asimaki (domniki@caltech.edu)
22 //
23 // References :
24 // [1] Finite Element Procedures, Bathe, K.J., Chapter 5: pages 400-408.
25 // Prentice-Hall, 1996.
26 // [2] 2D Co-rotational Beam Formulation, Louie L. Yaw, E. F. Cross School of
27 // Engineering, Walla Walla University, November 30, 2009.
28 //
29 // Description:
32 //------------------------------------------------------------------------------
33 
34 #ifndef _KIN2DFRAME2_HPP_
35 #define _KIN2DFRAME2_HPP_
36 
37 #include <map>
38 #include <memory>
39 #include <string>
40 #include <Eigen/Dense>
41 
42 #include "Node.hpp"
43 #include "Load.hpp"
44 #include "Section.hpp"
45 #include "Element.hpp"
46 #include "Damping.hpp"
47 
55 class kin2DFrame2 : public Element{
56 
57  public:
64  kin2DFrame2(const std::vector<unsigned int> nodes, std::unique_ptr<Section> &section);
65 
67  ~kin2DFrame2();
68 
71  void CommitState();
72 
75  void ReverseState();
76 
79  void InitialState();
80 
83  void UpdateState();
84 
89  void SetDomain(std::map<unsigned int, std::shared_ptr<Node> > &nodes);
90 
94  void SetDamping(const std::shared_ptr<Damping> &damping);
95 
98  std::vector<unsigned int> GetTotalDegreeOfFreedom() const;
99 
103  Eigen::MatrixXd GetStrain() const;
104 
108  Eigen::MatrixXd GetStress() const;
109 
113  Eigen::MatrixXd GetStrainRate() const;
114 
120  Eigen::MatrixXd GetStrainAt(double x3, double x2) const;
121 
127  Eigen::MatrixXd GetStressAt(double x3, double x2) const;
128 
133  Eigen::VectorXd GetVTKResponse(std::string response) const;
134 
137  double ComputeEnergy();
138 
143  Eigen::MatrixXd ComputeMassMatrix();
144 
149  Eigen::MatrixXd ComputeStiffnessMatrix();
150 
155  Eigen::MatrixXd ComputeDampingMatrix();
156 
161  Eigen::MatrixXd ComputePMLMatrix();
162 
167  Eigen::VectorXd ComputeInternalForces();
168 
173  Eigen::VectorXd ComputeInternalDynamicForces();
174 
181  Eigen::VectorXd ComputeSurfaceForces(const std::shared_ptr<Load> &surface, unsigned int face);
182 
189  Eigen::VectorXd ComputeBodyForces(const std::shared_ptr<Load> &body, unsigned int k=0);
190 
197  Eigen::VectorXd ComputeDomainReductionForces(const std::shared_ptr<Load> &drm, unsigned int k);
198 
199  private:
201  double Lo;
202 
204  double Alpha;
205 
207  std::shared_ptr<Damping> theDamping;
208 
210  std::vector<std::shared_ptr<Node> > theNodes;
211 
213  std::unique_ptr<Section> theSection;
214 
216  double ComputeLength() const;
217 
221  Eigen::MatrixXd ComputeLocalAxes() const;
222 
225  Eigen::VectorXd ComputeStrain() const;
226 
229  Eigen::VectorXd ComputeStrainRate() const;
230 
233  double ComputeAxialStrain() const;
234 
237  double ComputeAxialForce() const;
238 
242  Eigen::VectorXd ComputeBendingMoment() const;
243 
247  Eigen::VectorXd ComputeLocalForces() const;
248 
252  void ComputeLinearStrainDisplacementMatrix(Eigen::MatrixXd &B) const;
253 
259  void ComputeGeometricStrainDisplacementMatrix(Eigen::MatrixXd &B, Eigen::VectorXd &z, Eigen::VectorXd &r) const;
260 
264  Eigen::MatrixXd ComputeInitialStiffnessMatrix() const;
265 };
266 
267 #endif
Eigen::MatrixXd ComputeInitialStiffnessMatrix() const
Compute the initial stiffness matrix of the element.
Eigen::MatrixXd ComputeLocalAxes() const
Compute/update the local axis-1-2-3 of the element.
double Alpha
Angle of the element.
Definition: kin2DFrame2.hpp:204
Eigen::VectorXd GetVTKResponse(std::string response) const
Gets the element internal response in VTK format for Paraview display.
This file contains the "Load" class declarations, which defines a load that can act in a node or an e...
void UpdateState()
Update the material states in the element.
void SetDomain(std::map< unsigned int, std::shared_ptr< Node > > &nodes)
Sets the finite element dependance among objects.
~kin2DFrame2()
Destroys this kin3DTruss2 object.
void InitialState()
Brings the material/section state to its initial state in this element.
std::vector< std::shared_ptr< Node > > theNodes
The Element&#39;s Nodes.
Definition: kin2DFrame2.hpp:210
Eigen::MatrixXd GetStrainRate() const
Gets the material/section (generalised) strain-rate.
Eigen::VectorXd ComputeLocalForces() const
Computes the current axial and bending moments.
Eigen::MatrixXd GetStrain() const
Gets the material/section (generalised) strain.
std::shared_ptr< Damping > theDamping
The Damping model.
Definition: kin2DFrame2.hpp:207
Eigen::MatrixXd ComputeMassMatrix()
Compute the lumped/consistent mass matrix of the element.
Eigen::VectorXd ComputeDomainReductionForces(const std::shared_ptr< Load > &drm, unsigned int k)
Compute the domain reduction forces acting on the element.
This file contains the abstract "Section object" declarations, which computes the strain...
kin2DFrame2(const std::vector< unsigned int > nodes, std::unique_ptr< Section > &section)
Creates a kin2DFrame2 in a finite element Mesh.
Eigen::MatrixXd GetStressAt(double x3, double x2) const
Gets the material stress in section at coordinate (x3,x2).
Class for creating a 2D finite kinematic two-node frame element in a mesh.
Definition: kin2DFrame2.hpp:55
void SetDamping(const std::shared_ptr< Damping > &damping)
Sets the damping model.
Eigen::VectorXd ComputeInternalForces()
Compute the internal (elastic) forces acting on the element.
Eigen::VectorXd ComputeSurfaceForces(const std::shared_ptr< Load > &surface, unsigned int face)
Compute the surface forces acting on the element.
Eigen::VectorXd ComputeStrainRate() const
Update strain rate in the element.
double ComputeEnergy()
Computes the element energy for a given deformation.
double ComputeLength() const
Compute the current length of the element.
Eigen::MatrixXd ComputeDampingMatrix()
Compute the damping matrix of the element using gauss-integration.
Eigen::MatrixXd GetStress() const
Gets the material/section (generalised) stress.
void ReverseState()
Reverse the material/section states to previous converged state in this element.
Eigen::MatrixXd ComputeStiffnessMatrix()
Compute the stiffness matrix of the element using gauss-integration.
Virtual class for creating an element in a mesh.
Definition: Element.hpp:51
void ComputeGeometricStrainDisplacementMatrix(Eigen::MatrixXd &B, Eigen::VectorXd &z, Eigen::VectorXd &r) const
The Linear/Geometric Strain Displacement matrix:
Eigen::VectorXd ComputeBendingMoment() const
Computes the current bending moments.
This file contains the "Node object" declarations, which is stores the coordinates, state variables, degrees-of-freedom, and total-degree of freedom lists of a node in a finite element mesh.
This file contains the "Damping object" declarations to update damping matrix to account for Caughey-...
Eigen::VectorXd ComputeInternalDynamicForces()
Compute the elastic, inertial, and viscous forces acting on the element.
void ComputeLinearStrainDisplacementMatrix(Eigen::MatrixXd &B) const
The Linear Strain Displacement matrix:
std::unique_ptr< Section > theSection
The Element&#39;s Section.
Definition: kin2DFrame2.hpp:213
std::vector< unsigned int > GetTotalDegreeOfFreedom() const
Gets the list of total-degree of freedom of this Element.
void CommitState()
Save the material states in the element.
Eigen::MatrixXd GetStrainAt(double x3, double x2) const
Gets the material strain in section at coordinate (x3,x2).
double ComputeAxialForce() const
Computes the current axial force.
double ComputeAxialStrain() const
Computes the current axial strain.
Eigen::MatrixXd ComputePMLMatrix()
Compute the PML history matrix using gauss-integration.
Eigen::VectorXd ComputeStrain() const
Update strain in the element.
Eigen::VectorXd ComputeBodyForces(const std::shared_ptr< Load > &body, unsigned int k=0)
Compute the body forces acting on the element.
double Lo
Length of the element.
Definition: kin2DFrame2.hpp:201
This file contains the "Element" object declarations, which defines an element in a finite element me...