DelaunayMeshI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
27 
28 template<class Triangulation>
30 {
31  return runTime_;
32 }
33 
34 
35 template<class Triangulation>
37 (
38  const string& description,
39  const bool check
40 ) const
41 {
42  if (check)
43  {
44  Info<< nl << "--- [ cpuTime "
45  << time().elapsedCpuTime() << " s, "
46  << "delta " << time().cpuTimeIncrement()<< " s";
47 
48  if (description != word::null)
49  {
50  Info<< ", " << description << " ";
51  }
52  else
53  {
54  Info<< " ";
55  }
56 
57  Info<< "] --- " << endl;
58  }
59 }
60 
61 
62 template<class Triangulation>
64 {
65  label id = cellCount_++;
66 
67  if (id == labelMax)
68  {
70  << "Cell counter has overflowed." << endl;
71  }
72 
73  return id;
74 }
75 
76 
77 template<class Triangulation>
79 {
80  label id = vertexCount_++;
81 
82  if (id == labelMax)
83  {
85  << "Vertex counter has overflowed." << endl;
86  }
87 
88  return id;
89 }
90 
91 
92 template<class Triangulation>
94 {
95  return cellCount_;
96 }
97 
98 
99 template<class Triangulation>
101 {
102  return vertexCount_;
103 }
104 
105 
106 template<class Triangulation>
108 {
109  cellCount_ = 0;
110 }
111 
112 
113 template<class Triangulation>
115 {
116  vertexCount_ = 0;
117 }
118 
119 
120 // ************************************************************************* //
label cellCount() const
Return the cell count (the next unique cell index)
Definition: DelaunayMeshI.H:93
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
label getNewVertexIndex() const
Create a new unique vertex index and return.
Definition: DelaunayMeshI.H:78
void resetVertexCount()
Set the vertex count to zero.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
void timeCheck(const string &description, const bool check=true) const
Write the cpuTime to screen.
Definition: DelaunayMeshI.H:37
static const label labelMax
Definition: label.H:62
const Time & time() const
Return a reference to the Time object.
Definition: DelaunayMeshI.H:29
static const char nl
Definition: Ostream.H:260
void resetCellCount()
Set the cell count to zero.
label vertexCount() const
Return the vertex count (the next unique vertex index)
#define WarningInFunction
Report a warning using Foam::Warning.
label getNewCellIndex() const
Create a new unique cell index and return.
Definition: DelaunayMeshI.H:63
messageStream Info