processorFaMeshes.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016-2017 Wikki Ltd
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "processorFaMeshes.H"
29 #include "Time.H"
30 
31 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
32 
33 void Foam::processorFaMeshes::read()
34 {
35  forAll(fvMeshes_, procI)
36  {
37  meshes_.set
38  (
39  procI,
40  new faMesh(fvMeshes_[procI])
41  );
42 
43  pointProcAddressing_.set
44  (
45  procI,
46  new labelIOList
47  (
48  IOobject
49  (
50  "pointProcAddressing",
51  meshes_[procI].time().findInstance
52  (
53  meshes_[procI].meshDir(),
54  "pointProcAddressing"
55  ),
56  meshes_[procI].meshSubDir,
57  fvMeshes_[procI],
60  )
61  )
62  );
63 
64  edgeProcAddressing_.set
65  (
66  procI,
67  new labelIOList
68  (
69  IOobject
70  (
71  "edgeProcAddressing",
72  meshes_[procI].time().findInstance
73  (
74  meshes_[procI].meshDir(),
75  "edgeProcAddressing"
76  ),
77  meshes_[procI].meshSubDir,
78  fvMeshes_[procI],
81  )
82  )
83  );
84 
85  faceProcAddressing_.set
86  (
87  procI,
88  new labelIOList
89  (
90  IOobject
91  (
92  "faceProcAddressing",
93  meshes_[procI].time().findInstance
94  (
95  meshes_[procI].meshDir(),
96  "faceProcAddressing"
97  ),
98  meshes_[procI].meshSubDir,
99  fvMeshes_[procI],
102  )
103  )
104  );
105 
106  boundaryProcAddressing_.set
107  (
108  procI,
109  new labelIOList
110  (
111  IOobject
112  (
113  "boundaryProcAddressing",
114  meshes_[procI].time().findInstance
115  (
116  meshes_[procI].meshDir(),
117  "faceProcAddressing"
118  ),
119  meshes_[procI].meshSubDir,
120  fvMeshes_[procI],
123  )
124  )
125  );
126  }
127 }
128 
129 
130 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
131 
132 Foam::processorFaMeshes::processorFaMeshes
133 (
134  const UPtrList<fvMesh>& processorFvMeshes
135 )
136 :
137  fvMeshes_(processorFvMeshes),
138  meshes_(processorFvMeshes.size()),
139  pointProcAddressing_(meshes_.size()),
140  edgeProcAddressing_(meshes_.size()),
141  faceProcAddressing_(meshes_.size()),
142  boundaryProcAddressing_(meshes_.size())
143 {
144  read();
145 }
146 
147 
148 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::UPtrList::size
label size() const noexcept
The number of elements in the list.
Definition: UPtrListI.H:106
processorFaMeshes.H
Foam::read
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
Foam::labelIOList
IOList< label > labelIOList
Label container classes.
Definition: labelIOList.H:44
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::UPtrList
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:62
Time.H
Foam::IOobject::MUST_READ
Definition: IOobject.H:185