diff --git a/include/tug/Grid.hpp b/include/tug/Grid.hpp index b2abdc2..db88429 100644 --- a/include/tug/Grid.hpp +++ b/include/tug/Grid.hpp @@ -121,17 +121,17 @@ class Grid { /** * @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. * - * @param domainRow An integer 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 domainRow A double value of the domain size in y-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. @@ -160,12 +160,12 @@ class Grid { int col; // number of grid columns int row; // number of grid rows int dim; // 1D or 2D - int domainCol; // number of domain columns - int domainRow; // number of domain rows + double domainCol; // number of domain columns + double domainRow; // number of domain rows double deltaCol; // delta in x-direction (between columns) double deltaRow; // delta in y-direction (between rows) MatrixXd concentrations; // Matrix holding grid concentrations MatrixXd alphaX; // Matrix holding alpha coefficients in x-direction MatrixXd alphaY; // Matrix holding alpha coefficients in y-direction -}; \ No newline at end of file +}; diff --git a/src/Grid.cpp b/src/Grid.cpp index e215e9a..dd4ef18 100644 --- a/src/Grid.cpp +++ b/src/Grid.cpp @@ -117,7 +117,7 @@ int Grid::getCol() { return col; } -void Grid::setDomain(int domainLength) { +void Grid::setDomain(double domainLength) { if (dim != 1) { 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); } -void Grid::setDomain(int domainRow, int domainCol) { +void Grid::setDomain(double domainRow, double domainCol) { if (dim != 2) { throw_invalid_argument("Grid is not two dimensional, you should probably use the 1D domain setter!"); }