World Ocean Simulation System (WOSS) library
uw-woss-mpropagation.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
32#ifndef UNDERWATER_WOSS_PROPAGATION_H
33#define UNDERWATER_WOSS_PROPAGATION_H
34
35
36#include <fstream>
37#include <map>
38#include <underwater-mpropagation.h>
39#include <underwater.h>
40#include <mphy.h>
41#include <uw-woss-pkt-hdr.h>
43
44
45namespace woss {
46 class WossManager;
47}
48
49
50using GainMatrix = std::map< woss::CoordZ , std::map < woss::CoordZ , double > >;
51using GMIter = GainMatrix::iterator;
52using GMRIter = GainMatrix::reverse_iterator;
53
54
60class WossMPropagation : public UnderwaterMPropagation {
61
62 public:
63
65
66 virtual ~WossMPropagation() override = default;
67
74 virtual double getGain(Packet* p) override;
75
76 virtual int command(int argc, const char*const* argv) override;
77
78 private:
79
80 // keep raw pointer since we are dependant on legacy TCL memory management
82
84
86
87 fstream std_gain_out;
88
90
91
92 void insertStdGainMatrix( Position* sp, Position* rp, double gain );
93
94
101 double computeGain(Packet* p);
102
103 void writeStdGainMatrix();
104
105};
106
107
108//inline functions
110
111inline void WossMPropagation::insertStdGainMatrix( Position* sp, Position* rp, double gain ) {
112 std_gain_map[ woss::CoordZ( sp->getLatitude(), sp->getLongitude(), abs( sp->getZ() ) ) ]
113 [ woss::CoordZ( rp->getLatitude(), rp->getLongitude(), abs( rp->getZ() ) ) ] = gain;
114}
115
116#endif /* UNDERWATER_WOSS_PROPAGATION_H */
UnderwaterMPropagation class for channel calculations with WOSS.
Definition uw-woss-mpropagation.h:60
double computeGain(Packet *p)
Definition uw-woss-mpropagation.cpp:170
virtual ~WossMPropagation() override=default
void writeStdGainMatrix()
Definition uw-woss-mpropagation.cpp:233
void insertStdGainMatrix(Position *sp, Position *rp, double gain)
Definition uw-woss-mpropagation.h:111
GainMatrix std_gain_map
Definition uw-woss-mpropagation.h:83
string std_gain_matrix_name
Definition uw-woss-mpropagation.h:89
woss::WossManager * woss_manager
Definition uw-woss-mpropagation.h:81
virtual int command(int argc, const char *const *argv) override
Definition uw-woss-mpropagation.cpp:68
bool write_gain_matrix
Definition uw-woss-mpropagation.h:85
WossMPropagation()
Definition uw-woss-mpropagation.cpp:60
virtual double getGain(Packet *p) override
Definition uw-woss-mpropagation.cpp:121
fstream std_gain_out
Definition uw-woss-mpropagation.h:87
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:384
Abstract class that interfaces Pressure or TimeArr requests from user layer.
Definition woss-manager.h:90
Provides the interface for the woss::Coord and woss::CoordZ classes.
Definition ac-toolbox-arr-asc-reader.h:44
std::map< woss::CoordZ, std::map< woss::CoordZ, double > > GainMatrix
Definition uw-woss-mpropagation.h:50
GainMatrix::iterator GMIter
Definition uw-woss-mpropagation.h:51
GainMatrix::reverse_iterator GMRIter
Definition uw-woss-mpropagation.h:52
Definition of hdr_woss, WOSS pkt header.