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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
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 "fvFieldReconstructor.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 Foam::fvFieldReconstructor::fvFieldReconstructor
33 (
34  fvMesh& mesh,
35  const PtrList<fvMesh>& procMeshes,
37  const PtrList<labelIOList>& cellProcAddressing,
38  const PtrList<labelIOList>& boundaryProcAddressing
39 )
40 :
41  mesh_(mesh),
42  procMeshes_(procMeshes),
43  faceProcAddressing_(faceProcAddressing),
44  cellProcAddressing_(cellProcAddressing),
45  boundaryProcAddressing_(boundaryProcAddressing),
46  nReconstructed_(0)
47 {
48  forAll(procMeshes_, proci)
49  {
50  const fvMesh& procMesh = procMeshes_[proci];
51  if
52  (
53  faceProcAddressing[proci].size() != procMesh.nFaces()
54  || cellProcAddressing[proci].size() != procMesh.nCells()
55  || boundaryProcAddressing[proci].size() != procMesh.boundary().size()
56  )
57  {
59  << "Size of maps does not correspond to size of mesh"
60  << " for processor " << proci << endl
61  << "faceProcAddressing : " << faceProcAddressing[proci].size()
62  << " nFaces : " << procMesh.nFaces() << endl
63  << "cellProcAddressing : " << cellProcAddressing[proci].size()
64  << " nCell : " << procMesh.nCells() << endl
65  << "boundaryProcAddressing : "
66  << boundaryProcAddressing[proci].size()
67  << " nFaces : " << procMesh.boundary().size()
68  << exit(FatalError);
69  }
70  }
71 }
72 
73 
74 // ************************************************************************* //
faceProcAddressing
PtrList< labelIOList > & faceProcAddressing
Definition: checkFaceAddressingComp.H:9
fvFieldReconstructor.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::primitiveMesh::nCells
label nCells() const noexcept
Number of mesh cells.
Definition: primitiveMeshI.H:96
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::FatalError
error FatalError
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::fvMesh::boundary
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:685
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::primitiveMesh::nFaces
label nFaces() const noexcept
Number of mesh faces.
Definition: primitiveMeshI.H:90