Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
Node.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 _NODE_HPP_
33 #define _NODE_HPP_
34 
35 #include <map>
36 #include <vector>
37 #include <Eigen/Dense>
38 
46 class Node{
47 
48  public:
56  Node(unsigned int numberDofs, Eigen::VectorXd coordinates, bool isFixed);
57 
59  ~Node();
60 
63  bool IsFixed() const;
64 
66  void InitialState();
67 
72  void SetMass(Eigen::VectorXd &mass);
73 
78  void SetAsFixed(bool isFixed);
79 
84  void SetReaction(Eigen::VectorXd &reaction);
85 
89  void SetProgressiveForces(Eigen::VectorXd &force);
90 
95  void SetCoordinates(Eigen::VectorXd &coordinates);
96 
101  void SetFreeDegreeOfFreedom(std::vector<int> &freeDOF);
102 
107  void SetTotalDegreeOfFreedom(std::vector<int> &totalDOF);
108 
112  void SetDisplacements(Eigen::VectorXd &Uo);
113 
117  void SetVelocities(Eigen::VectorXd &Vo);
118 
122  void SetAccelerations(Eigen::VectorXd &Ao);
123 
128  void SetIncrementalDisplacements(Eigen::VectorXd &dU);
129 
133  void SetDomainReductionMotion(Eigen::MatrixXd &Uo);
134 
138  void SetPMLVector(Eigen::VectorXd &Ub);
139 
144  void SetSupportMotion(unsigned int k, std::vector<double> &Uo);
145 
148  void DelSupportMotion();
149 
154  Eigen::VectorXd GetMass() const;
155 
159  Eigen::VectorXd GetReaction() const;
160 
165  const Eigen::VectorXd& GetCoordinates() const;
166 
170  const Eigen::VectorXd& GetDisplacements() const;
171 
175  const Eigen::VectorXd& GetVelocities() const;
176 
180  const Eigen::VectorXd& GetAccelerations() const;
181 
185  Eigen::VectorXd GetInertialForces() const;
186 
190  const Eigen::VectorXd& GetProgressiveForces() const;
191 
195  const Eigen::VectorXd& GetPMLVector() const;
196 
200  const Eigen::VectorXd& GetIncrementalDisplacements() const;
201 
207  Eigen::VectorXd GetDomainReductionMotion(unsigned int k) const;
208 
213  Eigen::VectorXd GetSupportMotion(unsigned int k);
214 
218  unsigned int GetNumberOfSupportMotion();
219 
223  unsigned int GetNumberOfDegreeOfFreedom() const;
224 
229  const std::vector<int>& GetFreeDegreeOfFreedom() const;
230 
235  const std::vector<int>& GetTotalDegreeOfFreedom() const;
236 
237  private:
238  //The node condition.
239  bool Fixed;
240 
243 
245  Eigen::VectorXd Coordinates;
246 
248  Eigen::VectorXd Displacements;
249 
251  Eigen::VectorXd Velocities;
252 
254  Eigen::VectorXd Accelerations;
255 
257  Eigen::VectorXd IncrementalDisplacements;
258 
260  Eigen::MatrixXd DomainReductionMotion;
261 
263  Eigen::VectorXd Mass;
264 
266  Eigen::VectorXd Reaction;
267 
269  Eigen::VectorXd CumulatedForce;
270 
272  Eigen::VectorXd PMLIntegratedVector;
273 
275  std::vector<int> FreeDegreeOfFreedom;
276 
278  std::vector<int> TotalDegreeOfFreedom;
279 
281  std::map<unsigned int, std::vector<double> > SupportMotion;
282 };
283 
284 #endif
Eigen::VectorXd GetReaction() const
Gets the node reaction force.
void SetAccelerations(Eigen::VectorXd &Ao)
Sets the current acceleration state associated with this Node.
void SetProgressiveForces(Eigen::VectorXd &force)
Sets the external force from previous analysis.
const Eigen::VectorXd & GetPMLVector() const
Gets the current PML history vector of this node.
void SetIncrementalDisplacements(Eigen::VectorXd &dU)
Sets the current incremental displacement associated with this Node.
bool IsFixed() const
Whether the node is fixed or free.
void SetFreeDegreeOfFreedom(std::vector< int > &freeDOF)
Set the free degree of freedom number list for this Node.
unsigned int GetNumberOfDegreeOfFreedom() const
Gets the number of degree-of-freedom of this node.
Eigen::VectorXd CumulatedForce
The external force from previous analysis.
Definition: Node.hpp:269
Class for creating a node in space that handles coordinates, state variables, free and total degrees-...
Definition: Node.hpp:46
void SetCoordinates(Eigen::VectorXd &coordinates)
Set the node&#39;s position in a finite element Mesh.
const Eigen::VectorXd & GetIncrementalDisplacements() const
Gets the current incremental displacement of this node.
void SetSupportMotion(unsigned int k, std::vector< double > &Uo)
Sets the displacements support motion associated with this Node.
Eigen::VectorXd Velocities
The current velocity vector of this Node.
Definition: Node.hpp:251
Eigen::VectorXd GetInertialForces() const
Returns the inertial forces associated to this node.
const std::vector< int > & GetTotalDegreeOfFreedom() const
Gets the node&#39;s total degree of freedom as a vector.
void SetVelocities(Eigen::VectorXd &Vo)
Sets the current velocity state associated with this Node.
void SetMass(Eigen::VectorXd &mass)
Set the node&#39;s mass at each degree of freedom.
void SetDomainReductionMotion(Eigen::MatrixXd &Uo)
Sets the domain-reduction nodal displacements.
Eigen::VectorXd Reaction
The reaction forces of this node.
Definition: Node.hpp:266
const Eigen::VectorXd & GetDisplacements() const
Gets the current displacement state of this node.
std::vector< int > TotalDegreeOfFreedom
The total-degree-of-freedom list.
Definition: Node.hpp:278
Eigen::VectorXd Coordinates
The location of this node within the Mesh..
Definition: Node.hpp:245
void SetTotalDegreeOfFreedom(std::vector< int > &totalDOF)
Set the global degree of freedom number list for this Node.
void SetDisplacements(Eigen::VectorXd &Uo)
Sets the vector of displacement associated with this Node.
std::map< unsigned int, std::vector< double > > SupportMotion
The imposed nodal support motion displacements.
Definition: Node.hpp:281
const Eigen::VectorXd & GetAccelerations() const
Gets the current acceleration state of this node.
const Eigen::VectorXd & GetProgressiveForces() const
Returns the external force from previous analysis.
Eigen::MatrixXd DomainReductionMotion
The imposed domain-reduction nodal displacements, velocity and acceleration.
Definition: Node.hpp:260
Eigen::VectorXd GetMass() const
Gets the node&#39;s mass as a vector.
void SetPMLVector(Eigen::VectorXd &Ub)
Sets the vector of absorbent integrated history values.
void SetReaction(Eigen::VectorXd &reaction)
Sets the current reaction force of this node.
Eigen::VectorXd PMLIntegratedVector
The 3D perfectly-matched history vector.
Definition: Node.hpp:272
Node(unsigned int numberDofs, Eigen::VectorXd coordinates, bool isFixed)
Creates a Node in a finite element Mesh.
unsigned int GetNumberOfSupportMotion()
Gets the number of degree-of-freedom with support motion in this node.
const Eigen::VectorXd & GetVelocities() const
Gets the current velocity state of this node.
~Node()
Destroys this Node object.
std::vector< int > FreeDegreeOfFreedom
The free-degree-of-freedom list.
Definition: Node.hpp:275
void InitialState()
Set all node variables to be zero.
Eigen::VectorXd GetDomainReductionMotion(unsigned int k) const
Gets the current domain reduction displacements, velocities and accelerations.
Eigen::VectorXd Mass
The applied mass of this Node.
Definition: Node.hpp:263
void SetAsFixed(bool isFixed)
Set the node&#39;s restrain condition.
const std::vector< int > & GetFreeDegreeOfFreedom() const
Gets the node&#39;s restrained degree of freedom as a vector.
Eigen::VectorXd IncrementalDisplacements
The current incremental displacement vector of Node.
Definition: Node.hpp:257
Eigen::VectorXd GetSupportMotion(unsigned int k)
Gets the nodal support motion displacement of this node.
void DelSupportMotion()
Remove the displacements support motion associated with this Node.
Eigen::VectorXd Accelerations
The current acceleration vectors of this Node.
Definition: Node.hpp:254
Eigen::VectorXd Displacements
The current displacement vector of this Node.
Definition: Node.hpp:248
const Eigen::VectorXd & GetCoordinates() const
Gets the node&#39;s coordinate as a vector.
unsigned int NumberOfDegreeOfFreedom
Number of Degree of Freedom:
Definition: Node.hpp:242
bool Fixed
Definition: Node.hpp:239