fvFieldReconstructor.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 | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "fvFieldReconstructor.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 (
32  fvMesh& mesh,
33  const PtrList<fvMesh>& procMeshes,
35  const PtrList<labelIOList>& cellProcAddressing,
36  const PtrList<labelIOList>& boundaryProcAddressing
37 )
38 :
39  mesh_(mesh),
40  procMeshes_(procMeshes),
41  faceProcAddressing_(faceProcAddressing),
42  cellProcAddressing_(cellProcAddressing),
43  boundaryProcAddressing_(boundaryProcAddressing),
44  nReconstructed_(0)
45 {
46  forAll(procMeshes_, procI)
47  {
48  const fvMesh& procMesh = procMeshes_[procI];
49  if
50  (
51  faceProcAddressing[procI].size() != procMesh.nFaces()
52  || cellProcAddressing[procI].size() != procMesh.nCells()
53  || boundaryProcAddressing[procI].size() != procMesh.boundary().size()
54  )
55  {
57  << "Size of maps does not correspond to size of mesh"
58  << " for processor " << procI << endl
59  << "faceProcAddressing : " << faceProcAddressing[procI].size()
60  << " nFaces : " << procMesh.nFaces() << endl
61  << "cellProcAddressing : " << cellProcAddressing[procI].size()
62  << " nCell : " << procMesh.nCells() << endl
63  << "boundaryProcAddressing : "
64  << boundaryProcAddressing[procI].size()
65  << " nFaces : " << procMesh.boundary().size()
66  << exit(FatalError);
67  }
68  }
69 }
70 
71 
72 // ************************************************************************* //
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
fvFieldReconstructor.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::primitiveMesh::nCells
label nCells() const
Definition: primitiveMeshI.H:64
Foam::fvFieldReconstructor::fvFieldReconstructor
fvFieldReconstructor(const fvFieldReconstructor &)
Disallow default bitwise copy construct.
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::FatalError
error FatalError
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::fvMesh::boundary
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:550
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::primitiveMesh::nFaces
label nFaces() const
Definition: primitiveMeshI.H:58
Foam::PtrList::size
label size() const
Return the number of elements in the PtrList.
Definition: PtrListI.H:32
faceProcAddressing
PtrList< labelIOList > & faceProcAddressing
Definition: checkFaceAddressingComp.H:9