84 const TAdj &cell2cellFaceV,
85 const std::vector<index> localPartStarts_in,
100 for (
int iPart = 0; iPart < nParts; iPart++)
115 std::vector<std::unordered_set<index>> cell2cellFaceVEnlarged;
119 cell2cellFaceVEnlarged.resize(this->
Num());
120 for (
index iCell = 0; iCell < this->
Num(); iCell++)
121 for (
auto iCO : cell2cellFaceV[iCell])
122 cell2cellFaceVEnlarged[iCell].insert(iCO);
123 for (
int iFill = 0; iFill < iluCode; iFill++)
125 for (
index iCell = 0; iCell < this->
Num(); iCell++)
127 std::unordered_set<index> newNeighbor;
128 for (
auto iCO : cell2cellFaceVEnlarged[iCell])
129 for (
auto iCOO : cell2cellFaceV[iCO])
130 newNeighbor.insert(iCOO);
131 for (
auto iCN : newNeighbor)
132 cell2cellFaceVEnlarged[iCell].insert(iCN);
135 for (
index iCell = 0; iCell < this->
Num(); iCell++)
136 cell2cellFaceVEnlarged[iCell].erase(iCell);
139 std::vector<std::unordered_set<index>> triLowRows;
140 std::vector<std::unordered_set<index>> triUppRows;
141 std::vector<std::unordered_set<index>> midSymMatCols;
142 triLowRows.resize(this->
Num());
143 triUppRows.resize(this->
Num());
144 midSymMatCols.resize(this->
Num());
147 for (
index iCellP = 0; iCellP < this->
Num(); iCellP++)
150 midSymMatCols[iCellP].insert(iCellP);
151 for (
auto iCellOther : cell2cellFaceV[iCell])
154 midSymMatCols[iCellP].insert(iCellOtherP);
156 nnzOrig += cell2cellFaceV[iCell].size();
159 for (
index iCellP = 0; iCellP < this->
Num(); iCellP++)
161 for (
auto iCellOtherP : midSymMatCols[iCellP])
162 if (iCellOtherP > iCellP)
165 for (
auto iCellOtherPP : midSymMatCols[iCellP])
166 if (iCellOtherPP > iCellOtherP)
171 if (iluCode < 0 || (iluCode > 0 && cell2cellFaceVEnlarged[iCellOther].count(iCellOtherOther)))
173 midSymMatCols[iCellOtherPP].insert(iCellOtherP);
174 midSymMatCols[iCellOtherP].insert(iCellOtherPP);
177 triLowRows[iCellOtherP].insert(iCellP);
178 triUppRows[iCellP].insert(iCellOtherP);
183 upperTriStructure.resize(this->
Num());
184 lowerTriStructureNew.resize(this->
Num());
185 upperTriStructureNew.resize(this->
Num());
186 index nnzLower{0}, nnzUpper{0};
187 for (
index iCellP = 0; iCellP < this->
Num(); iCellP++)
194 for (
auto iCellOtherP : triLowRows[iCellP])
196 for (
auto iCellOtherP : triUppRows[iCellP])
212 log() <<
"Direct::ObtainSymmetricSymbolicFactorization(): Factorizing Done" << std::endl;
214 {
log() << fmt::format(
" ({}, {}/{})",
mpi.
rank,
215 nnzLower + nnzUpper + this->Num(),
217 << (((
mpi.
rank + 1) % 10) ?
"" :
"\n")
222 DNDS_assert_info(nnzLower == nnzUpper, fmt::format(
"nnzLower,Upper: [{},{}]", nnzLower, nnzUpper));
226 for (
index iP = 0; iP < this->
Num(); iP++)
230 for (
int ijP = 0; ijP < lowerRow.size(); ijP++)
232 index jP = lowerRow[ijP];
234 auto ret = std::lower_bound(upperRow.begin(), upperRow.end(), iP);
237 ? (ret - upperRow.begin())
244 for (
index iP = 0; iP < this->
Num(); iP++)
248 for (
int ijP = 0; ijP < upperRow.size(); ijP++)
250 index jP = upperRow[ijP];
252 auto ret = std::lower_bound(lowerRow.begin(), lowerRow.end(), iP);
255 ? (ret - lowerRow.begin())
264 cell2cellFaceVLocal2FullRowPos[
i].resize(cell2cellFaceV[
i].size(), -1);
265 for (
int ic2c = 0; ic2c < cell2cellFaceV[
i].size(); ic2c++)
267 index j = cell2cellFaceV[
i][ic2c];
272 auto ret = std::lower_bound(row.begin(), row.end(), jP);
275 (ret - row.begin()) + 1;
280 auto ret = std::lower_bound(row.begin(), row.end(), jP);