Go to the documentation of this file.
129 nCells += lduMatrices[i].
size();
134 convert(lduMatrices);
142 convert(ldum, interfaceCoeffs, interfaces);
148 label nColumns = m();
152 Pout<<
"LUscalarMatrix : size:" << nRows <<
endl;
153 for (
label rowI = 0; rowI < nRows; rowI++)
155 const scalar*
row = operator[](rowI);
157 Pout<<
"cell:" << rowI <<
" diagCoeff:" <<
row[rowI] <<
endl;
159 Pout<<
" connects to upper cells :";
160 for (
label columnI = rowI+1; columnI < nColumns; columnI++)
162 if (
mag(
row[columnI]) > SMALL)
164 Pout<<
' ' << columnI <<
" (coeff:" <<
row[columnI]
169 Pout<<
" connects to lower cells :";
170 for (
label columnI = 0; columnI < rowI; columnI++)
172 if (
mag(
row[columnI]) > SMALL)
174 Pout<<
' ' << columnI <<
" (coeff:" <<
row[columnI]
183 pivotIndices_.setSize(
n());
201 const scalar* __restrict__ diagPtr = ldum.
diag().begin();
202 const scalar* __restrict__ upperPtr = ldum.
upper().begin();
203 const scalar* __restrict__ lowerPtr = ldum.
lower().begin();
218 operator[](uCell)[lCell] = lowerPtr[
face];
219 operator[](lCell)[uCell] = upperPtr[
face];
224 if (interfaces.
set(inti))
233 refCast<const cyclicLduInterface>(
interface);
235 const label* __restrict__ uPtr =
236 interfaces[nbrInt].interface().faceCells().
begin();
238 const scalar* __restrict__ nbrUpperLowerPtr =
239 interfaceCoeffs[nbrInt].begin();
248 operator[](uCell)[lCell] -= nbrUpperLowerPtr[
face];
262 procOffsets_.setSize(lduMatrices.
size() + 1);
265 forAll(lduMatrices, ldumi)
267 procOffsets_[ldumi+1] = procOffsets_[ldumi] + lduMatrices[ldumi].
size();
270 forAll(lduMatrices, ldumi)
273 label offset = procOffsets_[ldumi];
278 const scalar* __restrict__ diagPtr = lduMatrixi.
diag_.begin();
279 const scalar* __restrict__ upperPtr = lduMatrixi.
upper_.begin();
280 const scalar* __restrict__ lowerPtr = lduMatrixi.
lower_.begin();
288 operator[](globalCell)[globalCell] = diagPtr[
cell];
296 operator[](uCell)[lCell] = lowerPtr[
face];
297 operator[](lCell)[uCell] = upperPtr[
face];
311 const scalar* __restrict__ upperLowerPtr =
319 label lCell = ulPtr[
face + inFaces] + offset;
321 operator[](uCell)[lCell] -= upperLowerPtr[
face + inFaces];
322 operator[](lCell)[uCell] -= upperLowerPtr[
face];
333 lduMatrices[
interface.neighbProcNo_].interfaces_;
335 label neiInterfacei = -1;
337 forAll(neiInterfaces, ninti)
342 neiInterfaces[ninti].neighbProcNo_
345 && (neiInterfaces[ninti].tag_ ==
interface.tag_)
348 neiInterfacei = ninti;
353 if (neiInterfacei == -1)
359 neiInterfaces[neiInterfacei];
362 const label* __restrict__ lPtr =
365 const scalar* __restrict__ upperPtr =
interface.coeffs_.begin();
366 const scalar* __restrict__ lowerPtr =
377 operator[](uCell)[lCell] -= lowerPtr[
face];
378 operator[](lCell)[uCell] -= upperPtr[
face];
390 for (
label i=0; i<
n(); i++)
393 for (
label j=0; j<
n(); j++)
397 sum += operator[](i)[j];
labelList pivotIndices_
The pivot indices used in the LU decomposition.
const lduAddressing & lduAddr() const
Return the LDU addressing.
PtrList< procLduInterface > interfaces_
iterator begin()
Return an iterator to begin traversing the UPtrList.
#define forAll(list, i)
Loop across all elements in list.
Output inter-processor communications stream.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
label size() const
Return number of equations.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
iterator begin()
Return an iterator to begin traversing the UList.
virtual label neighbPatchID() const =0
Return neighbour.
I/O for lduMatrix and interface values.
interfaceProperties interface(alpha1, U, mixture())
bool set(const label) const
Is element set.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static int lastSlave(const label communicator=0)
Process index of last slave.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
IO interface for processorLduInterface.
static int masterNo()
Process index of the master.
static int firstSlave()
Process index of first slave.
void convert(const lduMatrix &ldum, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Convert the given lduMatrix into this LUscalarMatrix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void LUDecompose(scalarSquareMatrix &matrix, labelList &pivotIndices)
LU decompose the matrix with pivoting.
static bool master(const label communicator=0)
Am I the master process.
static int & msgType()
Message tag of standard messages.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
prefixOSstream Pout(cout, "Pout")
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
Inter-processor communications stream.
void printDiagonalDominance() const
Print the ratio of the mag-sum of the off-diagonal coefficients.
bool set(const label) const
Is element set.
label size() const
Return the number of elements in the PtrList.
const lduMesh & mesh() const
Return the LDU mesh from which the addressing is obtained.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
virtual label comm() const =0
Return communicator used for parallel communication.
Input inter-processor communications stream.
A face is a list of labels corresponding to mesh vertices.
LUscalarMatrix(const scalarSquareMatrix &)
Construct from scalarSquareMatrix and perform LU decomposition.
defineTypeNameAndDebug(combustionModel, 0)
A cell is defined as a list of faces with extra functionality.
An abstract base class for cyclic coupled interfaces.