World Ocean Simulation System (WOSS) library
sediment-definitions.h
Go to the documentation of this file.
1/* WOSS - World Ocean Simulation System -
2 *
3 * Copyright (C) 2009 Federico Guerra
4 * and regents of the SIGNET lab, University of Padova
5 *
6 * Author: Federico Guerra - federico@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/*
23 * This software has been developed by Federico Guerra and SIGNET lab,
24 * University of Padova, in collaboration with the NATO Centre for
25 * Maritime Research and Experimentation (http://www.cmre.nato.int ;
26 * E-mail: pao@cmre.nato.int), whose support is gratefully acknowledged.
27 */
28
29
40#ifndef WOSS_SEDIMENT_DEFINITIONS_H
41#define WOSS_SEDIMENT_DEFINITIONS_H
42
43
44#include <string>
46
47
48namespace woss {
49
50
51 #define SEDIMENT_NOT_SET_VALUE (-10000.0)
52
53
54 typedef ::std::pair < int , int > Deck41Types;
55
56
63 class Sediment {
64
65
66 public:
67
71 Sediment();
72
83 Sediment( const ::std::string& name, double velc, double vels, double dens, double attc, double atts, double bottom_depth = 1.0 );
84
89 Sediment( const Sediment& copy );
90
91
96 virtual Sediment* create() const { return new Sediment(); }
97
109 virtual Sediment* create( const ::std::string& name, double velc, double vels, double dens, double attc, double atts, double bottom_depth = 1.0 ) const {
110 return new Sediment( name, velc, vels, dens, attc, atts, bottom_depth); }
111
117 virtual Sediment* create( const Sediment& copy ) const { return new Sediment(copy); }
118
123 virtual Sediment* clone() const { return new Sediment(*this); }
124
125
126 virtual ~Sediment() { };
127
128
134 Sediment& setType( const ::std::string& name ) { type = name; return *this; }
135
141 Sediment& setVelocityC( double vel ) { vel_c = vel; return *this; }
142
148 Sediment& setVelocityS( double vel ) { vel_s = vel; return *this; }
149
155 Sediment& setDensity( double dens ) { density = dens; return *this; }
156
162 Sediment& setAttenuationC( double att ) { att_c = att; return *this; }
163
169 Sediment& setAttenuationS( double att ) { att_s = att; return *this; }
170
176 Sediment& setDepth( double bottom_depth ) { depth = bottom_depth; return *this; }
177
189 Sediment& set( const ::std::string& name, double velc, double vels, double dens, double attc , double atts, double bottom_depth ) {
191 att_c = attc; att_s = atts; depth = bottom_depth; return *this; }
192
193
198 static void setDebug( bool flag ) { debug = flag; }
199
200
205 double getVelocityC() const { return vel_c; }
206
211 double getVelocityS() const { return vel_s; }
212
217 double getDensity() const { return density; }
218
223 double getAttenuationC() const { return att_c; }
224
229 double getAttenuationS() const { return att_s; }
230
235 double getDepth() const { return depth; }
236
241 ::std::string getType() const { return type; }
242
243
250
251
256 virtual const ::std::string getStringValues() const;
257
258
264 Sediment& operator=( const Sediment& time );
265
266
273 friend const Sediment operator+( const Sediment& left, const Sediment& right );
274
281 friend const Sediment operator-( const Sediment& left, const Sediment& right );
282
289 friend const Sediment operator/( const Sediment& left, const Sediment& right );
290
297 friend const Sediment operator*( const Sediment& left, const Sediment& right );
298
306
314
322
330
331
338 friend Sediment& operator+=( Sediment& left, double right );
339
346 friend Sediment& operator-=( Sediment& left, double right );
347
354 friend Sediment& operator/=( Sediment& left, double right );
355
362 friend Sediment& operator*=( Sediment& left, double right );
363
364
371 friend bool operator==( const Sediment& left, const Sediment& right );
372
379 friend bool operator!=( const Sediment& left, const Sediment& right );
380
381
388 friend const Sediment operator+( const double left, const Sediment& right );
389
396 friend const Sediment operator-( const double left, const Sediment& right );
397
404 friend const Sediment operator/( const double left, const Sediment& right );
405
412 friend const Sediment operator*( const double left, const Sediment& right );
413
414
421 friend const Sediment operator+( const Sediment& left, double right );
422
429 friend const Sediment operator-( const Sediment& left, double right );
430
437 friend const Sediment operator/( const Sediment& left, double right );
438
445 friend const Sediment operator*( const Sediment& left, double right );
446
447
454 friend ::std::ostream& operator<<( ::std::ostream& os, const Sediment& instance );
455
456
457 protected:
458
462 ::std::string type;
463
464
468 double depth;
469
473 double vel_c;
474
478 double vel_s;
479
483 double density;
484
488 double att_c;
489
493 double att_s;
494
495
499 static bool debug;
500
501
502 };
503
504 // non-inline friend operator declarations
506 const Sediment operator/( const double left, const Sediment& right );
507
508 const Sediment operator*( const double left, const Sediment& right );
509
510 const Sediment operator/( const Sediment& left, const double right );
511
512 const Sediment operator*( const Sediment& left, const double right );
513
514
515 Sediment& operator+=( Sediment& left, const Sediment& right );
516
517 Sediment& operator-=( Sediment& left, const Sediment& right );
518
519 Sediment& operator/=( Sediment& left, const Sediment& right );
520
521 Sediment& operator*=( Sediment& left, const Sediment& right );
522
523
524 Sediment& operator+=( Sediment& left, double right );
525
526 Sediment& operator-=( Sediment& left, double right );
527
528 Sediment& operator/=( Sediment& left, double right );
529
530 Sediment& operator*=( Sediment& left, double right );
531
532 //inline functions
534 inline bool operator==( const Sediment& left, const Sediment& right ) {
535 if ( &left == &right ) return true;
536 return( left.vel_c == right.vel_c && left.vel_s == right.vel_s && left.att_c == right.att_c && left.att_s == right.att_s
537 && left.density == right.density );
538 }
539
540
541 inline bool operator!=( const Sediment& left, const Sediment& right ) {
542 if ( &left == &right ) return false;
543 return( left.vel_c != right.vel_c || left.vel_s != right.vel_s || left.att_c != right.att_c || left.att_s != right.att_s
544 || left.density != right.density );
545 }
546
547
548 inline ::std::ostream& operator<<(::std::ostream& os, const Sediment& instance ) {
549 os << "Sediment type = " << instance.type << "; velocity_c = " << instance.vel_c << "; velocity_s = " << instance.vel_s << "; density = " << instance.density
550 << "; attenuation_c = " << instance.att_c << "; attenuation_s = " << instance.att_s;
551 return os;
552 }
553
554
555 inline const Sediment operator+( const Sediment& left, const Sediment& right ) {
556 return( Sediment( left.type + " + " + right.type, left.vel_c + right.vel_c, left.vel_s + right.vel_s, left.density + right.density, left.att_c + right.att_c, left.att_s + right.att_s ) );
557 }
558
559
560 inline const Sediment operator-( const Sediment& left, const Sediment& right ) {
561 return( Sediment( left.type + " - " + right.type, left.vel_c - right.vel_c, left.vel_s - right.vel_s, left.density - right.density, left.att_c - right.att_c, left.att_s - right.att_s ) );
562 }
563
564
565 inline const Sediment operator/( const Sediment& left, const Sediment& right ) {
566 return( Sediment( left.type + " / " + right.type, left.vel_c / right.vel_c, left.vel_s / right.vel_s, left.density / right.density, left.att_c / right.att_c, left.att_s / right.att_s ) );
567 }
568
569
570 inline const Sediment operator*( const Sediment& left, const Sediment& right ) {
571 return( Sediment( left.type + " * " + right.type, left.vel_c * right.vel_c, left.vel_s * right.vel_s, left.density * right.density, left.att_c * right.att_c, left.att_s * right.att_s ) );
572 }
574
580 class SedimentGravel : public Sediment {
581
582 public:
583
584 SedimentGravel(double depth = 1.0);
585
586
587 protected:
588
592 double calculateVelocityS(double vels, double bottom_depth);
593
594 };
595
596
602 class SedimentSand : public Sediment {
603
604
605 public:
606
607
608 SedimentSand();
609
610
611 };
612
613
619 class SedimentSilt : public Sediment {
620
621
622 public:
623
624
625 SedimentSilt(double depth = 1.0);
626
627
628 protected:
629
633 double calculateVelocityS(double vels, double bottom_depth);
634
635
636 };
637
638
644 class SedimentClay : public Sediment {
645
646
647 public:
648
649
650 SedimentClay();
651
652
653 };
654
655
661 class SedimentOoze : public Sediment {
662
663
664 public:
665
666
667 SedimentOoze();
668
669
670 };
671
672
678 class SedimentMud : public Sediment {
679
680
681 public:
682
683
684 SedimentMud(double depth = 1.0);
685
686
687 protected:
688
692 double calculateVelocityS(double vels, double bottom_depth);
693
694
695 };
696
697
705 class SedimentRocks : public Sediment {
706
707
708 public:
709
710
712
713
714 };
715
716
724 class SedimentOrganic : public Sediment {
725
726
727 public:
728
729
731
732
733 };
734
735
743 class SedimentNodules : public Sediment {
744
745
746 public:
747
748
750
751
752 };
753
754
761
762
763 public:
764
765
767
768
769 };
770
771
772}
773
774
775#endif /* WOSS_SEDIMENT_DEFINITIONS_H */
776
bool operator!=(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.h:846
std::ostream & operator<<(std::ostream &os, const Altimetry &instance)
Definition altimetry-definitions.h:826
Altimetry & operator*=(Altimetry &left, double right)
Definition altimetry-definitions.cpp:367
const Altimetry operator/(const Altimetry &left, const double right)
Definition altimetry-definitions.cpp:285
bool operator==(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.h:840
Altimetry & operator+=(Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.cpp:327
const Altimetry operator+(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.cpp:257
const Altimetry operator*(const Altimetry &left, const double right)
Definition altimetry-definitions.cpp:292
Altimetry & operator-=(Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.cpp:335
const Altimetry operator-(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.cpp:264
Altimetry & operator/=(Altimetry &left, double right)
Definition altimetry-definitions.cpp:359
Clay type implementation.
Definition sediment-definitions.h:644
Gravel type implementation.
Definition sediment-definitions.h:580
double calculateVelocityS(double vels, double bottom_depth)
Definition sediment-definitions.cpp:265
Hard bottom type implementation.
Definition sediment-definitions.h:760
Mud type implementation.
Definition sediment-definitions.h:678
double calculateVelocityS(double vels, double bottom_depth)
Definition sediment-definitions.cpp:291
Deck41 nodules type implementation.
Definition sediment-definitions.h:743
Ooze type implementation.
Definition sediment-definitions.h:661
Organic type implementation.
Definition sediment-definitions.h:724
Rocks type implementation.
Definition sediment-definitions.h:705
Sand type implementation.
Definition sediment-definitions.h:602
Silt type implementation.
Definition sediment-definitions.h:619
double calculateVelocityS(double vels, double bottom_depth)
Definition sediment-definitions.cpp:278
Surficial sediment geoacoustic parameters definitions.
Definition sediment-definitions.h:63
Sediment & setVelocityC(double vel)
Definition sediment-definitions.h:141
Sediment & setAttenuationC(double att)
Definition sediment-definitions.h:162
Sediment & setType(const ::std::string &name)
Definition sediment-definitions.h:134
friend bool operator!=(const Sediment &left, const Sediment &right)
Definition sediment-definitions.h:541
friend const Sediment operator-(const double left, const Sediment &right)
virtual Sediment * clone() const
Definition sediment-definitions.h:123
virtual Sediment * create(const Sediment &copy) const
Definition sediment-definitions.h:117
virtual Sediment * create(const ::std::string &name, double velc, double vels, double dens, double attc, double atts, double bottom_depth=1.0) const
Definition sediment-definitions.h:109
friend Sediment & operator+=(Sediment &left, const Sediment &right)
friend Sediment & operator*=(Sediment &left, const Sediment &right)
Sediment & setDensity(double dens)
Definition sediment-definitions.h:155
::std::string type
Definition sediment-definitions.h:462
friend const Sediment operator*(const double left, const Sediment &right)
double att_c
Definition sediment-definitions.h:488
friend::std::ostream & operator<<(::std::ostream &os, const Sediment &instance)
Sediment & operator=(const Sediment &time)
Definition sediment-definitions.cpp:87
Sediment & set(const ::std::string &name, double velc, double vels, double dens, double attc, double atts, double bottom_depth)
Definition sediment-definitions.h:189
Sediment()
Definition sediment-definitions.cpp:51
::std::string getType() const
Definition sediment-definitions.h:241
friend bool operator==(const Sediment &left, const Sediment &right)
Definition sediment-definitions.h:534
friend const Sediment operator/(const double left, const Sediment &right)
friend const Sediment operator-(const Sediment &left, const Sediment &right)
Definition sediment-definitions.h:560
friend Sediment & operator-=(Sediment &left, const Sediment &right)
friend const Sediment operator+(const Sediment &left, const Sediment &right)
Definition sediment-definitions.h:555
friend const Sediment operator/(const Sediment &left, double right)
double getDepth() const
Definition sediment-definitions.h:235
static void setDebug(bool flag)
Definition sediment-definitions.h:198
virtual Sediment * create() const
Definition sediment-definitions.h:96
virtual bool isValid() const
Definition sediment-definitions.h:248
friend Sediment & operator-=(Sediment &left, double right)
double getVelocityC() const
Definition sediment-definitions.h:205
friend const Sediment operator/(const Sediment &left, const Sediment &right)
Definition sediment-definitions.h:565
friend Sediment & operator/=(Sediment &left, const Sediment &right)
friend const Sediment operator*(const Sediment &left, double right)
Sediment & setAttenuationS(double att)
Definition sediment-definitions.h:169
Sediment & setDepth(double bottom_depth)
Definition sediment-definitions.h:176
friend Sediment & operator/=(Sediment &left, double right)
double density
Definition sediment-definitions.h:483
friend const Sediment operator-(const Sediment &left, double right)
double getDensity() const
Definition sediment-definitions.h:217
double depth
Definition sediment-definitions.h:468
double vel_s
Definition sediment-definitions.h:478
virtual const ::std::string getStringValues() const
Definition sediment-definitions.cpp:100
friend Sediment & operator*=(Sediment &left, double right)
double getAttenuationS() const
Definition sediment-definitions.h:229
double getVelocityS() const
Definition sediment-definitions.h:211
double getAttenuationC() const
Definition sediment-definitions.h:223
double vel_c
Definition sediment-definitions.h:473
friend const Sediment operator+(const Sediment &left, double right)
static bool debug
Definition sediment-definitions.h:499
double att_s
Definition sediment-definitions.h:493
friend Sediment & operator+=(Sediment &left, double right)
friend const Sediment operator*(const Sediment &left, const Sediment &right)
Definition sediment-definitions.h:570
friend const Sediment operator+(const double left, const Sediment &right)
Sediment & setVelocityS(double vel)
Definition sediment-definitions.h:148
Provides the interface for the woss::Coord and woss::CoordZ classes.