RSTT: rstt/SLBM/include/GeoTessModelSLBM.h Source File

RSTT 3.1.0 Regional Seismic Travel Time

GeoTessModelSLBM.h
Go to the documentation of this file.
1 //- ****************************************************************************
2 //-
3 //- Copyright 2009 National Technology & Engineering Solutions of Sandia, LLC
4 //- (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
5 //- Government retains certain rights in this software.
6 //-
7 //- BSD Open Source License
8 //- All rights reserved.
9 //-
10 //- Redistribution and use in source and binary forms, with or without
11 //- modification, are permitted provided that the following conditions are met:
12 //-
13 //- 1. Redistributions of source code must retain the above copyright notice,
14 //- this list of conditions and the following disclaimer.
15 //-
16 //- 2. Redistributions in binary form must reproduce the above copyright
17 //- notice, this list of conditions and the following disclaimer in the
18 //- documentation and/or other materials provided with the distribution.
19 //-
20 //- 3. Neither the name of the copyright holder nor the names of its
21 //- contributors may be used to endorse or promote products derived from
22 //- this software without specific prior written permission.
23 //-
24 //- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 //- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 //- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 //- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28 //- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 //- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 //- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 //- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 //- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 //- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 //- POSSIBILITY OF SUCH DAMAGE.
35 //-
36 //- ****************************************************************************
37
38 #ifndef GEOTESSMODELSLBM_H_
39 #define GEOTESSMODELSLBM_H_
40
41 // **** _SYSTEM INCLUDES_ ******************************************************
42
43 #include <iostream>
44 #include <string>
45 #include <fstream>
46 #include <vector>
47 #include <map>
48
49 // use standard library objects
50
51 // **** _LOCAL INCLUDES_ *******************************************************
52
53 #include "SLBMGlobals.h"
54 #include "CPPGlobals.h"
55 #include "CPPUtils.h"
56 #include "GeoTessUtils.h"
57 #include "GeoTessException.h"
58 #include "GeoTessModel.h"
59 #include "GeoTessOptimizationType.h"
60 #include "Uncertainty.h"
61
62 using namespace geotess;
63 using namespace std;
64
65 // **** _BEGIN GEOTESS NAMESPACE_ **********************************************
66
67 namespace slbm
68 {
69
70 // **** _FORWARD REFERENCES_ ***************************************************
71
72
73 // **** _CLASS DEFINITION_ *****************************************************
74
82 class SLBM_EXP_IMP GeoTessModelSLBM : public GeoTessModel
83 {
84 private:
85
89 double averageMantleVelocity[2];
90
96 vector<vector<Uncertainty*> >& uncertainty;
97
101 bool ioUncertainty;
102
103 void init();
104
105 static bool newModelStyleReadFormat;
106
107 protected:
108
125 virtual void loadModelAscii(IFStreamAscii& input, const string& inputDirectory,
126 const string& relGridFilePath);
127
143 virtual void loadModelBinary(IFStreamBinary& input, const string& inputDirectory,
144 const string& relGridFilePath);
145
155 virtual void writeModelAscii(IFStreamAscii& output, const string& gridFileName);
156
166 virtual void writeModelBinary(IFStreamBinary& output, const string& gridFileName);
167
168 public:
169
174 virtual bool isPathDepUncModel()
175 {
176 return false;
177 }
178
179 static void setNewModelStyleReadFormat(bool omsrf)
180 {
181 newModelStyleReadFormat = omsrf;
182 }
183
192 GeoTessModelSLBM(vector<vector<Uncertainty*> >& uncert,
193 const GeoTessOptimizationType* optimization = &GeoTessOptimizationType::SPEED);
194
220 GeoTessModelSLBM(const string& modelInputFile, const string& relativeGridPath,
221 vector<vector<Uncertainty*> >& uncertainties,
222 const GeoTessOptimizationType* optimization = &GeoTessOptimizationType::SPEED);
223
240 GeoTessModelSLBM(const string& modelInputFile,
241 vector<vector<Uncertainty*> >& uncertainties,
242 const GeoTessOptimizationType* optimization = &GeoTessOptimizationType::SPEED);
243
277 GeoTessModelSLBM(const string& gridFileName, GeoTessMetaData* metaData,
278 vector<vector<Uncertainty*> >& uncertainties, double* avgMantleVel);
279
318 GeoTessModelSLBM(GeoTessGrid* grid, GeoTessMetaData* metaData,
319 vector<vector<Uncertainty*> >& uncertainties, double* avgMantleVel);
320
324 virtual ~GeoTessModelSLBM();
325
330 static string class_name() { return "GeoTessModelSLBM"; }
331
335 static bool isGeoTessModelSLBM(const string& fileName);
336
343 void writeModelDataBuffer(util::DataBuffer& buffer);
344
349 double getAverageMantleVelocity(const int &index) const
350 {
351 return averageMantleVelocity[index];
352 }
353
358 void setAverageMantleVelocity(const int &index, const double &velocity)
359 {
360 averageMantleVelocity[index]=velocity;
361 }
362
367 void setIOUncertainty(bool io) { ioUncertainty = io; }
368
369 bool isIOUncertainty() const {
370 return ioUncertainty;
371 }
372
373 int getBufferSize();
374
375 };
376 // end class GeoTessModelSLBM
377
378 }// end namespace geotess
379
380 #endif // GEOTESSMODELSLBM_H_
slbm::GeoTessModelSLBM::setAverageMantleVelocity
void setAverageMantleVelocity(const int &index, const double &velocity)
Definition: GeoTessModelSLBM.h:358
slbm::GeoTessModelSLBM::getBufferSize
int getBufferSize()
slbm::GeoTessModelSLBM::isGeoTessModelSLBM
static bool isGeoTessModelSLBM(const string &fileName)
slbm::GeoTessModelSLBM::loadModelBinary
virtual void loadModelBinary(IFStreamBinary &input, const string &inputDirectory, const string &relGridFilePath)
slbm::GeoTessModelSLBM::writeModelDataBuffer
void writeModelDataBuffer(util::DataBuffer &buffer)
slbm::GeoTessModelSLBM::~GeoTessModelSLBM
virtual ~GeoTessModelSLBM()
slbm::GeoTessModelSLBM::isIOUncertainty
bool isIOUncertainty() const
Definition: GeoTessModelSLBM.h:369
slbm::GeoTessModelSLBM::GeoTessModelSLBM
GeoTessModelSLBM(const string &modelInputFile, const string &relativeGridPath, vector< vector< Uncertainty * > > &uncertainties, const GeoTessOptimizationType *optimization=&GeoTessOptimizationType::SPEED)
slbm::GeoTessModelSLBM::setNewModelStyleReadFormat
static void setNewModelStyleReadFormat(bool omsrf)
Definition: GeoTessModelSLBM.h:179
slbm::GeoTessModelSLBM::GeoTessModelSLBM
GeoTessModelSLBM(vector< vector< Uncertainty * > > &uncert, const GeoTessOptimizationType *optimization=&GeoTessOptimizationType::SPEED)
Uncertainty.h
slbm::GeoTessModelSLBM::loadModelAscii
virtual void loadModelAscii(IFStreamAscii &input, const string &inputDirectory, const string &relGridFilePath)
SLBMGlobals.h
slbm::GeoTessModelSLBM::GeoTessModelSLBM
GeoTessModelSLBM(const string &gridFileName, GeoTessMetaData *metaData, vector< vector< Uncertainty * > > &uncertainties, double *avgMantleVel)
slbm::GeoTessModelSLBM::writeModelBinary
virtual void writeModelBinary(IFStreamBinary &output, const string &gridFileName)
slbm::GeoTessModelSLBM::class_name
static string class_name()
Definition: GeoTessModelSLBM.h:330
SLBM_EXP_IMP
#define SLBM_EXP_IMP
Definition: SLBMGlobals.h:180
slbm::GeoTessModelSLBM::GeoTessModelSLBM
GeoTessModelSLBM(GeoTessGrid *grid, GeoTessMetaData *metaData, vector< vector< Uncertainty * > > &uncertainties, double *avgMantleVel)
slbm::GeoTessModelSLBM::GeoTessModelSLBM
GeoTessModelSLBM(const string &modelInputFile, vector< vector< Uncertainty * > > &uncertainties, const GeoTessOptimizationType *optimization=&GeoTessOptimizationType::SPEED)
slbm::GeoTessModelSLBM::writeModelAscii
virtual void writeModelAscii(IFStreamAscii &output, const string &gridFileName)
slbm::GeoTessModelSLBM::setIOUncertainty
void setIOUncertainty(bool io)
Definition: GeoTessModelSLBM.h:367
slbm::GeoTessModelSLBM::getAverageMantleVelocity
double getAverageMantleVelocity(const int &index) const
Definition: GeoTessModelSLBM.h:349
slbm::GeoTessModelSLBM::isPathDepUncModel
virtual bool isPathDepUncModel()
Definition: GeoTessModelSLBM.h:174
slbm
Definition: CrustalProfile.h:59
util::DataBuffer
A byte array container used to hold binary data in the same manner as disk based file system.
Definition: DataBuffer.h:81
slbm::GeoTessModelSLBM
Definition: GeoTessModelSLBM.h:83