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 -------------------------------------------------------------------------------
10 License
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 
30 template<class Triangulation>
32 {
33  return runTime_;
34 }
35 
36 
37 template<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 
64 template<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 
79 template<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 
94 template<class Triangulation>
96 {
97  return cellCount_;
98 }
99 
100 
101 template<class Triangulation>
103 {
104  return vertexCount_;
105 }
106 
107 
108 template<class Triangulation>
110 {
111  cellCount_ = 0;
112 }
113 
114 
115 template<class Triangulation>
117 {
118  vertexCount_ = 0;
119 }
120 
121 
122 // ************************************************************************* //
Foam::DelaunayMesh::timeCheck
void timeCheck(const string &description, const bool check=true) const
Write the cpuTime to screen.
Definition: DelaunayMeshI.H:39
Foam::DelaunayMesh::getNewVertexIndex
label getNewVertexIndex() const
Create a new unique vertex index and return.
Definition: DelaunayMeshI.H:80
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::labelMax
constexpr label labelMax
Definition: label.H:61
Foam::DelaunayMesh::resetVertexCount
void resetVertexCount()
Set the vertex count to zero.
Definition: DelaunayMeshI.H:116
Foam::DelaunayMesh::time
const Time & time() const
Return a reference to the Time object.
Definition: DelaunayMeshI.H:31
Foam::DelaunayMesh::resetCellCount
void resetCellCount()
Set the cell count to zero.
Definition: DelaunayMeshI.H:109
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::DelaunayMesh::vertexCount
label vertexCount() const
Return the vertex count (the next unique vertex index)
Definition: DelaunayMeshI.H:102
Foam::DelaunayMesh::getNewCellIndex
label getNewCellIndex() const
Create a new unique cell index and return.
Definition: DelaunayMeshI.H:65
Foam::check
static void check(const int retVal, const char *what)
Definition: ptscotchDecomp.C:80
Foam::DelaunayMesh::cellCount
label cellCount() const
Return the cell count (the next unique cell index)
Definition: DelaunayMeshI.H:95
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::nl
constexpr char nl
Definition: Ostream.H:404
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:328