Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / regionModels / regionModel / regionModel1D / regionModel1D.H
blob7d51d3ef365794f4dcf8634e6d1ad44a2377af92
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2010-2011 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Class
25     Foam::regionModel1D
27 Description
28     Base class for 1-D region models
30 SourceFiles
31     regionModel1D.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef regionModel1D_H
36 #define regionModel1D_H
38 #include "regionModel.H"
39 #include "surfaceFields.H"
40 #include "labelList.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
46 namespace regionModels
49 /*---------------------------------------------------------------------------*\
50                        Class regionModel1D Declaration
51 \*---------------------------------------------------------------------------*/
53 class regionModel1D
55     public regionModel
58 private:
60     // Private Member Functions
62         //- Disallow default bitwise copy construct
63         regionModel1D(const regionModel1D&);
65         //- Disallow default bitwise assignment
66         void operator=(const regionModel1D&);
68         //- Construct region mesh and fields
69         void constructMeshObjects();
71         //- Initialise the region
72         void initialise();
75 protected:
77     // Protected data
79         // Region addressing - per internally coupled patch face walking out
81             //- Global face IDs
82             labelListList boundaryFaceFaces_;
84             //- Global cell IDs
85             labelListList boundaryFaceCells_;
87             //- Global boundary face IDs oppossite coupled patch
88             labelList boundaryFaceOppositeFace_;
90             //- Number of layers in the region
91             label nLayers_;
94         // Geometry
96             //- Face area magnitude normal to patch
97             autoPtr<surfaceScalarField> nMagSfPtr_;
99             //- Flag to allow mesh movement
100             Switch moveMesh_;
103     // Protected member functions
105         //- Read control parameters from dictionary
106         virtual bool read();
108         //- Move mesh points according to change in cell volumes
109         //  Returns map ordered by cell where 1 = cell moved, 0 = cell unchanged
110         tmp<labelField> moveMesh
111         (
112             const scalarList& deltaV,
113             const scalar minDelta = 0.0
114         );
117 public:
119     //- Runtime type information
120     TypeName("regionModel1D");
123     // Constructors
125         //- Construct null
126         regionModel1D(const fvMesh& mesh);
128         //- Construct from mesh, region type and name
129         regionModel1D
130         (
131             const fvMesh& mesh,
132             const word& regionType,
133             const word& modelName,
134             bool readFields = true
135         );
138     //- Destructor
139     virtual ~regionModel1D();
142     // Member Functions
144         // Access
146             // Addressing
148                 //- Return the global face IDs
149                 inline const labelListList& boundaryFaceFaces() const;
151                 //- Return the global cell IDs
152                 inline const labelListList& boundaryFaceCells() const;
154                 //- Return the global boundary face IDs oppossite coupled patch
155                 inline const labelList& boundaryFaceOppositeFace() const;
158             // Geometry
160                 //- Return the face area magnitudes / [m2]
161                 inline const surfaceScalarField& nMagSf() const;
163                 //- Return the number of layers in the region
164                 inline label nLayers() const;
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 } // End namespace regionModels
171 } // End namespace Foam
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 #include "regionModel1DI.H"
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 #endif
181 // ************************************************************************* //