MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / initMesh

Function initMesh

src/OpenFOAM/meshes/polyMesh/polyMeshInitMesh.C:30–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29
30void Foam::polyMesh::initMesh()
31{
32 if (debug)
33 {
34 InfoInFunction << "initialising primitiveMesh" << endl;
35 }
36
37 // For backward compatibility check if the neighbour array is the same
38 // length as the owner and shrink to remove the -1s padding
39 if (neighbour_.size() == owner_.size())
40 {
41 label nInternalFaces = 0;
42
43 forAll(neighbour_, facei)
44 {
45 if (neighbour_[facei] == -1)
46 {
47 break;
48 }
49 else
50 {
51 nInternalFaces++;
52 }
53 }
54
55 neighbour_.setSize(nInternalFaces);
56 }
57
58 label nCells = -1;
59
60 forAll(owner_, facei)
61 {
62 if (owner_[facei] < 0)
63 {
64 FatalErrorInFunction
65 << "Illegal cell label " << owner_[facei]
66 << " in neighbour addressing for face " << facei
67 << exit(FatalError);
68 }
69 nCells = max(nCells, owner_[facei]);
70 }
71
72 // The neighbour array may or may not be the same length as the owner
73 forAll(neighbour_, facei)
74 {
75 if (neighbour_[facei] < 0)
76 {
77 FatalErrorInFunction
78 << "Illegal cell label " << neighbour_[facei]
79 << " in neighbour addressing for face " << facei
80 << exit(FatalError);
81 }
82 nCells = max(nCells, neighbour_[facei]);
83 }
84
85 nCells++;
86
87 // Reset the primitiveMesh with the sizes of the primitive arrays

Callers 4

polyMeshIO.CFile · 0.85
polyMesh.CFile · 0.85
resetPrimitivesFunction · 0.85

Calls 9

maxFunction · 0.85
forAllFunction · 0.50
exitFunction · 0.50
resetFunction · 0.50
nameFunction · 0.50
sizeMethod · 0.45
setSizeMethod · 0.45
nCellsMethod · 0.45
nInternalFacesMethod · 0.45

Tested by

no test coverage detected