OpenFOAM logo
Open Source CFD Toolkit

faceTetPolyPatchFaceDecomp.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     faceTetPolyPatchFaceDecomp
00027 
00028 Description
00029         A tetPolyPatch based on a polyPatch
00030 
00031 SourceFiles
00032     faceTetPolyPatchFaceDecomp.C
00033     faceTetPolyPatchFaceDecompM.C
00034     newTetPolyPatch.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef faceTetPolyPatchFaceDecomp_H
00039 #define faceTetPolyPatchFaceDecomp_H
00040 
00041 #include "tetPolyPatchFaceDecomp.H"
00042 #include "polyPatch.H"
00043 #include "autoPtr.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 // Class forward declarations
00051 class tetPolyBoundaryMeshFaceDecomp;
00052 
00053 /*---------------------------------------------------------------------------*\
00054                   Class faceTetPolyPatchFaceDecomp Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 class faceTetPolyPatchFaceDecomp
00058 :
00059     public tetPolyPatchFaceDecomp
00060 {
00061     // Private data
00062 
00063         //- Index of polyPatch in boundary
00064         //  Needs to be stored as faceTetPolyPatch does not hold a reference to
00065         //  a polyPatch in order to enable topological changes
00066         const label boundaryIndex_;
00067 
00068         //- Number of points
00069         label size_;
00070 
00071 
00072     // Demand driven private data
00073 
00074         //- Mesh points
00075         mutable labelList* meshPointsPtr_;
00076 
00077         //- Local points
00078         mutable pointField* localPointsPtr_;
00079 
00080         //- Point unit normals
00081         mutable vectorField* pointNormalsPtr_;
00082 
00083         //- Local edges indices
00084         mutable labelList* localEdgeIndicesPtr_;
00085 
00086         //- Cut edges indices, i.e. the ones originating from the
00087         //  points on the patch but connected to points which are
00088         //  internal (not on the patch)
00089         mutable labelList* cutEdgeIndicesPtr_;
00090 
00091 
00092     // Private Member Functions
00093 
00094         //- Disallow default bitwise copy construct
00095         faceTetPolyPatchFaceDecomp(const faceTetPolyPatchFaceDecomp&);
00096 
00097         //- Disallow default bitwise assignment
00098         void operator=(const faceTetPolyPatchFaceDecomp&);
00099 
00100         //- Clear out
00101         void clearOut();
00102 
00103 
00104 protected:
00105 
00106     // Member functions to calculate demand driven data
00107 
00108         //- Calculate mesh points
00109         labelList calcMeshPoints(const primitivePatch& p) const;
00110 
00111         //- Calculate local points
00112         void calcLocalPoints() const;
00113 
00114         //- Calculate point normals
00115         void calcPointNormals() const;
00116 
00117         //- Calculate cut edge indices
00118         labelList calcCutEdgeIndices(const primitivePatch& p) const;
00119 
00120         //- Calculate local edges indices given a primitive patch
00121         labelList calcLocalEdgesIndices(const primitivePatch& p) const;
00122 
00123 
00124 public:
00125 
00126     typedef tetPolyBoundaryMeshFaceDecomp BoundaryMesh;
00127 
00128 
00129     //- Runtime type information
00130     TypeName("patch");
00131 
00132     // Declare run-time constructor selection tables
00133 
00134         declareRunTimeSelectionTable
00135         (
00136             autoPtr,
00137             faceTetPolyPatchFaceDecomp,
00138             polyPatch,
00139             (const polyPatch& patch, const tetPolyBoundaryMeshFaceDecomp& bm),
00140             (patch, bm)
00141         );
00142 
00143 
00144     // Constructors
00145 
00146         //- Construct from polyPatch
00147         faceTetPolyPatchFaceDecomp
00148         (
00149             const polyPatch&,
00150             const tetPolyBoundaryMeshFaceDecomp&
00151         );
00152 
00153 
00154     // Selectors
00155 
00156         //- Return a pointer to a new patch created on freestore from polyPatch
00157         static autoPtr<faceTetPolyPatchFaceDecomp> New
00158         (
00159             const polyPatch&,
00160             const tetPolyBoundaryMeshFaceDecomp&
00161         );
00162 
00163 
00164     // Destructor
00165 
00166         virtual ~faceTetPolyPatchFaceDecomp();
00167 
00168 
00169     // Member Functions
00170 
00171         //- Return the polyPatch
00172         const polyPatch& patch() const;
00173 
00174         //- Return name
00175         virtual const word& name() const
00176         {
00177             return patch().name();
00178         }
00179 
00180         //- Return size
00181         virtual label size() const
00182         {
00183             return size_;
00184         }
00185 
00186         //- Return number of faces
00187         virtual label nFaces() const
00188         {
00189             return patch().size();
00190         }
00191 
00192         //- Return the index of this patch in the tetPolyBoundaryMeshFaceDecomp
00193         virtual label index() const
00194         {
00195             return boundaryIndex_;
00196         }
00197 
00198 
00199         // Access functions for demand driven data
00200 
00201             //- Return mesh points
00202             virtual const labelList& meshPoints() const;
00203 
00204             //- Return pointField of points in patch
00205             virtual const pointField& localPoints() const;
00206 
00207             //- Return point unit normals
00208             virtual const vectorField& pointNormals() const;
00209 
00210             //- Face decomposition into triangle
00211             //  Used for implementation of FEM boundary conditions
00212             virtual triFaceList faceTriangles(const label faceID) const;
00213 
00214             //- Return complete list of faces. All are triangles
00215             virtual faceList triFaces() const;
00216 
00217             //- Return list of edge indices for edges local to the patch
00218             //  (i.e. connecting points within the patch)
00219             virtual const labelList& localEdgeIndices() const;
00220 
00221             //- Return list of edge indices for cut edges
00222             //  (i.e. connecting points within the patch ot points outside it)
00223             virtual const labelList& cutEdgeIndices() const;
00224 
00225 
00226         // Update topology
00227         virtual void updateMesh();
00228 };
00229 
00230 
00231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00232 
00233 } // End namespace Foam
00234 
00235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00236 
00237 #endif
00238 
00239 // ************************************************************************* //
For further information go to www.openfoam.org