Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
kin2DQuad4.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 6: pages 549-55,
25 // (Table 6.5), Prentice-Hall, 1996.
26 //
27 // Description:
30 //------------------------------------------------------------------------------
31 
32 #ifndef _KIN2DQUAD4_HPP_
33 #define _KIN2DQUAD4_HPP_
34 
35 #include <map>
36 #include <memory>
37 #include <string>
38 #include <Eigen/Dense>
39 
40 #include "Node.hpp"
41 #include "Load.hpp"
42 #include "Material.hpp"
43 #include "Element.hpp"
44 #include "QuadratureRule.hpp"
45 #include "Damping.hpp"
46 
54 class kin2DQuad4 : public Element{
55 
56  public:
65  kin2DQuad4(const std::vector<unsigned int> nodes, std::unique_ptr<Material> &material, const double th, const std::string quadrature="GAUSS", const unsigned int nGauss=4);
66 
68  ~kin2DQuad4();
69 
72  void CommitState();
73 
76  void ReverseState();
77 
80  void InitialState();
81 
84  void UpdateState();
85 
90  void SetDomain(std::map<unsigned int, std::shared_ptr<Node> > &nodes);
91 
95  void SetDamping(const std::shared_ptr<Damping> &damping);
96 
99  std::vector<unsigned int> GetTotalDegreeOfFreedom() const;
100 
104  Eigen::MatrixXd GetStrain() const;
105 
109  Eigen::MatrixXd GetStress() const;
110 
114  Eigen::MatrixXd GetStrainRate() const;
115 
121  Eigen::MatrixXd GetStrainAt(double x3, double x2) const;
122 
128  Eigen::MatrixXd GetStressAt(double x3, double x2) const;
129 
134  Eigen::VectorXd GetVTKResponse(std::string response) const;
135 
138  double ComputeEnergy();
139 
144  Eigen::MatrixXd ComputeMassMatrix();
145 
150  Eigen::MatrixXd ComputeStiffnessMatrix();
151 
156  Eigen::MatrixXd ComputeDampingMatrix();
157 
162  Eigen::MatrixXd ComputePMLMatrix();
163 
168  Eigen::VectorXd ComputeInternalForces();
169 
174  Eigen::VectorXd ComputeInternalDynamicForces();
175 
182  Eigen::VectorXd ComputeSurfaceForces(const std::shared_ptr<Load> &surface, unsigned int face);
183 
190  Eigen::VectorXd ComputeBodyForces(const std::shared_ptr<Load> &body, unsigned int k=0);
191 
198  Eigen::VectorXd ComputeDomainReductionForces(const std::shared_ptr<Load> &drm, unsigned int k);
199 
200  protected:
204  Eigen::VectorXd TransformTensorToVector(const Eigen::MatrixXd &vector) const;
205 
209  Eigen::MatrixXd TransformVectorToTensor(const Eigen::VectorXd &vector) const;
210 
211  private:
213  double t;
214 
216  std::shared_ptr<Damping> theDamping;
217 
219  std::vector<std::shared_ptr<Node> > theNodes;
220 
222  std::vector<std::unique_ptr<Material> > theMaterial;
223 
225  std::unique_ptr<QuadratureRule> QuadraturePoints;
226 
232  Eigen::VectorXd ComputeStrain(const double ri, const double si, const Eigen::MatrixXd &Jij) const;
233 
239  Eigen::VectorXd ComputeStrainRate(const double ri, const double si, const Eigen::MatrixXd &Bij) const;
240 
245  Eigen::MatrixXd ComputeJacobianMatrix(const double ri, const double si) const;
246 
252  Eigen::MatrixXd ComputeDeformationGradientMatrix(const double ri, const double si, const Eigen::MatrixXd &Jij) const;
253 
256  Eigen::MatrixXd ComputeSecondPiolaKirchhoffMatrix(const Eigen::VectorXd &Stress) const;
257 
262  Eigen::MatrixXd ComputeShapeFunctionMatrix(const double ri, const double si) const;
263 
269  Eigen::MatrixXd ComputeLinearStrainDisplacementMatrix(const double ri, const double si, const Eigen::MatrixXd &Jij) const;
270 
276  Eigen::MatrixXd ComputeNonLinearStrainDisplacementMatrix(const double ri, const double si, const Eigen::MatrixXd &Jij) const;
277 
283  Eigen::MatrixXd ComputeLinearizedStrainDisplacementMatrix(const double ri, const double si, const Eigen::MatrixXd &Jij) const;
284 
288  Eigen::MatrixXd ComputeInitialStiffnessMatrix() const;
289 };
290 
291 #endif
Eigen::VectorXd ComputeInternalDynamicForces()
Compute the elastic, inertial, and viscous forces acting on the element.
Eigen::MatrixXd ComputeSecondPiolaKirchhoffMatrix(const Eigen::VectorXd &Stress) const
Compute the Second Piola-Kirchhoff Stress Tensor.
This file contains the "Load" class declarations, which defines a load that can act in a node or an e...
Eigen::VectorXd GetVTKResponse(std::string response) const
Gets the element internal response in VTK format for Paraview display.
Eigen::MatrixXd ComputeDeformationGradientMatrix(const double ri, const double si, const Eigen::MatrixXd &Jij) const
Computes the deformation gradient.
Eigen::MatrixXd TransformVectorToTensor(const Eigen::VectorXd &vector) const
Transform vector components into tensor.
kin2DQuad4(const std::vector< unsigned int > nodes, std::unique_ptr< Material > &material, const double th, const std::string quadrature="GAUSS", const unsigned int nGauss=4)
Creates a kin2DQuad4 in a finite element Mesh.
Eigen::MatrixXd ComputeInitialStiffnessMatrix() const
Compute the initial stiffness matrix of the element using gauss-integration.
Eigen::MatrixXd GetStrainAt(double x3, double x2) const
Gets the material strain in section at coordinate (x3,x2).
void UpdateState()
Update the material states in the element.
Eigen::MatrixXd ComputeNonLinearStrainDisplacementMatrix(const double ri, const double si, const Eigen::MatrixXd &Jij) const
Evaluates the strain-displacement matrix at a given Gauss point.
void InitialState()
Brings the material/section state to its initial state in this element.
This file contains the abstract "Material object" declarations, which computes the strain...
Eigen::MatrixXd GetStrain() const
Gets the material/section (generalised) strain.
Class for creating a 2D finite kinematic four-node quadrilateral element in a mesh.
Definition: kin2DQuad4.hpp:54
Eigen::VectorXd ComputeStrainRate(const double ri, const double si, const Eigen::MatrixXd &Bij) const
Update strain rate in the element.
void SetDamping(const std::shared_ptr< Damping > &damping)
Sets the damping model.
Eigen::MatrixXd ComputeLinearStrainDisplacementMatrix(const double ri, const double si, const Eigen::MatrixXd &Jij) const
Evaluates the strain-displacement matrix at a given Gauss point.
~kin2DQuad4()
Destroys this kin2DQuad4 object.
std::vector< std::unique_ptr< Material > > theMaterial
The Element&#39;s material.
Definition: kin2DQuad4.hpp:222
Eigen::VectorXd TransformTensorToVector(const Eigen::MatrixXd &vector) const
Transform tensor components into vector.
Eigen::VectorXd ComputeBodyForces(const std::shared_ptr< Load > &body, unsigned int k=0)
Compute the body forces acting on the element.
Eigen::VectorXd ComputeInternalForces()
Compute the internal (elastic) forces acting on the element.
Eigen::MatrixXd GetStrainRate() const
Gets the material/section (generalised) strain-rate.
Eigen::MatrixXd ComputeMassMatrix()
Compute the lumped/consistent mass matrix of the element.
Eigen::MatrixXd ComputePMLMatrix()
Compute the PML history matrix using gauss-integration.
Eigen::MatrixXd ComputeShapeFunctionMatrix(const double ri, const double si) const
Evaluates the shape function matrix at a given Gauss point.
Eigen::MatrixXd GetStressAt(double x3, double x2) const
Gets the material stress in section at coordinate (x3,x2).
double ComputeEnergy()
Computes the element energy for a given deformation.
Virtual class for creating an element in a mesh.
Definition: Element.hpp:51
Eigen::MatrixXd ComputeJacobianMatrix(const double ri, const double si) const
Computes the jacobian of the transformation.
double t
Element thickness.
Definition: kin2DQuad4.hpp:213
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-...
std::shared_ptr< Damping > theDamping
The Damping model.
Definition: kin2DQuad4.hpp:216
void ReverseState()
Reverse the material/section states to previous converged state in this element.
void CommitState()
Save the material states in the element.
Eigen::MatrixXd ComputeDampingMatrix()
Compute the damping matrix of the element using gauss-integration.
Eigen::MatrixXd ComputeStiffnessMatrix()
Compute the stiffness matrix of the element using gauss-integration.
void SetDomain(std::map< unsigned int, std::shared_ptr< Node > > &nodes)
Sets the finite element dependance among objects.
Eigen::VectorXd ComputeSurfaceForces(const std::shared_ptr< Load > &surface, unsigned int face)
Compute the surface forces acting on the element.
Eigen::VectorXd ComputeDomainReductionForces(const std::shared_ptr< Load > &drm, unsigned int k)
Compute the domain reduction forces acting on the element.
std::vector< std::shared_ptr< Node > > theNodes
The Element&#39;s Nodes.
Definition: kin2DQuad4.hpp:219
Eigen::MatrixXd GetStress() const
Gets the material/section (generalised) stress.
Eigen::MatrixXd ComputeLinearizedStrainDisplacementMatrix(const double ri, const double si, const Eigen::MatrixXd &Jij) const
Evaluates the linearized (small strain) strain-displacement matrix at a given Gauss point...
Eigen::VectorXd ComputeStrain(const double ri, const double si, const Eigen::MatrixXd &Jij) const
Update strain in the element.
This file contains the abstract "Quadrature Rule" declarations to integrate quantities in the iso-par...
std::unique_ptr< QuadratureRule > QuadraturePoints
Coordinate of Gauss points.
Definition: kin2DQuad4.hpp:225
std::vector< unsigned int > GetTotalDegreeOfFreedom() const
Gets the list of total-degree of freedom of this Element.
This file contains the "Element" object declarations, which defines an element in a finite element me...