Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
Analysis.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 _ANALYSIS_HPP_
32 #define _ANALYSIS_HPP_
33 
34 #include <mpi.h>
35 #include <ctime>
36 #include <memory>
37 #include <iostream>
38 #include <algorithm>
39 
40 #include "Mesh.hpp"
41 #include "Recorder.hpp"
42 #include "LoadCombo.hpp"
43 #include "Integrator.hpp"
44 
52 class Analysis{
53 
54  public:
58  Analysis(std::shared_ptr<LoadCombo> &loadcombo, unsigned int nteps);
59 
61  virtual ~Analysis() = 0;
62 
65  virtual bool Analyze() = 0;
66 
71  void UpdateMesh(std::shared_ptr<Mesh> &mesh, std::shared_ptr<Integrator> &integrator);
72 
76  void SetRecorder(std::shared_ptr<Recorder> &recorder);
77 
80  std::string GetCombinationName();
81 
86  void ReducedParallelReaction(Eigen::VectorXd &Reaction);
87 
88  protected:
92  void StartRecorders(std::shared_ptr<Mesh> &mesh, unsigned int nsteps);
93 
97  void WriteRecorders(std::shared_ptr<Mesh> &mesh, unsigned int step);
98 
100  void EndRecorders();
101 
104  void PrintProgress(unsigned int percent);
105 
106  private:
108  unsigned int NumberOfSteps;
109 
111  std::shared_ptr<LoadCombo> theLoadCombo;
112 
114  std::vector<std::unique_ptr<Recorder> > theRecorders;
115 };
116 
117 #endif
void WriteRecorders(std::shared_ptr< Mesh > &mesh, unsigned int step)
Writes information on the recorders.
unsigned int NumberOfSteps
Total number of time increments.
Definition: Analysis.hpp:108
This file contains the "Load Combination" class declarations, which defines how the loads are going t...
void EndRecorders()
Finalize recorder.
Analysis(std::shared_ptr< LoadCombo > &loadcombo, unsigned int nteps)
Creates a Analysis object.
This file contains the "Recorder object" declarations, for which Node, Element, Section responses are...
std::string GetCombinationName()
Returns the combination name.
std::shared_ptr< LoadCombo > theLoadCombo
The load combination to be used.
Definition: Analysis.hpp:111
void StartRecorders(std::shared_ptr< Mesh > &mesh, unsigned int nsteps)
Initialize recorder.
void PrintProgress(unsigned int percent)
Prints out solving bar for the analysis.
virtual ~Analysis()=0
Destroys this Analysis object.
void UpdateMesh(std::shared_ptr< Mesh > &mesh, std::shared_ptr< Integrator > &integrator)
Update internal variables in Mesh according to form of simulation.
Virtual class for defining the analysis type to be performed.
Definition: Analysis.hpp:52
This file contains the "Integrator object" declarations, and defines how the dynamic solution between...
void SetRecorder(std::shared_ptr< Recorder > &recorder)
Sets the recorder for the analysis.
void ReducedParallelReaction(Eigen::VectorXd &Reaction)
Construct the reaction vector force from each processor.
virtual bool Analyze()=0
Performs the required analysis on the domain.
This file contains the "Mesh object" declarations, which stores nodes, materials, elements...
std::vector< std::unique_ptr< Recorder > > theRecorders
The recorder associated to analysis.
Definition: Analysis.hpp:114