mirror of
https://git.gfz-potsdam.de/naaice/tug.git
synced 2025-12-13 09:28:23 +01:00
add user input validation
This commit is contained in:
parent
2c2851a037
commit
154091e405
@ -1,3 +1,9 @@
|
||||
/**
|
||||
* @file Boundary.hpp
|
||||
* @brief
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifndef BOUNDARY_H_
|
||||
#define BOUNDARY_H_
|
||||
|
||||
@ -43,7 +49,7 @@ class BoundaryElement {
|
||||
* @param value Value of the constant concentration to be assumed at the
|
||||
* corresponding boundary element.
|
||||
*/
|
||||
BoundaryElement(double value); // TODO negative concentration allowed?
|
||||
BoundaryElement(double value);
|
||||
|
||||
/**
|
||||
* @brief Allows changing the boundary type of a corresponding
|
||||
@ -84,26 +90,6 @@ class BoundaryElement {
|
||||
};
|
||||
|
||||
|
||||
// TODO can be deleted?
|
||||
// class BoundaryWall {
|
||||
// public:
|
||||
// BoundaryWall(int length);
|
||||
|
||||
// void setWall(BC_TYPE type, double value = NAN);
|
||||
|
||||
// vector<BoundaryElement> getWall();
|
||||
|
||||
// void setBoundaryElement(int index, BC_TYPE type, double value = NAN);
|
||||
|
||||
// BoundaryElement getBoundaryElement();
|
||||
|
||||
// private:
|
||||
// BC_SIDE side;
|
||||
// int length;
|
||||
// vector<BoundaryElement> wall;
|
||||
|
||||
// };
|
||||
|
||||
/**
|
||||
* This class implements the functionality and management of the boundary
|
||||
* conditions in the grid to be simulated.
|
||||
|
||||
@ -23,6 +23,9 @@ void BoundaryElement::setType(BC_TYPE type) {
|
||||
}
|
||||
|
||||
void BoundaryElement::setValue(double value) {
|
||||
if(value < 0){
|
||||
throw_invalid_argument("No negative concentration allowed.");
|
||||
}
|
||||
this->value = value;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user