Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / mesh / cfMesh / utilities / surfaceTools / meshSurfaceEngine / meshSurfaceEngine.C
blob8df41b735a8ad61b6b96de3f5f112748dfa9ddf4
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | cfMesh: A library for mesh generation
4    \\    /   O peration     |
5     \\  /    A nd           | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6      \\/     M anipulation  | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9     This file is part of cfMesh.
11     cfMesh is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 3 of the License, or (at your
14     option) any later version.
16     cfMesh 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 cfMesh.  If not, see <http://www.gnu.org/licenses/>.
24 Description
26 \*---------------------------------------------------------------------------*/
28 #include "meshSurfaceEngine.H"
29 #include "demandDrivenData.H"
31 # ifdef USE_OMP
32 #include <omp.h>
33 # endif
35 // #define DEBUGSearch
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 namespace Foam
42 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
44 meshSurfaceEngine::meshSurfaceEngine(polyMeshGen& mesh)
46     mesh_(mesh),
47     activePatch_(-1),
48     boundaryPointsPtr_(NULL),
49     boundaryFacesPtr_(NULL),
50     boundaryFacePatchPtr_(NULL),
51     boundaryFaceOwnersPtr_(NULL),
52     pointFacesPtr_(NULL),
53     pointInFacePtr_(NULL),
54     pointPatchesPtr_(NULL),
55     bppPtr_(NULL),
56     pointPointsPtr_(NULL),
57     edgesPtr_(NULL),
58     bpEdgesPtr_(NULL),
59     edgeFacesPtr_(NULL),
60     faceEdgesPtr_(NULL),
61     edgePatchesPtr_(NULL),
62     faceFacesPtr_(NULL),
63     pointNormalsPtr_(NULL),
64     faceNormalsPtr_(NULL),
65     faceCentresPtr_(NULL),
67     globalBoundaryPointLabelPtr_(NULL),
68     globalBoundaryPointToLocalPtr_(NULL),
69     bpProcsPtr_(NULL),
70     bpNeiProcsPtr_(NULL),
71     globalBoundaryEdgeLabelPtr_(NULL),
72     globalBoundaryEdgeToLocalPtr_(NULL),
73     beProcsPtr_(NULL),
74     beNeiProcsPtr_(NULL),
75     otherEdgeFaceAtProcPtr_(NULL),
76     otherEdgeFacePatchPtr_(NULL),
77     globalBoundaryFaceLabelPtr_(NULL)
79     calculateBoundaryFaces();
80     calculateBoundaryNodes();
83 meshSurfaceEngine::meshSurfaceEngine(polyMeshGen &mesh, const label patchI)
85     mesh_(mesh),
86     activePatch_(patchI),
87     boundaryPointsPtr_(NULL),
88     boundaryFacesPtr_(NULL),
89     boundaryFacePatchPtr_(NULL),
90     boundaryFaceOwnersPtr_(NULL),
91     pointFacesPtr_(NULL),
92     pointInFacePtr_(NULL),
93     pointPatchesPtr_(NULL),
94     bppPtr_(NULL),
95     pointPointsPtr_(NULL),
96     edgesPtr_(NULL),
97     bpEdgesPtr_(NULL),
98     edgeFacesPtr_(NULL),
99     faceEdgesPtr_(NULL),
100     edgePatchesPtr_(NULL),
101     faceFacesPtr_(NULL),
102     pointNormalsPtr_(NULL),
103     faceNormalsPtr_(NULL),
104     faceCentresPtr_(NULL),
106     globalBoundaryPointLabelPtr_(NULL),
107     globalBoundaryPointToLocalPtr_(NULL),
108     bpProcsPtr_(NULL),
109     bpNeiProcsPtr_(NULL),
110     globalBoundaryEdgeLabelPtr_(NULL),
111     globalBoundaryEdgeToLocalPtr_(NULL),
112     beProcsPtr_(NULL),
113     beNeiProcsPtr_(NULL),
114     otherEdgeFaceAtProcPtr_(NULL),
115     otherEdgeFacePatchPtr_(NULL),
116     globalBoundaryFaceLabelPtr_(NULL)
118     calculateBoundaryFaces();
119     calculateBoundaryNodes();
122 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
124 meshSurfaceEngine::~meshSurfaceEngine()
126     clearOut();
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 void meshSurfaceEngine::clearOut()
133     deleteDemandDrivenData(boundaryPointsPtr_);
134     deleteDemandDrivenData(boundaryFacesPtr_);
135     deleteDemandDrivenData(boundaryFacePatchPtr_);
136     deleteDemandDrivenData(boundaryFaceOwnersPtr_);
137     deleteDemandDrivenData(pointFacesPtr_);
138     deleteDemandDrivenData(pointInFacePtr_);
139     deleteDemandDrivenData(pointPatchesPtr_);
140     deleteDemandDrivenData(bppPtr_);
141     deleteDemandDrivenData(pointPointsPtr_);
142     deleteDemandDrivenData(pointNormalsPtr_);
143     deleteDemandDrivenData(faceNormalsPtr_);
144     deleteDemandDrivenData(faceCentresPtr_);
145     deleteDemandDrivenData(edgesPtr_);
146     deleteDemandDrivenData(bpEdgesPtr_);
147     deleteDemandDrivenData(edgeFacesPtr_);
148     deleteDemandDrivenData(faceEdgesPtr_);
149     deleteDemandDrivenData(edgePatchesPtr_);
150     deleteDemandDrivenData(faceFacesPtr_);
152     deleteDemandDrivenData(globalBoundaryPointLabelPtr_);
153     deleteDemandDrivenData(globalBoundaryPointToLocalPtr_);
154     deleteDemandDrivenData(bpProcsPtr_);
155     deleteDemandDrivenData(bpNeiProcsPtr_);
156     deleteDemandDrivenData(globalBoundaryEdgeLabelPtr_);
157     deleteDemandDrivenData(globalBoundaryEdgeToLocalPtr_);
158     deleteDemandDrivenData(beProcsPtr_);
159     deleteDemandDrivenData(beNeiProcsPtr_);
160     deleteDemandDrivenData(otherEdgeFaceAtProcPtr_);
161     deleteDemandDrivenData(otherEdgeFacePatchPtr_);
162     deleteDemandDrivenData(globalBoundaryFaceLabelPtr_);
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // ************************************************************************* //