|
World Ocean Simulation System (WOSS) library
|
WossDb for NetCDF DECK41 Sediment database. More...
#include <sediment-deck41-db.h>


Public Member Functions | |
| SedimDeck41Db (const std::string &name) | |
| virtual | ~SedimDeck41Db () override=default |
| virtual bool | openConnection () override |
| virtual bool | finalizeConnection () override |
| virtual bool | closeConnection () override |
| virtual bool | insertValue (const Coord &coordinates, const Sediment &sediment_value) override |
| virtual std::unique_ptr< Sediment > | getValue (const CoordZ &coordz) const override |
| virtual std::unique_ptr< Sediment > | getValue (const CoordZVector &coordz_vector) const override |
Public Member Functions inherited from woss::WossDb | |
| WossDb (const std::string &name) | |
| virtual | ~WossDb ()=default |
| void | setDbName (const std::string &pathname) |
| std::string | getDbName () const |
| void | setDebug (double flag=true) |
| bool | isUsingDebug () const |
| virtual bool | isValid () const |
Public Member Functions inherited from woss::WossSedimentDb | |
| WossSedimentDb ()=default | |
| virtual | ~WossSedimentDb ()=default |
Protected Member Functions | |
| double | calculateAvgDepth (const CoordZVector &coordz_vector) const |
| Deck41Types | getDeck41TypesFromCoords (const CoordZVector &coordz_vector) const |
| Deck41Types | getDeck41TypesFromMarsdenCoords (const CoordZVector &coordz_vector) const |
| Deck41Types | getDeck41TypesFromMarsdenSquare (const CoordZVector &coordz_vector) const |
| Deck41Types | calculateDeck41Types (const CoordZVector &coordz_vector) const |
| std::unique_ptr< Sediment > | calculateSediment (const Deck41Types &floor_types, double avg_depth) const |
| std::unique_ptr< Sediment > | createSediment (int deck41_type, double depth) const |
| int | getMaxAppereanceFrequencyValue (const FrequencyMap &frequency_map) const |
| bool | doTestA (const Deck41TypeTests &test) const |
| bool | doTestB (const Deck41TypeTests &test) const |
| bool | doTestC (const Deck41TypeTests &test) const |
Protected Member Functions inherited from woss::WossDb | |
| PathName | getPathName (const std::string &complete_path) const |
Static Protected Member Functions | |
| static SedimWeightMap | initSedimWeightMap () |
Protected Attributes | |
| SedimDeck41CoordDb | sediment_coord_db |
| SedimDeck41MarsdenDb | sediment_marsden_db |
| SedimDeck41MarsdenOneDb | sediment_marsden_one_db |
| Deck41TypeTests | curr_tests_state |
| Deck41TypeTests | prev_tests_state |
Protected Attributes inherited from woss::WossDb | |
| std::string | db_name |
| bool | debug |
Static Protected Attributes | |
| static SedimWeightMap | sediment_weight_map = SedimDeck41Db::initSedimWeightMap() |
Friends | |
| class | SedimDeck41DbCreator |
WossDb for NetCDF DECK41 Sediment database.
SedimDeck41Db implements WossDb and WossSedimentDb for NetCDF DECK41 Sediment database. It provides logic to handle the three custom made databases: coordinates, marsden square and marsden coordinates.
| SedimDeck41Db::SedimDeck41Db | ( | const std::string & | name | ) |
SedimDeck41Db constructor
| name | pathname of database |
|
overridevirtualdefault |
|
protected |
Computes the average depth of a valid CoordZVector for Sediment creation
| coordz_vector | a vector of valid CoordZ |
Referenced by getValue().
|
protected |
Gets the Deck41Types of a valid CoordZVector searching in order in: coord db, marsden db, marsden one db. On each search Deck41TypeTests curr_tests_state and prev_tests_state are updated, and based on result conditions, the process stops and returns or goes on to the next database.
| coordz_vector | a vector of valid CoordZ |
References curr_tests_state, woss::WossDb::debug, doTestA(), doTestB(), doTestC(), getDeck41TypesFromCoords(), getDeck41TypesFromMarsdenCoords(), getDeck41TypesFromMarsdenSquare(), prev_tests_state, and woss::Deck41TypeTests::updateAllConditions().
Referenced by getValue().

|
protected |
Creates the corresponding Sediment from the searched Deck41Types returned by calculateDeck41Types
| floor_types | the Deck41Types pair resulted from the search process |
| avg_depth | depth value [m] for Sediment calculations |
References createSediment(), curr_tests_state, woss::WossDb::debug, woss::Deck41TypeTests::getConditionA(), woss::Deck41TypeTests::getConditionB(), woss::Deck41TypeTests::getConditionC(), woss::Deck41TypeTests::getConditionD(), woss::Deck41TypeTests::getConditionE(), woss::Deck41TypeTests::getConditionF(), woss::Singleton< T >::instance(), and sediment_weight_map.
Referenced by getValue().

|
overridevirtual |
Closes the connection to the three databases provided
Implements woss::WossDb.
References woss::WossNetcdfDb::closeConnection(), sediment_coord_db, sediment_marsden_db, and sediment_marsden_one_db.

|
protected |
Creates a Sediment from the DECK41 integer type number
| deck41_type | DECK41 integer floor type number |
| depth | depth value [m] for Sediment calculations |
References woss::Singleton< T >::instance().
Referenced by calculateSediment().

|
inlineprotected |
Does Test A on given Deck41TypeTests reference. A positive result means that the search in the databases for a valid Deck41Types is over
| test | const Deck41TypeTests reference |
References woss::Deck41TypeTests::getConditionA(), woss::Deck41TypeTests::getConditionB(), woss::Deck41TypeTests::getConditionE(), and woss::Deck41TypeTests::getConditionF().
Referenced by calculateDeck41Types().

|
inlineprotected |
Does Test B on given Deck41TypeTests reference. A positive result means that the search in the databases for a valid Deck41Types should continue. If next search step fails a Sediment not valid will be returned from the search process
| test | const Deck41TypeTests reference |
References woss::Deck41TypeTests::getConditionC(), woss::Deck41TypeTests::getConditionD(), and woss::Deck41TypeTests::getConditionG().
Referenced by calculateDeck41Types().

|
inlineprotected |
Does Test C on given Deck41TypeTests reference. A positive result means that the search in the databases for a valid Deck41Types is over if the next search step Test A fails
| test | const Deck41TypeTests reference |
References woss::Deck41TypeTests::getConditionC(), and woss::Deck41TypeTests::getConditionD().
Referenced by calculateDeck41Types().

|
inlineoverridevirtual |
Not allowed
Implements woss::WossDb.
|
protected |
Gets the Deck41Types of a valid CoordZVector from the SedimDeck41CoordDb database
| coordz_vector | a vector of valid CoordZ |
References woss::WossDb::debug, getMaxAppereanceFrequencyValue(), woss::SedimDeck41CoordDb::getSeaFloorType(), and sediment_coord_db.
Referenced by calculateDeck41Types().

|
protected |
Gets the Deck41Types of a valid CoordZVector from the SedimDeck41MarsdenDb database
| coordz_vector | a vector of valid CoordZ |
References woss::WossDb::debug, getMaxAppereanceFrequencyValue(), woss::SedimDeck41MarsdenOneDb::getSeaFloorType(), and sediment_marsden_one_db.
Referenced by calculateDeck41Types().

|
protected |
Gets the Deck41Types of a valid CoordZVector from the SedimDeck41MarsdenOneDb database
| coordz_vector | a vector of valid CoordZ |
References woss::WossDb::debug, getMaxAppereanceFrequencyValue(), woss::SedimDeck41MarsdenDb::getSeaFloorType(), and sediment_marsden_db.
Referenced by calculateDeck41Types().

|
protected |
Returns the type of the FrequencyMap that has the max number of times of appeareance in a database query result
| frequency_map | const FrequencyMap reference |
Referenced by getDeck41TypesFromCoords(), getDeck41TypesFromMarsdenCoords(), and getDeck41TypesFromMarsdenSquare().
Returns a pointer to a heap-based Sediment for given coordinates and depth, if present in any of the three databases. User is responsible of pointer's ownership
| coords | const reference to a valid CoordZ object |
Implements woss::WossSedimentDb.
References getValue().
Referenced by getValue().

|
overridevirtual |
Returns a pointer to a heap-based Sediment for given coordinates and depth vector, if at least one set of coordinates is present in any of the three databases. User is responsible of pointer's ownership
| coordz_vector | const reference to a valid CoordZ vector |
Implements woss::WossSedimentDb.
References calculateAvgDepth(), calculateDeck41Types(), and calculateSediment().

|
staticprotected |
Initializes the static sediment_weight_map
|
overridevirtual |
Inserts the given woss::Sediment value in the database for given coordinates
| coordinates | const reference to a valid Coord object |
| bathymetry_value | const Reference to Sediment value to be inserted |
Implements woss::WossSedimentDb.
|
inlineoverridevirtual |
Not allowed
Implements woss::WossDb.
|
friend |
|
mutableprotected |
Current iteration Deck41TypeTests
Referenced by calculateDeck41Types(), and calculateSediment().
|
mutableprotected |
Previous iteration Deck41TypeTests
Referenced by calculateDeck41Types().
|
protected |
WossDb handling custom made NetCDF DECK41 database
Referenced by closeConnection(), getDeck41TypesFromCoords(), and woss::SedimDeck41DbCreator::initializeSedimDb().
|
protected |
WossDb handling custom made NetCDF DECK41 marsden square database
Referenced by closeConnection(), getDeck41TypesFromMarsdenSquare(), and woss::SedimDeck41DbCreator::initializeSedimDb().
|
protected |
WossDb handling custom made NetCDF DECK41 marsden coordinates database
Referenced by closeConnection(), getDeck41TypesFromMarsdenCoords(), and woss::SedimDeck41DbCreator::initializeSedimDb().
|
staticprotected |
Weight map for DECK41 floor type to Sediment conversion
Referenced by calculateSediment().