faFieldReconstructor.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  Copyright (C) 2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "faFieldReconstructor.H"
30 #include "areaFields.H"
31 #include "edgeFields.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
36 
37 
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 
40 Foam::faFieldReconstructor::faFieldReconstructor
41 (
42  faMesh& mesh,
43  const PtrList<faMesh>& procMeshes,
44  const PtrList<labelIOList>& edgeProcAddressing,
45  const PtrList<labelIOList>& faceProcAddressing,
46  const PtrList<labelIOList>& boundaryProcAddressing
47 )
48 :
49  mesh_(mesh),
50  procMeshes_(procMeshes),
51  edgeProcAddressing_(edgeProcAddressing),
52  faceProcAddressing_(faceProcAddressing),
53  boundaryProcAddressing_(boundaryProcAddressing),
54  nReconstructed_(0)
55 {}
56 
57 
58 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
59 
61 (
62  const IOobjectList& objects,
63  const wordRes& selected
64 )
65 {
66  label nTotal = 0;
67 
68  do
69  {
70  #undef doLocalCode
71  #define doLocalCode(Method) \
72  { \
73  nTotal += this->Method <scalar> (objects, selected); \
74  nTotal += this->Method <vector> (objects, selected); \
75  nTotal += this->Method <sphericalTensor> (objects, selected); \
76  nTotal += this->Method <symmTensor> (objects, selected); \
77  nTotal += this->Method <tensor> (objects, selected); \
78  }
79 
82 
83  #undef doLocalCode
84  }
85  while (false);
86 
87  return nTotal;
88 }
89 
90 
91 // ************************************************************************* //
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:87
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
Definition: IOobjectList.H:55
#define doLocalCode(Method)
label reconstructEdgeFields(const UPtrList< const IOobject > &fieldObjects)
Read, reconstruct and write specified edge fields.
static int verbose_
Output verbosity when writing.
dynamicFvMesh & mesh
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:53
label reconstructAllFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Reconstruct all supported area/edge field types.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
label reconstructAreaFields(const UPtrList< const IOobject > &fieldObjects)
Read, reconstruct and write specified area fields.