World Ocean Simulation System (WOSS) library
res-pressure-txt-db.h
Go to the documentation of this file.
1/* WOSS - World Ocean Simulation System -
2 *
3 * Copyright (C) 2009 2025 Federico Guerra
4 * and regents of the SIGNET lab, University of Padova
5 *
6 * Author: Federico Guerra - WOSS@guerra-tlc.com
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation;
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22
33#ifndef WOSS_RES_PRESSURE_TXT_DB_H
34#define WOSS_RES_PRESSURE_TXT_DB_H
35
36
37#include <map>
38#include <complex>
40#include "woss-db.h"
41
42
43namespace woss {
44
45
53
54
55 public:
56
57
62 ResPressureTxtDb( const std::string& name );
63
64 virtual ~ResPressureTxtDb() override = default;
65
66
71 virtual bool closeConnection() override;
72
73
78 virtual bool finalizeConnection() override;
79
80
91 virtual std::unique_ptr<Pressure> getValue( const CoordZ& coord_tx, const CoordZ& coord_rx, const double frequency, const Time& time_value ) const override;
92
93
102 virtual bool insertValue( const CoordZ& coord_tx, const CoordZ& coord_rx, const double frequency, const Time& time_value, const Pressure& pressure ) override;
103
104
105 static void setSpaceSampling( double value ) { space_sampling = value; }
106
107 static double getSpaceSampling() { return space_sampling; }
108
109
110 protected:
111
112
113 using TimeMap = std::map< time_t, std::complex< double > >;
114 using TMIter = TimeMap::iterator;
115 using TMCIter = TimeMap::const_iterator;
116 using TMRIter = TimeMap::reverse_iterator;
117
118 using FreqMap = std::map< PDouble, TimeMap >;
119 using FMIter = FreqMap::iterator;
120 using FMCIter = FreqMap::const_iterator;
121 using FMRIter = FreqMap::reverse_iterator;
122
123 using RxMap = std::map< CoordZ, FreqMap, CoordComparator< ResPressureTxtDb, CoordZ > >;
124 using RxMIter = RxMap::iterator;
125 using RxCIter = RxMap::const_iterator;
126 using RxMRIter = RxMap::reverse_iterator;
127
132 using PressureMatrix = std::map< CoordZ, RxMap, CoordComparator< ResPressureTxtDb, CoordZ > >;
133 using PMIter = PressureMatrix::iterator;
134 using PMCIter = PressureMatrix::const_iterator;
135 using PMRIter = PressureMatrix::reverse_iterator;
136 using PMCRIter = PressureMatrix::const_reverse_iterator;
137
138
139 static double space_sampling;
140
145
150
152
153
159 void printScreenMap();
160
166 virtual bool writeMap();
167
173 virtual bool importMap();
174
175
184 std::complex<double> readMap( const CoordZ& tx, const CoordZ& rx, const double frequency, const Time& time_value ) const;
185
186
187 };
188
189
190}
191#endif /* WOSS_RES_PRESSURE_TXT_DB_H */
192
193
194
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:384
Complex attenuated pressure class.
Definition pressure-definitions.h:52
Textual WossDb for Pressure.
Definition res-pressure-txt-db.h:52
FreqMap::reverse_iterator FMRIter
Definition res-pressure-txt-db.h:121
PressureMatrix::reverse_iterator PMRIter
Definition res-pressure-txt-db.h:135
std::map< CoordZ, RxMap, CoordComparator< ResPressureTxtDb, CoordZ > > PressureMatrix
Definition res-pressure-txt-db.h:132
RxMap::reverse_iterator RxMRIter
Definition res-pressure-txt-db.h:126
TimeMap::iterator TMIter
Definition res-pressure-txt-db.h:114
static double getSpaceSampling()
Definition res-pressure-txt-db.h:107
virtual bool insertValue(const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value, const Pressure &pressure) override
Definition res-pressure-txt-db.cpp:332
std::map< PDouble, TimeMap > FreqMap
Definition res-pressure-txt-db.h:118
int initial_pressmap_size
Definition res-pressure-txt-db.h:149
TimeMap::const_iterator TMCIter
Definition res-pressure-txt-db.h:115
std::complex< double > readMap(const CoordZ &tx, const CoordZ &rx, const double frequency, const Time &time_value) const
Definition res-pressure-txt-db.cpp:122
RxMap::const_iterator RxCIter
Definition res-pressure-txt-db.h:125
void printScreenMap()
Definition res-pressure-txt-db.cpp:233
std::map< time_t, std::complex< double > > TimeMap
Definition res-pressure-txt-db.h:113
virtual bool finalizeConnection() override
Definition res-pressure-txt-db.cpp:307
PressureMatrix::const_reverse_iterator PMCRIter
Definition res-pressure-txt-db.h:136
FreqMap::iterator FMIter
Definition res-pressure-txt-db.h:119
PressureMatrix::const_iterator PMCIter
Definition res-pressure-txt-db.h:134
virtual ~ResPressureTxtDb() override=default
virtual bool closeConnection() override
Definition res-pressure-txt-db.cpp:313
FreqMap::const_iterator FMCIter
Definition res-pressure-txt-db.h:120
static double space_sampling
Definition res-pressure-txt-db.h:139
virtual std::unique_ptr< Pressure > getValue(const CoordZ &coord_tx, const CoordZ &coord_rx, const double frequency, const Time &time_value) const override
Definition res-pressure-txt-db.cpp:322
TimeMap::reverse_iterator TMRIter
Definition res-pressure-txt-db.h:116
virtual bool writeMap()
Definition res-pressure-txt-db.cpp:148
static void setSpaceSampling(double value)
Definition res-pressure-txt-db.h:105
virtual bool importMap()
Definition res-pressure-txt-db.cpp:63
PressureMatrix pressure_map
Definition res-pressure-txt-db.h:144
std::map< CoordZ, FreqMap, CoordComparator< ResPressureTxtDb, CoordZ > > RxMap
Definition res-pressure-txt-db.h:123
PressureMatrix::iterator PMIter
Definition res-pressure-txt-db.h:133
RxMap::iterator RxMIter
Definition res-pressure-txt-db.h:124
bool has_been_modified
Definition res-pressure-txt-db.h:151
a class for time date manipulation
Definition time-definitions.h:83
Data behaviour class for storing calculated Pressure.
Definition woss-db.h:412
Textual implementation of WossDb.
Definition woss-db.h:224
Provides the interface for the woss::PDouble class.
Definition ac-toolbox-arr-asc-reader.h:44
Provides the interface for woss::WossDb class.