Test-slicedField.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 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 Application
25  slicedFieldTest
26 
27 Description
28 
29 \*---------------------------------------------------------------------------*/
30 
31 #include "fvCFD.H"
32 #include "SlicedGeometricField.H"
33 #include "slicedFvPatchFields.H"
34 #include "slicedSurfaceFields.H"
35 
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 
38 int main(int argc, char *argv[])
39 {
40  #include "setRootCase.H"
41 
42  #include "createTime.H"
43  #include "createMesh.H"
44 
45  Info<< "Reading field p\n" << endl;
47  (
48  IOobject
49  (
50  "p",
51  runTime.timeName(),
52  mesh,
53  IOobject::MUST_READ,
54  IOobject::AUTO_WRITE
55  ),
56  mesh
57  );
58 
59  //Info<< min(p, p);
60 
61  Info<< "Reading field U\n" << endl;
63  (
64  IOobject
65  (
66  "U",
67  runTime.timeName(),
68  mesh,
69  IOobject::MUST_READ,
70  IOobject::AUTO_WRITE
71  ),
72  mesh
73  );
74 
76  C
77  (
78  IOobject
79  (
80  "C2",
81  runTime.timeName(),
82  mesh
83  ),
84  mesh,
85  dimLength,
86  mesh.cellCentres(),
88  );
89 
90  Info<< C << endl;
91  Info<< (C & U) << endl;
92 
94  <
95  vector,
99  >
100  Sf
101  (
102  IOobject
103  (
104  "Sf2",
105  runTime.timeName(),
106  mesh
107  ),
108  mesh,
109  dimArea,
110  mesh.faceAreas()
111  );
112 
113  //Info<< Sf << endl;
114 
115  return 0;
116 }
117 
118 
119 // ************************************************************************* //
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
p
p
Definition: pEqn.H:62
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
SlicedGeometricField.H
Foam::surfaceMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: surfaceMesh.H:47
Foam::fvsPatchField
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:65
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
C
volScalarField & C
Definition: readThermalProperties.H:104
U
U
Definition: pEqn.H:46
Foam::dimArea
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:57
Foam::Info
messageStream Info
Foam::slicedFvsPatchField
Specialization of fvsPatchField which creates the underlying fvsPatchField as a slice of the given co...
Definition: slicedFvsPatchField.H:55
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
main
int main(int argc, char *argv[])
Definition: Test-slicedField.C:35
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
slicedFvPatchFields.H
setRootCase.H
Foam::primitiveMesh::cellCentres
const vectorField & cellCentres() const
Definition: primitiveMeshCellCentresAndVols.C:211
Foam::primitiveMesh::faceCentres
const vectorField & faceCentres() const
Definition: primitiveMeshFaceCentresAndAreas.C:130
createMesh.H
createTime.H
slicedSurfaceFields.H
Foam::SlicedGeometricField
Specialization of GeometricField which holds slices of given complete fields in a form that they act ...
Definition: slicedSurfaceFieldsFwd.H:56
fvCFD.H
Foam::C
Graphite solid properties.
Definition: C.H:57
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::primitiveMesh::faceAreas
const vectorField & faceAreas() const
Definition: primitiveMeshFaceCentresAndAreas.C:141