OpenFOAM: API Guide
v2006
The open source CFD toolbox
checkFaceAddressingComp.H
Go to the documentation of this file.
1
{
2
// Foam version 2.1 changes the addressing of faces in faceProcAddressing
3
// The following code checks and modifies the addressing for cases where
4
// the decomposition has been done with the foam2.0 and earlier tools, but
5
// the reconstruction is attempted with version 2.1 or later
6
7
label minFaceIndex =
labelMax
;
8
9
PtrList<labelIOList>&
faceProcAddressing
= procMeshes.faceProcAddressing();
10
11
forAll
(
faceProcAddressing
, proci)
12
{
13
const
labelList
& curFaceAddr =
faceProcAddressing
[proci];
14
15
forAll
(curFaceAddr, facei)
16
{
17
if
(
mag
(curFaceAddr[facei]) < minFaceIndex)
18
{
19
minFaceIndex =
mag
(curFaceAddr[facei]);
20
}
21
}
22
}
23
24
if
(minFaceIndex < 1)
25
{
26
WarningInFunction
27
<<
"parallel decomposition addressing."
<<
endl
28
<<
"It looks like you are trying to reconstruct the case "
29
<<
"decomposed with an earlier version of FOAM, which could\n"
30
<<
"potentially cause compatibility problems. The code will "
31
<<
"attempt to update the addressing automatically; in case of\n"
32
<<
"failure, please repeat the decomposition of the case using "
33
<<
"the current version fo decomposePar"
34
<<
endl
;
35
36
forAll
(
faceProcAddressing
, proci)
37
{
38
labelList
& curFaceAddr =
faceProcAddressing
[proci];
39
40
forAll
(curFaceAddr, facei)
41
{
42
curFaceAddr[facei] +=
sign
(curFaceAddr[facei]);
43
}
44
45
faceProcAddressing
[proci].write();
46
}
47
}
48
}
Foam::labelList
List< label > labelList
A List of labels.
Definition:
List.H:71
faceProcAddressing
PtrList< labelIOList > & faceProcAddressing
Definition:
checkFaceAddressingComp.H:9
Foam::labelMax
constexpr label labelMax
Definition:
label.H:61
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:350
Foam::sign
dimensionedScalar sign(const dimensionedScalar &ds)
Definition:
dimensionedScalar.C:166
forAll
forAll(faceProcAddressing, proci)
Definition:
checkFaceAddressingComp.H:11
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition:
messageStream.H:298
applications
utilities
parallelProcessing
reconstructPar
checkFaceAddressingComp.H
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.