Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
Assembler.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:
30 //------------------------------------------------------------------------------
31 
32 #ifndef _ASSEMBLER_HPP_
33 #define _ASSEMBLER_HPP_
34 
35 #include <vector>
36 #include <memory>
37 #include <Eigen/Dense>
38 #include <Eigen/SparseCore>
39 
40 #include "Mesh.hpp"
41 #include "LoadCombo.hpp"
42 
50 class Assembler{
51 
52  public:
55  Assembler();
56 
58  ~Assembler();
59 
62  void SetMassTolerance(double tol);
63 
66  void SetForceTolerance(double tol);
67 
70  void SetStiffnessTolerance(double tol);
71 
74  void SetLoadCombination(std::shared_ptr<LoadCombo> &combo);
75 
81  Eigen::SparseMatrix<double> ComputeMassMatrix(std::shared_ptr<Mesh> &mesh);
82 
88  Eigen::SparseMatrix<double> ComputeStiffnessMatrix(std::shared_ptr<Mesh> &mesh);
89 
95  Eigen::SparseMatrix<double> ComputeDampingMatrix(std::shared_ptr<Mesh> &mesh);
96 
102  Eigen::SparseMatrix<double> ComputePMLHistoryMatrix(std::shared_ptr<Mesh> &mesh);
103 
109  Eigen::VectorXd ComputeProgressiveForceVector(std::shared_ptr<Mesh> &mesh);
110 
115  Eigen::VectorXd ComputeInternalForceVector(std::shared_ptr<Mesh> &mesh);
116 
121  Eigen::VectorXd ComputeDynamicInternalForceVector(std::shared_ptr<Mesh> &mesh);
122 
129  Eigen::VectorXd ComputeExternalForceVector(std::shared_ptr<Mesh> &mesh, unsigned int k);
130 
136  Eigen::VectorXd ComputeSupportMotionIncrement(std::shared_ptr<Mesh> &mesh, unsigned int k);
137 
142  Eigen::VectorXd ComputePMLHistoryVector(std::shared_ptr<Mesh> &mesh);
143 
144  protected:
149  void AddNodeInertiaForces(std::shared_ptr<Mesh> &mesh, Eigen::VectorXd &DynamicForces);
150 
155  void AddElementDynamicForces(std::shared_ptr<Mesh> &mesh, Eigen::VectorXd &DynamicForces);
156 
161  void AssembleNodalMass(std::shared_ptr<Mesh> &mesh, Eigen::SparseMatrix<double>& nodemass);
162 
167  void AssembleElementMass(std::shared_ptr<Mesh> &mesh, Eigen::SparseMatrix<double>& elemmass);
168 
169  private:
172 
175 
178 
180  std::shared_ptr<LoadCombo> LoadCombination;
181 };
182 
183 #endif
Eigen::SparseMatrix< double > ComputeStiffnessMatrix(std::shared_ptr< Mesh > &mesh)
Assemble the stiffness matrix.
void AddNodeInertiaForces(std::shared_ptr< Mesh > &mesh, Eigen::VectorXd &DynamicForces)
Adds the inertial forces contribution associated to the nodes.
void AssembleNodalMass(std::shared_ptr< Mesh > &mesh, Eigen::SparseMatrix< double > &nodemass)
Assemble Nodal Mass matrix.
Eigen::VectorXd ComputeProgressiveForceVector(std::shared_ptr< Mesh > &mesh)
Assemble the external force vector accumulated from previous analyses.
Eigen::VectorXd ComputeInternalForceVector(std::shared_ptr< Mesh > &mesh)
Assemble the internal force vector.
Eigen::VectorXd ComputeDynamicInternalForceVector(std::shared_ptr< Mesh > &mesh)
Assemble the internal elastic, inertial, and viscous force vector.
Eigen::VectorXd ComputeSupportMotionIncrement(std::shared_ptr< Mesh > &mesh, unsigned int k)
Assemble the support motion displacement vector.
Eigen::VectorXd ComputePMLHistoryVector(std::shared_ptr< Mesh > &mesh)
Assemble the integrated history vector for Perfectly-Matched Layer (PML).
This file contains the "Load Combination" class declarations, which defines how the loads are going t...
double ForceTolerance
Define stiffness tolerance.
Definition: Assembler.hpp:177
double StiffnessTolerance
Define stiffness tolerance.
Definition: Assembler.hpp:174
void SetLoadCombination(std::shared_ptr< LoadCombo > &combo)
Sets the load combination to be used.
Eigen::SparseMatrix< double > ComputeDampingMatrix(std::shared_ptr< Mesh > &mesh)
Assemble the stiffness matrix.
void AddElementDynamicForces(std::shared_ptr< Mesh > &mesh, Eigen::VectorXd &DynamicForces)
Adds the elastic, inertial, and viscous forces associated to the elements.
Assembler()
Creates an Assembler object.
double MassTolerance
Define mass tolerance.
Definition: Assembler.hpp:171
Eigen::SparseMatrix< double > ComputeMassMatrix(std::shared_ptr< Mesh > &mesh)
Assemble the mass matrix.
~Assembler()
Destroys this Assembler object.
void SetStiffnessTolerance(double tol)
Set the stiffness assembly allowed tolerance.
This file contains the "Mesh object" declarations, which stores nodes, materials, elements...
Class for assembling the finite element matrices and vector.
Definition: Assembler.hpp:50
Eigen::VectorXd ComputeExternalForceVector(std::shared_ptr< Mesh > &mesh, unsigned int k)
Assemble the external force vector.
void SetForceTolerance(double tol)
Set the mass assembly allowed tolerance.
Eigen::SparseMatrix< double > ComputePMLHistoryMatrix(std::shared_ptr< Mesh > &mesh)
Assemble the integrated history matrix for Perfectly-Matched Layer (PML).
void AssembleElementMass(std::shared_ptr< Mesh > &mesh, Eigen::SparseMatrix< double > &elemmass)
Assemble Element Mass matrix.
std::shared_ptr< LoadCombo > LoadCombination
Load combination number.
Definition: Assembler.hpp:180
void SetMassTolerance(double tol)
Set the mass assembly allowed tolerance.