mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use implicit mode to build jacMatrix
Fix print variable
This commit is contained in:
parent
550ce92902
commit
1cec56fa68
@ -520,10 +520,7 @@ namespace Opm
|
|||||||
|
|
||||||
typedef typename Matrix::size_type size_type;
|
typedef typename Matrix::size_type size_type;
|
||||||
size_type numCells = grid.size( 0 );
|
size_type numCells = grid.size( 0 );
|
||||||
blockJacobiForGPUILU0_.reset(new Matrix(numCells, numCells, Matrix::random));
|
blockJacobiForGPUILU0_.reset(new Matrix(numCells, numCells, 8, 0.4, Matrix::implicit));
|
||||||
|
|
||||||
std::vector<std::set<size_type>> pattern;
|
|
||||||
pattern.resize(numCells);
|
|
||||||
|
|
||||||
const auto& lid = grid.localIdSet();
|
const auto& lid = grid.localIdSet();
|
||||||
const auto& gridView = grid.leafGridView();
|
const auto& gridView = grid.leafGridView();
|
||||||
@ -533,14 +530,14 @@ namespace Opm
|
|||||||
//Loop over cells
|
//Loop over cells
|
||||||
for (; elemIt != elemEndIt; ++elemIt)
|
for (; elemIt != elemEndIt; ++elemIt)
|
||||||
{
|
{
|
||||||
|
|
||||||
const auto& elem = *elemIt;
|
const auto& elem = *elemIt;
|
||||||
size_type idx = lid.id(elem);
|
size_type idx = lid.id(elem);
|
||||||
pattern[idx].insert(idx);
|
blockJacobiForGPUILU0_->entry(idx, idx) = 0.0;
|
||||||
|
|
||||||
// Add well non-zero connections
|
// Add well non-zero connections
|
||||||
for (auto wc = wellConnectionsGraph_[idx].begin(); wc!=wellConnectionsGraph_[idx].end(); ++wc)
|
for (auto wc = wellConnectionsGraph_[idx].begin(); wc!=wellConnectionsGraph_[idx].end(); ++wc) {
|
||||||
pattern[idx].insert(*wc);
|
blockJacobiForGPUILU0_->entry(idx, *wc) = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
int locPart = cell_part[idx];
|
int locPart = cell_part[idx];
|
||||||
|
|
||||||
@ -553,25 +550,13 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
size_type nid = lid.id(is->outside());
|
size_type nid = lid.id(is->outside());
|
||||||
int nabPart = cell_part[nid];
|
int nabPart = cell_part[nid];
|
||||||
if (locPart == nabPart)
|
if (locPart == nabPart) {
|
||||||
pattern[idx].insert(nid);
|
blockJacobiForGPUILU0_->entry(idx, nid) = 0.0;
|
||||||
}
|
|
||||||
|
|
||||||
blockJacobiForGPUILU0_->setrowsize(idx, pattern[idx].size());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
blockJacobiForGPUILU0_->endrowsizes();
|
|
||||||
for (size_type dofId = 0; dofId < numCells; ++dofId)
|
|
||||||
{
|
|
||||||
auto nabIdx = pattern[dofId].begin();
|
|
||||||
auto endNab = pattern[dofId].end();
|
|
||||||
for (; nabIdx != endNab; ++nabIdx)
|
|
||||||
{
|
|
||||||
blockJacobiForGPUILU0_->addindex(dofId, *nabIdx);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
blockJacobiForGPUILU0_->compress();
|
||||||
blockJacobiForGPUILU0_->endindices();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void copyMatToBlockJac(const Matrix& mat, Matrix& blockJac)
|
void copyMatToBlockJac(const Matrix& mat, Matrix& blockJac)
|
||||||
|
@ -399,7 +399,7 @@ void openclSolverBackend<block_size>::initialize(std::shared_ptr<BlockedMatrix>
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
out << "Initializing GPU, matrix size: " << N << " blocks, nnzb: " << nnzb << "\n";
|
out << "Initializing GPU, matrix size: " << Nb << " blockrows, nnzb: " << nnzb << "\n";
|
||||||
if (useJacMatrix) {
|
if (useJacMatrix) {
|
||||||
out << "Blocks in ILU matrix: " << jac_nnzb << "\n";
|
out << "Blocks in ILU matrix: " << jac_nnzb << "\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user