Merge branch 'hannes-philipp' of git.gfz-potsdam.de:naaice/tug into hannes-philipp

This commit is contained in:
philippun 2023-09-08 15:30:33 +02:00
commit fc4689461e
2 changed files with 10 additions and 10 deletions

View File

@ -125,17 +125,17 @@ class Grid {
/** /**
* @brief Sets the domain length of a 1D-Grid. Grid must be one dimensional. * @brief Sets the domain length of a 1D-Grid. Grid must be one dimensional.
* *
* @param domainLength An integer of the domain length. Must be positive. * @param domainLength A double value of the domain length. Must be positive.
*/ */
void setDomain(int domainLength); void setDomain(double domainLength);
/** /**
* @brief Sets the domain size of a 2D-Grid. Grid must be two dimensional. * @brief Sets the domain size of a 2D-Grid. Grid must be two dimensional.
* *
* @param domainRow An integer of the domain size in y-direction. Must be positive. * @param domainRow A double value of the domain size in y-direction. Must be positive.
* @param domainCol An integer of the domain size in x-direction. Must be positive. * @param domainCol A double value of the domain size in x-direction. Must be positive.
*/ */
void setDomain(int domainRow, int domainCol); void setDomain(double domainRow,double domainCol);
/** /**
* @brief Gets the delta value for 1D-Grid. Grid must be one dimensional. * @brief Gets the delta value for 1D-Grid. Grid must be one dimensional.
@ -164,12 +164,12 @@ class Grid {
int col; // number of grid columns int col; // number of grid columns
int row; // number of grid rows int row; // number of grid rows
int dim; // 1D or 2D int dim; // 1D or 2D
int domainCol; // number of domain columns double domainCol; // number of domain columns
int domainRow; // number of domain rows double domainRow; // number of domain rows
double deltaCol; // delta in x-direction (between columns) double deltaCol; // delta in x-direction (between columns)
double deltaRow; // delta in y-direction (between rows) double deltaRow; // delta in y-direction (between rows)
MatrixXd concentrations; // Matrix holding grid concentrations MatrixXd concentrations; // Matrix holding grid concentrations
MatrixXd alphaX; // Matrix holding alpha coefficients in x-direction MatrixXd alphaX; // Matrix holding alpha coefficients in x-direction
MatrixXd alphaY; // Matrix holding alpha coefficients in y-direction MatrixXd alphaY; // Matrix holding alpha coefficients in y-direction
}; };

View File

@ -117,7 +117,7 @@ int Grid::getCol() {
return col; return col;
} }
void Grid::setDomain(int domainLength) { void Grid::setDomain(double domainLength) {
if (dim != 1) { if (dim != 1) {
throw_invalid_argument("Grid is not one dimensional, you should probaly use the 2D domain setter!"); throw_invalid_argument("Grid is not one dimensional, you should probaly use the 2D domain setter!");
} }
@ -129,7 +129,7 @@ void Grid::setDomain(int domainLength) {
this->deltaCol = double(this->domainCol)/double(this->col); this->deltaCol = double(this->domainCol)/double(this->col);
} }
void Grid::setDomain(int domainRow, int domainCol) { void Grid::setDomain(double domainRow, double domainCol) {
if (dim != 2) { if (dim != 2) {
throw_invalid_argument("Grid is not two dimensional, you should probably use the 1D domain setter!"); throw_invalid_argument("Grid is not two dimensional, you should probably use the 1D domain setter!");
} }