mirror of
https://git.gfz-potsdam.de/naaice/tug.git
synced 2025-12-15 18:38:23 +01:00
Merge branch 'hotfix-domain-size' into 'hannes-philipp'
fix!: domain size can also be real number See merge request naaice/tug!15
This commit is contained in:
commit
55509c1934
@ -121,17 +121,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.
|
||||||
@ -160,12 +160,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
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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!");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user