Skip to content
Snippets Groups Projects
Commit 8a89d41f authored by Alexiane Plessier's avatar Alexiane Plessier
Browse files

Add corrections to first block matrix

parent ab3f4667
No related branches found
No related tags found
No related merge requests found
......@@ -118,20 +118,30 @@ class ImplicitAcousticSolver
S(row, col) = 1 + (rhocj[j] * rhocj[j] * 0.5 * inv_mj[j] * dt) * coef_diag;
}
for (CellId j = 1; j < m_mesh.numberOfCells() - 1; ++j) {
for (CellId j = 0; j < m_mesh.numberOfCells() - 1; ++j) {
const auto& cell_nodes = cell_to_node_matrix[j];
double coef_diag_o = 1. / (rhocr[cell_nodes[1]]);
double coef_diag_u = 1. / (rhocr[cell_nodes[0]]);
int row = transferFunction(0, j);
S(row - 1, row) = -rhocj[j] * rhocj[j] * dt * 0.5 * inv_mj[j] * coef_diag_o;
S(row + 1, row) = -rhocj[j] * rhocj[j] * dt * 0.5 * inv_mj[j] * coef_diag_u;
std::cout << "(" << row - 1 << "," << row << ")= " << S(row - 1, row) << '\n';
std::cout << "(" << row + 1 << "," << row << ")= " << S(row + 1, row) << '\n';
}
for (CellId j = 1; j < m_mesh.numberOfCells(); ++j) {
const auto& cell_nodes = cell_to_node_matrix[j];
double coef_diag_o = 1. / (rhocr[cell_nodes[1]]);
int row = transferFunction(0, j);
S(row - 1, row) = -rhocj[j] * rhocj[j] * dt * 0.5 * inv_mj[j] * coef_diag_o;
std::cout << "(" << row - 1 << "," << row << ")= " << S(row - 1, row) << '\n';
}
}
// S(TransferFunction(0, j), transferFunction(0, j)) = 0.5;
// std::cout << S(transferFunction(0, j), transferFunction(0, j)) << '\n';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment