faFieldReconstructor.H
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 Class
27  Foam::faFieldReconstructor
28 
29 Description
30  Finite Area area and edge fields reconstruction.
31 
32 Author
33  Zeljko Tukovic, FSB Zagreb
34  Hrvoje Jasak, Wikki Ltd.
35 
36 SourceFiles
37  faFieldReconstructor.C
38  faFieldReconstructorFields.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef faFieldReconstructor_H
43 #define faFieldReconstructor_H
44 
45 #include "PtrList.H"
46 #include "faMesh.H"
47 #include "IOobjectList.H"
48 #include "faPatchFieldMapper.H"
49 #include "labelIOList.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class faFieldReconstructor Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 {
62  // Private data
63 
64  //- Reconstructed mesh reference
65  faMesh& mesh_;
66 
67  //- List of processor meshes
68  const PtrList<faMesh>& procMeshes_;
69 
70  //- List of processor edge addressing lists
71  const PtrList<labelIOList>& edgeProcAddressing_;
72 
73  //- List of processor face addressing lists
74  const PtrList<labelIOList>& faceProcAddressing_;
75 
76  //- List of processor boundary addressing lists
77  const PtrList<labelIOList>& boundaryProcAddressing_;
78 
79 
80  // Private Member Functions
81 
82  //- No copy construct
84 
85  //- No copy assignment
86  void operator=(const faFieldReconstructor&) = delete;
87 
88 
89 public:
90 
92  :
93  public faPatchFieldMapper
94  {
95  label size_;
96  label sizeBeforeMapping_;
97 
98  public:
99 
100  // Constructors
101 
102  //- Construct given size
104  (
105  const label size,
106  const label sizeBeforeMapping
107  )
108  :
109  size_(size),
110  sizeBeforeMapping_(sizeBeforeMapping)
111  {}
112 
113 
114  // Member functions
115 
116  virtual label size() const
117  {
118  return size_;
119  }
120 
121  virtual label sizeBeforeMapping() const
122  {
123  return sizeBeforeMapping_;
124  }
125 
126  virtual bool direct() const
127  {
128  return true;
129  }
130 
131  virtual bool hasUnmapped() const
132  {
133  return false;
134  }
135 
136  virtual const labelUList& directAddressing() const
137  {
138  return labelUList::null();
139  }
140  };
141 
142 
143  // Constructors
144 
145  //- Construct from components
147  (
148  faMesh& mesh,
149  const PtrList<faMesh>& procMeshes,
150  const PtrList<labelIOList>& edgeProcAddressing,
152  const PtrList<labelIOList>& boundaryProcAddressing
153  );
154 
155 
156  // Member Functions
157 
158  //- Reconstruct area field
159  template<class Type>
162  (
163  const IOobject& fieldIoObject
164  );
165 
166  //- Reconstruct edge field
167  template<class Type>
170  (
171  const IOobject& fieldIoObject
172  );
173 
174  //- Reconstruct and write all area fields
175  template<class Type>
177  (
178  const IOobjectList& objects
179  );
180 
181  //- Reconstruct and write all area fields
182  template<class Type>
184  (
185  const IOobjectList& objects
186  );
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #ifdef NoRepository
198 #endif
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #endif
203 
204 // ************************************************************************* //
Foam::faFieldReconstructor::reconstructFaAreaField
tmp< GeometricField< Type, faPatchField, areaMesh > > reconstructFaAreaField(const IOobject &fieldIoObject)
Reconstruct area field.
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
faceProcAddressing
PtrList< labelIOList > & faceProcAddressing
Definition: checkFaceAddressingComp.H:9
Foam::faFieldReconstructor::faPatchFieldReconstructor::size
virtual label size() const
Definition: faFieldReconstructor.H:115
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::faFieldReconstructor
Finite Area area and edge fields reconstruction.
Definition: faFieldReconstructor.H:59
Foam::faFieldReconstructor::faPatchFieldReconstructor::faPatchFieldReconstructor
faPatchFieldReconstructor(const label size, const label sizeBeforeMapping)
Construct given size.
Definition: faFieldReconstructor.H:103
Foam::faFieldReconstructor::reconstructFaAreaFields
void reconstructFaAreaFields(const IOobjectList &objects)
Reconstruct and write all area fields.
Definition: faFieldReconstructorFields.C:575
IOobjectList.H
faMesh.H
Foam::faPatchFieldMapper
Definition: faPatchFieldMapper.H:44
faPatchFieldMapper.H
Foam::faFieldReconstructor::faPatchFieldReconstructor
Definition: faFieldReconstructor.H:90
Foam::faFieldReconstructor::faPatchFieldReconstructor::sizeBeforeMapping
virtual label sizeBeforeMapping() const
Definition: faFieldReconstructor.H:120
Foam::faFieldReconstructor::reconstructFaEdgeFields
void reconstructFaEdgeFields(const IOobjectList &objects)
Reconstruct and write all area fields.
Definition: faFieldReconstructorFields.C:602
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faFieldReconstructor::reconstructFaEdgeField
tmp< GeometricField< Type, faePatchField, edgeMesh > > reconstructFaEdgeField(const IOobject &fieldIoObject)
Reconstruct edge field.
Foam::IOobjectList
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:55
Foam::faFieldReconstructor::faPatchFieldReconstructor::direct
virtual bool direct() const
Definition: faFieldReconstructor.H:125
faFieldReconstructorFields.C
labelIOList.H
Foam::UList< label >
PtrList.H
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::faFieldReconstructor::faPatchFieldReconstructor::directAddressing
virtual const labelUList & directAddressing() const
Definition: faFieldReconstructor.H:135
Foam::UList::null
static const UList< T > & null()
Return a UList reference to a nullObject.
Definition: UListI.H:53
Foam::faFieldReconstructor::faPatchFieldReconstructor::hasUnmapped
virtual bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Definition: faFieldReconstructor.H:130