DelaunayMeshI.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2012-2015 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29
30template<class Triangulation>
32{
33 return runTime_;
34}
35
36
37template<class Triangulation>
39(
40 const string& description,
41 const bool check
42) const
43{
44 if (check)
45 {
46 Info<< nl << "--- [ cpuTime "
47 << time().elapsedCpuTime() << " s, "
48 << "delta " << time().cpuTimeIncrement()<< " s";
49
50 if (description != word::null)
51 {
52 Info<< ", " << description << " ";
53 }
54 else
55 {
56 Info<< " ";
57 }
58
59 Info<< "] --- " << endl;
60 }
61}
62
63
64template<class Triangulation>
66{
67 label id = cellCount_++;
68
69 if (id == labelMax)
70 {
72 << "Cell counter has overflowed." << endl;
73 }
74
75 return id;
76}
77
78
79template<class Triangulation>
81{
82 label id = vertexCount_++;
83
84 if (id == labelMax)
85 {
87 << "Vertex counter has overflowed." << endl;
88 }
89
90 return id;
91}
92
93
94template<class Triangulation>
96{
97 return cellCount_;
98}
99
100
101template<class Triangulation>
103{
104 return vertexCount_;
105}
106
107
108template<class Triangulation>
110{
111 cellCount_ = 0;
112}
113
114
115template<class Triangulation>
117{
118 vertexCount_ = 0;
119}
120
121
122// ************************************************************************* //
void resetVertexCount()
Set the vertex count to zero.
const Time & time() const
Return a reference to the Time object.
Definition: DelaunayMeshI.H:31
label vertexCount() const
Return the vertex count (the next unique vertex index)
label getNewCellIndex() const
Create a new unique cell index and return.
Definition: DelaunayMeshI.H:65
label getNewVertexIndex() const
Create a new unique vertex index and return.
Definition: DelaunayMeshI.H:80
label cellCount() const
Return the cell count (the next unique cell index)
Definition: DelaunayMeshI.H:95
void resetCellCount()
Set the cell count to zero.
void timeCheck(const string &description, const bool check=true) const
Write the cpuTime to screen.
Definition: DelaunayMeshI.H:39
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
#define WarningInFunction
Report a warning using Foam::Warning.
messageStream Info
Information stream (stdout output on master, null elsewhere)
constexpr label labelMax
Definition: label.H:61
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53