Class for validating MOOSE geochemical database. More...
#include <GeochemicalDatabaseValidator.h>
Public Member Functions | |
GeochemicalDatabaseValidator (const FileName filename, const nlohmann::json &db) | |
void | validate () |
Validate the thermodynamic database. More... | |
Protected Member Functions | |
bool | isValueReal (const nlohmann::json &value) const |
Check Json::Value can be converted to a Real. More... | |
void | checkArrayValues (const nlohmann::json &array, const std::string field) const |
Check Json::Value array is comprised of Reals. More... | |
void | checkArrayValues (const std::string type, const std::string species, const std::string field) const |
Check array array values can be converted to Real. More... | |
void | checkArraySize (const nlohmann::json &array, const std::string field) const |
Check Json::Value array is the correct size. More... | |
void | checkArraySize (const std::string type, const std::string species, const std::string field) const |
Check array is the correct size. More... | |
void | checkHeaderField (const std::string field) const |
Check fields are present in the Header section. More... | |
void | checkHeaderArray (const std::string field) const |
Check arrays in field can be converted to Reals. More... | |
void | checkElements (const std::string element) const |
Check elements in the database Each elemenent should have a real number as their molecular weights. More... | |
void | checkBasisSpecies (const std::string species) const |
Check basis species in the database Each basis species should have a real number as their molecular weights, charge, radius and weight for each element. More... | |
void | checkSecondarySpecies (const std::string species) const |
Check secondary species in the database Each secondary species should have a real number as their molecular weights, charge, radius, equilibrium constants and weight for each basis species. More... | |
void | checkMineralSpecies (const std::string species) const |
Check mineral species in the database Each mineral species should have a real number as their molecular weights, volume, equilibrium constants and weight for each basis species. More... | |
void | checkSorbingMineralSpecies (const std::string species) const |
Check sorbing mineral species in the database Each sorbing mineral species should have a real number as their surface area, equilibrium constants and weight for each sorbing site. More... | |
void | checkGasSpecies (const std::string species) const |
Check gas species in the database Each gas species should have a real number as their molecular weights, equilibrium constants, weight for each basis species, and fugacity values. More... | |
void | checkRedoxSpecies (const std::string species) const |
Check redox couple species in the database Each redox couple species should have a real number as their molecular weights, charge, radius, equilibrium constants and weight for each basis species. More... | |
void | checkOxideSpecies (const std::string species) const |
Check oxide species in the database Each oxide species should have a real number as their molecular weights and weight for each basis species. More... | |
void | checkSurfaceSpecies (const std::string species) const |
Check surface species in the database Each surface species should have a real number as their molecular weights, charge, and equilibrium constants. More... | |
void | checkSpeciesValue (const std::string type, const std::string species, const std::string field) const |
Check given species field value can be converted to a Real. More... | |
void | checkSpeciesWeightValue (const std::string type, const std::string species, const std::string field) const |
Check given species stoichiometric weigth values can be converted to a Real. More... | |
Protected Attributes | |
const FileName | _filename |
Database filename. More... | |
const nlohmann::json & | _root |
JSON database. More... | |
unsigned int | _temperature_size |
Number of temperature points. More... | |
Class for validating MOOSE geochemical database.
Definition at line 18 of file GeochemicalDatabaseValidator.h.
GeochemicalDatabaseValidator::GeochemicalDatabaseValidator | ( | const FileName | filename, |
const nlohmann::json & | db | ||
) |
Definition at line 16 of file GeochemicalDatabaseValidator.C.
|
protected |
Check Json::Value array is the correct size.
array | array of values |
field | database field name |
Definition at line 176 of file GeochemicalDatabaseValidator.C.
Referenced by checkGasSpecies(), checkHeaderArray(), checkMineralSpecies(), checkRedoxSpecies(), checkSecondarySpecies(), and validate().
|
protected |
Check array is the correct size.
type | species type (basis, secondary, etc) |
species | species name |
field | name of array values to check |
Definition at line 188 of file GeochemicalDatabaseValidator.C.
|
protected |
Check Json::Value array is comprised of Reals.
array | array of values |
field | database field name |
Definition at line 139 of file GeochemicalDatabaseValidator.C.
Referenced by checkGasSpecies(), checkHeaderArray(), checkMineralSpecies(), checkRedoxSpecies(), checkSecondarySpecies(), and validate().
|
protected |
Check array array values can be converted to Real.
type | species type (basis, secondary, etc) |
species | species name |
field | name of array values to check |
Definition at line 155 of file GeochemicalDatabaseValidator.C.
|
protected |
Check basis species in the database Each basis species should have a real number as their molecular weights, charge, radius and weight for each element.
species | basis species name |
Definition at line 274 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check elements in the database Each elemenent should have a real number as their molecular weights.
element | element name |
Definition at line 267 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check gas species in the database Each gas species should have a real number as their molecular weights, equilibrium constants, weight for each basis species, and fugacity values.
species | gas species name |
Definition at line 337 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check arrays in field can be converted to Reals.
field | name of field to check |
Definition at line 213 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check fields are present in the Header section.
field | name of field to check |
Definition at line 205 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check mineral species in the database Each mineral species should have a real number as their molecular weights, volume, equilibrium constants and weight for each basis species.
species | mineral species name |
Definition at line 310 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check oxide species in the database Each oxide species should have a real number as their molecular weights and weight for each basis species.
species | oxide species name |
Definition at line 384 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check redox couple species in the database Each redox couple species should have a real number as their molecular weights, charge, radius, equilibrium constants and weight for each basis species.
species | redox couple species name |
Definition at line 364 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check secondary species in the database Each secondary species should have a real number as their molecular weights, charge, radius, equilibrium constants and weight for each basis species.
species | secondary species name |
Definition at line 290 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check sorbing mineral species in the database Each sorbing mineral species should have a real number as their surface area, equilibrium constants and weight for each sorbing site.
species | sorbing mineral species name |
Definition at line 327 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check given species field value can be converted to a Real.
type | species type (basis, secondary, etc) |
species | species name |
field | value to check |
Definition at line 221 of file GeochemicalDatabaseValidator.C.
Referenced by checkBasisSpecies(), checkElements(), checkGasSpecies(), checkMineralSpecies(), checkOxideSpecies(), checkRedoxSpecies(), checkSecondarySpecies(), checkSorbingMineralSpecies(), and checkSurfaceSpecies().
|
protected |
Check given species stoichiometric weigth values can be converted to a Real.
type | species type (basis, secondary, etc) |
species | species name |
field | name of values to check |
Definition at line 243 of file GeochemicalDatabaseValidator.C.
Referenced by checkBasisSpecies(), checkGasSpecies(), checkMineralSpecies(), checkOxideSpecies(), checkRedoxSpecies(), checkSecondarySpecies(), checkSorbingMineralSpecies(), and checkSurfaceSpecies().
|
protected |
Check surface species in the database Each surface species should have a real number as their molecular weights, charge, and equilibrium constants.
species | surface species name |
Definition at line 394 of file GeochemicalDatabaseValidator.C.
Referenced by validate().
|
protected |
Check Json::Value can be converted to a Real.
array | array of values |
Definition at line 122 of file GeochemicalDatabaseValidator.C.
Referenced by checkArrayValues(), checkSpeciesValue(), and checkSpeciesWeightValue().
void GeochemicalDatabaseValidator::validate | ( | ) |
Validate the thermodynamic database.
Definition at line 23 of file GeochemicalDatabaseValidator.C.
Referenced by GeochemicalDatabaseReader::validate().
|
protected |
Database filename.
Definition at line 173 of file GeochemicalDatabaseValidator.h.
Referenced by checkArraySize(), checkArrayValues(), checkHeaderField(), checkSpeciesValue(), checkSpeciesWeightValue(), and validate().
|
protected |
JSON database.
Definition at line 175 of file GeochemicalDatabaseValidator.h.
Referenced by checkArraySize(), checkArrayValues(), checkGasSpecies(), checkHeaderArray(), checkHeaderField(), checkSpeciesValue(), checkSpeciesWeightValue(), and validate().
|
protected |
Number of temperature points.
Definition at line 177 of file GeochemicalDatabaseValidator.h.
Referenced by checkArraySize(), and validate().