Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
ZeroLength1D.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]
25 //
26 // Description:
29 //------------------------------------------------------------------------------
30 
31 #ifndef _ZEROLENGTH1D_HPP_
32 #define _ZEROLENGTH1D_HPP_
33 
34 #include <map>
35 #include <memory>
36 #include <string>
37 #include <Eigen/Dense>
38 
39 #include "Node.hpp"
40 #include "Load.hpp"
41 #include "Material.hpp"
42 #include "Element.hpp"
43 #include "Damping.hpp"
44 
52 class ZeroLength1D : public Element{
53 
54  public:
61  ZeroLength1D(const std::vector<unsigned int> nodes, std::unique_ptr<Material> &material, const unsigned int dir);
62 
64  ~ZeroLength1D();
65 
68  void CommitState();
69 
72  void ReverseState();
73 
76  void InitialState();
77 
80  void UpdateState();
81 
86  void SetDomain(std::map<unsigned int, std::shared_ptr<Node> > &nodes);
87 
91  void SetDamping(const std::shared_ptr<Damping> &damping);
92 
95  std::vector<unsigned int> GetTotalDegreeOfFreedom() const;
96 
100  Eigen::MatrixXd GetStrain() const;
101 
105  Eigen::MatrixXd GetStress() const;
106 
110  Eigen::MatrixXd GetStrainRate() const;
111 
117  Eigen::MatrixXd GetStrainAt(double x3, double x2) const;
118 
124  Eigen::MatrixXd GetStressAt(double x3, double x2) const;
125 
130  Eigen::VectorXd GetVTKResponse(std::string response) const;
131 
134  double ComputeEnergy();
135 
140  Eigen::MatrixXd ComputeMassMatrix();
141 
146  Eigen::MatrixXd ComputeStiffnessMatrix();
147 
152  Eigen::MatrixXd ComputeDampingMatrix();
153 
158  Eigen::MatrixXd ComputePMLMatrix();
159 
164  Eigen::VectorXd ComputeInternalForces();
165 
170  Eigen::VectorXd ComputeInternalDynamicForces();
171 
178  Eigen::VectorXd ComputeSurfaceForces(const std::shared_ptr<Load> &surface, unsigned int face);
179 
186  Eigen::VectorXd ComputeBodyForces(const std::shared_ptr<Load> &body, unsigned int k=0);
187 
194  Eigen::VectorXd ComputeDomainReductionForces(const std::shared_ptr<Load> &drm, unsigned int k);
195 
196  private:
198  unsigned int theDirection;
199 
201  std::vector<std::shared_ptr<Node> > theNodes;
202 
204  std::unique_ptr<Material> theMaterial;
205 
208  Eigen::VectorXd ComputeStrain() const;
209 
212  Eigen::VectorXd ComputeStrainRate() const;
213 
217  Eigen::VectorXd ComputeLocalAxes() const;
218 };
219 
220 #endif
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.
This file contains the "Load" class declarations, which defines a load that can act in a node or an e...
Eigen::MatrixXd ComputeDampingMatrix()
Compute the damping matrix of the element using gauss-integration.
Eigen::VectorXd ComputeInternalDynamicForces()
Compute the elastic, inertial, and viscous forces acting on the element.
Eigen::MatrixXd GetStrainRate() const
Gets the material/section (generalised) strain-rate.
void CommitState()
Save the material states in the element.
Eigen::VectorXd ComputeBodyForces(const std::shared_ptr< Load > &body, unsigned int k=0)
Compute the body forces acting on the element.
This file contains the abstract "Material object" declarations, which computes the strain...
std::vector< std::shared_ptr< Node > > theNodes
The Element&#39;s Nodes.
Definition: ZeroLength1D.hpp:201
void SetDamping(const std::shared_ptr< Damping > &damping)
Sets the damping model.
Eigen::VectorXd ComputeDomainReductionForces(const std::shared_ptr< Load > &drm, unsigned int k)
Compute the domain reduction forces acting on the element.
ZeroLength1D(const std::vector< unsigned int > nodes, std::unique_ptr< Material > &material, const unsigned int dir)
Creates a ZeroLength1D in a finite element Mesh.
void SetDomain(std::map< unsigned int, std::shared_ptr< Node > > &nodes)
Sets the finite element dependance among objects.
unsigned int theDirection
The element direction in global coordinates.
Definition: ZeroLength1D.hpp:198
Eigen::VectorXd ComputeLocalAxes() const
Compute local axes.
void UpdateState()
Update the material states in the element.
Eigen::VectorXd ComputeInternalForces()
Compute the internal (elastic) forces acting on the element.
Eigen::MatrixXd GetStrainAt(double x3, double x2) const
Gets the material strain in section at coordinate (x3,x2).
Eigen::MatrixXd GetStrain() const
Gets the material/section (generalised) strain.
Eigen::VectorXd ComputeStrain() const
Update strain in the element:
void ReverseState()
Reverse the material/section states to previous converged state in this element.
Virtual class for creating an element in a mesh.
Definition: Element.hpp:51
Eigen::MatrixXd ComputeMassMatrix()
Compute the lumped/consistent mass matrix of the element.
void InitialState()
Brings the material/section state to its initial state in this element.
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.
Eigen::MatrixXd GetStress() const
Gets the material/section (generalised) stress.
std::vector< unsigned int > GetTotalDegreeOfFreedom() const
Gets the list of total-degree of freedom of this Element.
This file contains the "Damping object" declarations to update damping matrix to account for Caughey-...
Eigen::VectorXd ComputeStrainRate() const
Update stress in the element:
Eigen::VectorXd GetVTKResponse(std::string response) const
Gets the element internal response in VTK format for Paraview display.
Class for creating a 2D/3D two-node zero length element in a mesh.
Definition: ZeroLength1D.hpp:52
Eigen::MatrixXd ComputeStiffnessMatrix()
Compute the stiffness matrix of the element using gauss-integration.
Eigen::VectorXd ComputeSurfaceForces(const std::shared_ptr< Load > &surface, unsigned int face)
Compute the surface forces acting on the element.
~ZeroLength1D()
Destroys this ZeroLength1D object.
Eigen::MatrixXd ComputePMLMatrix()
Compute the PML history matrix using gauss-integration.
std::unique_ptr< Material > theMaterial
The Element&#39;s material.
Definition: ZeroLength1D.hpp:204
This file contains the "Element" object declarations, which defines an element in a finite element me...