Refactoring function name + signature
- domain_size is now double value - fillVectorFromRow2D renamed to fillVectorFromRowADI
This commit is contained in:
parent
e1a08ea555
commit
6661a8cbd4
@ -26,7 +26,7 @@ BTCSDiffusion::BTCSDiffusion(unsigned int dim) : grid_dim(dim) {
|
|||||||
deltas.resize(dim, 1);
|
deltas.resize(dim, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTCSDiffusion::setXDimensions(unsigned int domain_size,
|
void BTCSDiffusion::setXDimensions(double domain_size,
|
||||||
unsigned int n_grid_cells) {
|
unsigned int n_grid_cells) {
|
||||||
assert(this->grid_dim > 0);
|
assert(this->grid_dim > 0);
|
||||||
this->domain_size[0] = domain_size;
|
this->domain_size[0] = domain_size;
|
||||||
@ -35,7 +35,7 @@ void BTCSDiffusion::setXDimensions(unsigned int domain_size,
|
|||||||
updateInternals();
|
updateInternals();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTCSDiffusion::setYDimensions(unsigned int domain_size,
|
void BTCSDiffusion::setYDimensions(double domain_size,
|
||||||
unsigned int n_grid_cells) {
|
unsigned int n_grid_cells) {
|
||||||
assert(this->grid_dim > 1);
|
assert(this->grid_dim > 1);
|
||||||
this->domain_size[1] = domain_size;
|
this->domain_size[1] = domain_size;
|
||||||
@ -44,7 +44,7 @@ void BTCSDiffusion::setYDimensions(unsigned int domain_size,
|
|||||||
updateInternals();
|
updateInternals();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTCSDiffusion::setZDimensions(unsigned int domain_size,
|
void BTCSDiffusion::setZDimensions(double domain_size,
|
||||||
unsigned int n_grid_cells) {
|
unsigned int n_grid_cells) {
|
||||||
assert(this->grid_dim > 2);
|
assert(this->grid_dim > 2);
|
||||||
this->domain_size[2] = domain_size;
|
this->domain_size[2] = domain_size;
|
||||||
@ -158,7 +158,7 @@ void BTCSDiffusion::simulate2D(Eigen::Map<DMatrixRowMajor> &c,
|
|||||||
|
|
||||||
fillMatrixFromRow(alpha.row(i), n_cols, i, left_constant, right_constant,
|
fillMatrixFromRow(alpha.row(i), n_cols, i, left_constant, right_constant,
|
||||||
deltas[0], this->time_step / 2);
|
deltas[0], this->time_step / 2);
|
||||||
fillVectorFromRow2D(c, alpha.row(i), i, deltas[0], left, right);
|
fillVectorFromRowADI(c, alpha.row(i), i, deltas[0], left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
solveLES();
|
solveLES();
|
||||||
@ -190,7 +190,7 @@ void BTCSDiffusion::simulate2D(Eigen::Map<DMatrixRowMajor> &c,
|
|||||||
|
|
||||||
fillMatrixFromRow(alpha.col(i), n_cols, i, left_constant, right_constant,
|
fillMatrixFromRow(alpha.col(i), n_cols, i, left_constant, right_constant,
|
||||||
deltas[1], this->time_step / 2);
|
deltas[1], this->time_step / 2);
|
||||||
fillVectorFromRow2D(c, alpha.row(i), i, deltas[1], left, right);
|
fillVectorFromRowADI(c, alpha.row(i), i, deltas[1], left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
solveLES();
|
solveLES();
|
||||||
@ -237,7 +237,7 @@ void BTCSDiffusion::fillMatrixFromRow(const DVectorRowMajor &alpha, int n_cols,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTCSDiffusion::fillVectorFromRow2D(Eigen::Map<DMatrixRowMajor> &c,
|
void BTCSDiffusion::fillVectorFromRowADI(Eigen::Map<DMatrixRowMajor> &c,
|
||||||
const Eigen::VectorXd alpha, int row,
|
const Eigen::VectorXd alpha, int row,
|
||||||
double delta, boundary_condition left,
|
double delta, boundary_condition left,
|
||||||
boundary_condition right) {
|
boundary_condition right) {
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public:
|
|||||||
* @param n_grid_cells Number of grid cells in x direction the domain is
|
* @param n_grid_cells Number of grid cells in x direction the domain is
|
||||||
* divided to.
|
* divided to.
|
||||||
*/
|
*/
|
||||||
void setXDimensions(unsigned int domain_size, unsigned int n_grid_cells);
|
void setXDimensions(double domain_size, unsigned int n_grid_cells);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Define the grid in y direction.
|
* Define the grid in y direction.
|
||||||
@ -62,7 +62,7 @@ public:
|
|||||||
* @param n_grid_cells Number of grid cells in y direction the domain is
|
* @param n_grid_cells Number of grid cells in y direction the domain is
|
||||||
* divided to.
|
* divided to.
|
||||||
*/
|
*/
|
||||||
void setYDimensions(unsigned int domain_size, unsigned int n_grid_cells);
|
void setYDimensions(double domain_size, unsigned int n_grid_cells);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Define the grid in z direction.
|
* Define the grid in z direction.
|
||||||
@ -73,7 +73,7 @@ public:
|
|||||||
* @param n_grid_cells Number of grid cells in z direction the domain is
|
* @param n_grid_cells Number of grid cells in z direction the domain is
|
||||||
* divided to.
|
* divided to.
|
||||||
*/
|
*/
|
||||||
void setZDimensions(unsigned int domain_size, unsigned int n_grid_cells);
|
void setZDimensions(double domain_size, unsigned int n_grid_cells);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Returns the number of grid cells in x direction.
|
* Returns the number of grid cells in x direction.
|
||||||
@ -152,7 +152,7 @@ private:
|
|||||||
void fillMatrixFromRow(const DVectorRowMajor &alpha, int n_cols, int row,
|
void fillMatrixFromRow(const DVectorRowMajor &alpha, int n_cols, int row,
|
||||||
bool left_constant, bool right_constant, double delta,
|
bool left_constant, bool right_constant, double delta,
|
||||||
double time_step);
|
double time_step);
|
||||||
void fillVectorFromRow2D(Eigen::Map<DMatrixRowMajor> &c,
|
void fillVectorFromRowADI(Eigen::Map<DMatrixRowMajor> &c,
|
||||||
const Eigen::VectorXd alpha, int row, double delta,
|
const Eigen::VectorXd alpha, int row, double delta,
|
||||||
boundary_condition left, boundary_condition right);
|
boundary_condition left, boundary_condition right);
|
||||||
void simulate3D(std::vector<double> &c);
|
void simulate3D(std::vector<double> &c);
|
||||||
@ -172,7 +172,7 @@ private:
|
|||||||
int grid_dim;
|
int grid_dim;
|
||||||
|
|
||||||
std::vector<unsigned int> grid_cells;
|
std::vector<unsigned int> grid_cells;
|
||||||
std::vector<unsigned int> domain_size;
|
std::vector<double> domain_size;
|
||||||
std::vector<double> deltas;
|
std::vector<double> deltas;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user