Difference between revisions of "Alternate Run Modes:Working with the GSSHA DLL Library"

From Gsshawiki
Jump to: navigation, search
(Created page with "= Working with the GSSHA DLL Library = == GSSHA SDK Files == The GSSHA installation files for 8.0 include several files that can be used for programmatic integration. {| c...")
 
 
Line 69: Line 69:
 
|-  
 
|-  
 
! GSSHA_BMI Class Methods !! Signature !! Description
 
! GSSHA_BMI Class Methods !! Signature !! Description
|- || ||
+
|-
 +
| ||    gssha_bmi(); ||
 +
|-
 +
| ||    gssha_bmi(gssha::gssha_bmi& gb); // copy constructor||
 +
|-
 +
| ||    gssha_bmi(gssha::mpi_setup* mpienvironment);||
 +
|-
 +
| ||    ~gssha_bmi();||
 +
|-
 +
| ||    virtual void Initialize(std::string config_file);||
 +
|-
 +
| ||    virtual void Update();||
 +
|-
 +
| ||    virtual void UpdateUntil(double time);||
 +
|-
 +
| ||    virtual void Finalize();||
 +
|-
 +
| ||    virtual std::string GetComponentName();||
 +
|-
 +
| ||    virtual int GetInputItemCount();||
 +
|-
 +
| ||    virtual int GetOutputItemCount();||
 +
|-
 +
| ||    virtual std::vector<std::string> GetInputVarNames();||
 +
|-
 +
| ||    virtual std::vector<std::string> GetOutputVarNames();||
 +
|-
 +
| ||    virtual int GetVarGrid(std::string name);||
 +
|-
 +
| ||    virtual std::string GetVarType(std::string name);||
 +
|-
 +
| ||    virtual std::string GetVarUnits(std::string name);||
 +
|-
 +
| ||    virtual int GetVarItemsize(std::string name);||
 +
|-
 +
| ||    virtual int GetVarNbytes(std::string name);||
 +
|-
 +
| ||    virtual std::string GetVarLocation(std::string name);||
 +
|-
 +
| ||    virtual double GetCurrentTime();||
 +
|-
 +
| ||    virtual double GetStartTime();||
 +
|-
 +
| ||    virtual double GetEndTime();||
 +
|-
 +
| ||    virtual std::string GetTimeUnits();||
 +
|-
 +
| ||    virtual double GetTimeStep();||
 +
|-
 +
| ||    virtual void GetValue(std::string name, void* dest);||
 +
|-
 +
| ||    virtual void* GetValuePtr(std::string name);||
 +
|-
 +
| ||    virtual void GetValueAtIndices(std::string name, void* dest, int* inds, int count);||
 +
|-
 +
| ||    virtual void SetValue(std::string name, void* src);||
 +
|-
 +
| ||    virtual void SetValueAtIndices(std::string name, int* inds, int count, void* src);||
 +
|-
 +
| ||    virtual int GetGridRank(const int grid);||
 +
|-
 +
| ||    virtual int GetGridSize(const int grid);||
 +
|-
 +
| ||    virtual std::string GetGridType(const int grid);||
 +
|-
 +
| ||    virtual void GetGridShape(const int grid, int* shape);||
 +
|-
 +
| ||    virtual void GetGridSpacing(const int grid, double* spacing);||
 +
|-
 +
| ||    virtual void GetGridOrigin(const int grid, double* origin);||
 +
|-
 +
| ||    virtual void GetGridX(const int grid, double* x);||
 +
|-
 +
| ||    virtual void GetGridY(const int grid, double* y);||
 +
|-
 +
| ||    virtual void GetGridZ(const int grid, double* z);||
 +
|-
 +
| ||    virtual int GetGridNodeCount(const int grid);||
 +
|-
 +
| ||    virtual int GetGridEdgeCount(const int grid);||
 +
|-
 +
| ||    virtual int GetGridFaceCount(const int grid);||
 +
|-
 +
| ||    virtual void GetGridEdgeNodes(const int grid, int* edge_nodes);||
 +
|-
 +
| ||    virtual void GetGridFaceEdges(const int grid, int* face_edges);||
 +
|-
 +
| ||    virtual void GetGridFaceNodes(const int grid, int* face_nodes);||
 +
|-
 +
| ||    virtual void GetGridNodesPerFace(const int grid, int* nodes_per_face);||
 
|}
 
|}
  

Latest revision as of 18:16, 9 December 2024

Working with the GSSHA DLL Library

GSSHA SDK Files

The GSSHA installation files for 8.0 include several files that can be used for programmatic integration.


File Description
GSSHAlib.dll GSSHA Dynamic Link Library
bmi.hxx BMI header file, used by GSSHA80.hpp
GSSHA80.hpp GSSHA simulation header file

GSSHA Library Classes and Functions

Class Description
gssha_sim The primary GSSHA simulation class
mpi_setup Used by GSSHA to manage OpenMP and MPI run modes
replace_io Used by GSSHA to manage the read replacement capabilities
observed_data Used by GSSHA to manage observed data used by calibration routines
run_results Used by GSSHA to manage the results of the simulation. Used by the calibration routines.
main_var_struct Holds most of the GSSHA simulation data
gssha_bmi BMI interface to the GSSHA simulation class


GSSHA_SIM Class Methods Signature Description
gssha_sim gssha_sim() Constructor; uses internal mpi_setup class
~gssha_sim ~gssha_sim() Destructor; called when the class is destroyed
main_gssha int main_gssha(const char* prj_name, gssha::run_results* calib_data, const char input[]) Method to run an entire GSSHA simulation from start to finish
main_gssha_init void main_gssha_init(const char* prj_name, gssha::run_results* calib_data, const char input[]) Initialize a GSSHA simulation, which reads the project file, allocated memory, and opens the output files
main_gssha_run_one_step void main_gssha_run_one_step() Run the GSSHA simulation for one pass through the main loop, which is for one timestep
main_gssha_run_standard void main_gssha_run_standard() Run the main simulation code until the normal timeline termination
main_gssha_finalize void main_gssha_finalize() Run the finalize routine, which writes out the final output files, closes the output files, and frees the internal memory
init_gssha bool init_gssha(const char* prj_name, gssha::run_results* calib_data, const char input[]) Same as main_gssha_init, but with C++ error handling routines
finalize_gssha bool finalize_gssha() Same as main_gssha_finalize, but with C++ error handling routines


GSSHA_BMI Class Methods Signature Description
gssha_bmi();
gssha_bmi(gssha::gssha_bmi& gb); // copy constructor
gssha_bmi(gssha::mpi_setup* mpienvironment);
~gssha_bmi();
virtual void Initialize(std::string config_file);
virtual void Update();
virtual void UpdateUntil(double time);
virtual void Finalize();
virtual std::string GetComponentName();
virtual int GetInputItemCount();
virtual int GetOutputItemCount();
virtual std::vector<std::string> GetInputVarNames();
virtual std::vector<std::string> GetOutputVarNames();
virtual int GetVarGrid(std::string name);
virtual std::string GetVarType(std::string name);
virtual std::string GetVarUnits(std::string name);
virtual int GetVarItemsize(std::string name);
virtual int GetVarNbytes(std::string name);
virtual std::string GetVarLocation(std::string name);
virtual double GetCurrentTime();
virtual double GetStartTime();
virtual double GetEndTime();
virtual std::string GetTimeUnits();
virtual double GetTimeStep();
virtual void GetValue(std::string name, void* dest);
virtual void* GetValuePtr(std::string name);
virtual void GetValueAtIndices(std::string name, void* dest, int* inds, int count);
virtual void SetValue(std::string name, void* src);
virtual void SetValueAtIndices(std::string name, int* inds, int count, void* src);
virtual int GetGridRank(const int grid);
virtual int GetGridSize(const int grid);
virtual std::string GetGridType(const int grid);
virtual void GetGridShape(const int grid, int* shape);
virtual void GetGridSpacing(const int grid, double* spacing);
virtual void GetGridOrigin(const int grid, double* origin);
virtual void GetGridX(const int grid, double* x);
virtual void GetGridY(const int grid, double* y);
virtual void GetGridZ(const int grid, double* z);
virtual int GetGridNodeCount(const int grid);
virtual int GetGridEdgeCount(const int grid);
virtual int GetGridFaceCount(const int grid);
virtual void GetGridEdgeNodes(const int grid, int* edge_nodes);
virtual void GetGridFaceEdges(const int grid, int* face_edges);
virtual void GetGridFaceNodes(const int grid, int* face_nodes);
virtual void GetGridNodesPerFace(const int grid, int* nodes_per_face);


GSSHA User's Manual

18 Alternate Run Modes
18.1     MPI and OpenMP Parallelization
18.2     Simulation Setup for Alternate Run Modes
18.3     Batch Mode Runs
18.4     Automated Calibration with Shuffled Complex Evolution
18.5     Monte Carlo Runs
18.6     ERDC Automated Model Calibration Software
   18.6.1     Efficient Local Search
   18.6.2     Multistart
   18.6.3     Trajectory Repulsion
   18.6.4     Effective and Efficient Stochastic Global Optimization
18.7     Inset Models
18.8     Working with the GSSHA DLL Library
18.9     Working with the GSSHA Python Interface