RSTT 3.2.1 Regional Seismic Travel Time

Loading...
Searching...
No Matches
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 "UncertaintyPDU.h"
60#include "UncertaintyPIU.h"
61#include "SLBMException.h"
62
63 using namespace geotess;
64 using namespace std;
65
66// **** _BEGIN GEOTESS NAMESPACE_ **********************************************
67
68 namespace slbm
69{
70
71// **** _FORWARD REFERENCES_ ***************************************************
72
73
74// **** _CLASS DEFINITION_ *****************************************************
75
83 class SLBM_EXP_IMP GeoTessModelSLBM : public GeoTessModel
84{
85 private:
86
90 double averageMantleVelocity[2];
91
97 vector<vector<UncertaintyPIU*> > piu;
98
102 vector<UncertaintyPDU*> pdu;
103
107 int fileFormatVer;
108
109 void init();
110
111 void checkMiddleCrustLayers();
112
113 protected:
114
131 virtual void loadModelAscii(IFStreamAscii& input, const string& inputDirectory,
132 const string& relGridFilePath);
133
149 virtual void loadModelBinary(IFStreamBinary& input, const string& inputDirectory,
150 const string& relGridFilePath);
151
161 virtual void writeModelAscii(IFStreamAscii& output, const string& gridFileName);
162
172 virtual void writeModelBinary(IFStreamBinary& output, const string& gridFileName);
173
174 public:
175
179 GeoTessModelSLBM();
180
188 GeoTessModelSLBM(const string& modelInputFile);
189
211 GeoTessModelSLBM(const string& modelInputFile, const string& relativeGridPath);
212
242 GeoTessModelSLBM(const string& gridFileName, GeoTessMetaData* metaData);
243
278 GeoTessModelSLBM(GeoTessGrid* grid, GeoTessMetaData* metaData);
279
280 virtual bool operator == (const GeoTessModelSLBM& other) const;
281
282 virtual bool operator != (const GeoTessModelSLBM& other) const { return !(*this == other); } ;
283
287 // GeoTessModelSLBM(const GeoTessModelSLBM &other);
288
292 virtual ~GeoTessModelSLBM();
293
298 virtual string class_name() { return "GeoTessModelSLBM"; }
299
303 inline bool isPathDepUncModel() { return (pdu.size() > 0) ? true : false; }
304
308 inline int getFileFormatVersion() { return fileFormatVer; }
309
314 double getAverageMantleVelocity(const int &index) const
315 {
316 return averageMantleVelocity[index];
317 }
318
323 void setAverageMantleVelocity(const int &index, const double &velocity)
324 {
325 averageMantleVelocity[index]=velocity;
326 }
327
333 const vector<vector<UncertaintyPIU*> >& getPIU() const { return piu; }
334
338 vector<UncertaintyPDU*>& getPDU()
339 {
340 if (isPathDepUncModel())
341 {
342 return pdu;
343 }
344 else
345 {
346 ostringstream os;
347 os << endl << "ERROR in GeoTessModelSLBM::getPDU()." << endl <<
348 "File " << getMetaData().getInputModelFile() << endl <<
349 "This model does not contain any PDU information." << endl
350 << "Version " << SlbmVersion << " File " << __FILE__ << " line " << __LINE__ << endl << endl;
351 throw SLBMException(os.str(), 105);
352 }
353 }
354
355
356 int getBufferSize() { return 0; }
357
358 string toString();
359
360};
361// end class GeoTessModelSLBM
362
363}// end namespace geotess
364
365#endif // GEOTESSMODELSLBM_H_
SLBMException.h
SLBMGlobals.h
SLBM_EXP_IMP
#define SLBM_EXP_IMP
Definition SLBMGlobals.h:180
UncertaintyPDU.h
UncertaintyPIU.h
slbm::GeoTessModelSLBM::isPathDepUncModel
bool isPathDepUncModel()
Definition GeoTessModelSLBM.h:303
slbm::GeoTessModelSLBM::GeoTessModelSLBM
GeoTessModelSLBM(const string &gridFileName, GeoTessMetaData *metaData)
slbm::GeoTessModelSLBM::GeoTessModelSLBM
GeoTessModelSLBM(const string &modelInputFile)
slbm::GeoTessModelSLBM::getBufferSize
int getBufferSize()
Definition GeoTessModelSLBM.h:356
slbm::GeoTessModelSLBM::toString
string toString()
slbm::GeoTessModelSLBM::getAverageMantleVelocity
double getAverageMantleVelocity(const int &index) const
Definition GeoTessModelSLBM.h:314
slbm::GeoTessModelSLBM::class_name
virtual string class_name()
Definition GeoTessModelSLBM.h:298
slbm::GeoTessModelSLBM::getPDU
vector< UncertaintyPDU * > & getPDU()
Definition GeoTessModelSLBM.h:338
slbm::GeoTessModelSLBM::GeoTessModelSLBM
GeoTessModelSLBM(const string &modelInputFile, const string &relativeGridPath)
slbm::GeoTessModelSLBM::writeModelAscii
virtual void writeModelAscii(IFStreamAscii &output, const string &gridFileName)
slbm::GeoTessModelSLBM::getPIU
const vector< vector< UncertaintyPIU * > > & getPIU() const
Definition GeoTessModelSLBM.h:333
slbm::GeoTessModelSLBM::writeModelBinary
virtual void writeModelBinary(IFStreamBinary &output, const string &gridFileName)
slbm::GeoTessModelSLBM::GeoTessModelSLBM
GeoTessModelSLBM(GeoTessGrid *grid, GeoTessMetaData *metaData)
slbm::GeoTessModelSLBM::loadModelBinary
virtual void loadModelBinary(IFStreamBinary &input, const string &inputDirectory, const string &relGridFilePath)
slbm::GeoTessModelSLBM::~GeoTessModelSLBM
virtual ~GeoTessModelSLBM()
slbm::GeoTessModelSLBM::getFileFormatVersion
int getFileFormatVersion()
Definition GeoTessModelSLBM.h:308
slbm::GeoTessModelSLBM::loadModelAscii
virtual void loadModelAscii(IFStreamAscii &input, const string &inputDirectory, const string &relGridFilePath)
slbm::GeoTessModelSLBM::setAverageMantleVelocity
void setAverageMantleVelocity(const int &index, const double &velocity)
Definition GeoTessModelSLBM.h:323
slbm::GeoTessModelSLBM::GeoTessModelSLBM
GeoTessModelSLBM()
slbm::SLBMException
An Exception class for Grid and related objects.
Definition SLBMException.h:55
slbm
Definition CrustalProfile.h:59