Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
OpenFOAM
meshes
polyMesh
polyMeshClear.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) 1991-2010 OpenCFD Ltd.
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
\*---------------------------------------------------------------------------*/
25
26
#include "
polyMesh.H
"
27
#include <
OpenFOAM/primitiveMesh.H
>
28
#include <
OpenFOAM/globalMeshData.H
>
29
#include <
OpenFOAM/demandDrivenData.H
>
30
#include <
OpenFOAM/pointMesh.H
>
31
#include <
OpenFOAM/Time.H
>
32
33
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
34
35
void
Foam::polyMesh::removeBoundary
()
36
{
37
if
(debug)
38
{
39
Info
<<
"void polyMesh::removeBoundary(): "
40
<<
"Removing boundary patches."
41
<<
endl
;
42
}
43
44
// Remove the point zones
45
boundary_.
clear
();
46
boundary_.
setSize
(0);
47
48
clearOut
();
49
}
50
51
52
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
53
54
void
Foam::polyMesh::clearGeom
()
55
{
56
if
(debug)
57
{
58
Info
<<
"void polyMesh::clearGeom() : "
59
<<
"clearing geometric data"
60
<<
endl
;
61
}
62
63
primitiveMesh::clearGeom
();
64
65
forAll
(boundary_, patchI)
66
{
67
boundary_[patchI].clearGeom();
68
}
69
70
// Reset valid directions (could change with rotation)
71
geometricD_ =
Vector<label>::zero
;
72
solutionD_ =
Vector<label>::zero
;
73
74
pointMesh::Delete
(*
this
);
75
}
76
77
78
void
Foam::polyMesh::clearAddressing
()
79
{
80
if
(debug)
81
{
82
Info
<<
"void polyMesh::clearAddressing() : "
83
<<
"clearing topology"
84
<<
endl
;
85
}
86
87
primitiveMesh::clearAddressing
();
88
89
// parallelData depends on the processorPatch ordering so force
90
// recalculation
91
deleteDemandDrivenData
(globalMeshDataPtr_);
92
93
// Reset valid directions
94
geometricD_ =
Vector<label>::zero
;
95
solutionD_ =
Vector<label>::zero
;
96
97
pointMesh::Delete
(*
this
);
98
}
99
100
101
void
Foam::polyMesh::clearPrimitives
()
102
{
103
resetMotion();
104
105
points_.setSize(0);
106
faces_.setSize(0);
107
owner_.setSize(0);
108
neighbour_.setSize(0);
109
110
clearedPrimitives_ =
true
;
111
}
112
113
114
void
Foam::polyMesh::clearOut
()
115
{
116
clearGeom();
117
clearAddressing();
118
}
119
120
121
// ************************ vim: set sw=4 sts=4 et: ************************ //