edgeMeshI.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) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2018-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
30 
32 {
33  return points_;
34 }
35 
36 
38 {
39  return edges_;
40 }
41 
42 
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 
46 :
47  fileFormats::edgeMeshFormatsCore(),
48  points_(),
49  edges_(),
50  pointEdgesPtr_(nullptr)
51 {}
52 
53 
54 inline Foam::edgeMesh::edgeMesh(const edgeMesh& em)
55 :
56  fileFormats::edgeMeshFormatsCore(),
57  points_(em.points_),
58  edges_(em.edges_),
59  pointEdgesPtr_(nullptr)
60 {}
61 
62 
64 :
66 {
67  transfer(em);
68 }
69 
70 
72 (
73  const pointField& points,
74  const edgeList& edges
75 )
76 :
77  fileFormats::edgeMeshFormatsCore(),
78  points_(points),
79  edges_(edges),
80  pointEdgesPtr_(nullptr)
81 {}
82 
83 
85 (
87  edgeList&& edges
88 )
89 :
90  fileFormats::edgeMeshFormatsCore(),
91  points_(std::move(points)),
92  edges_(std::move(edges)),
93  pointEdgesPtr_(nullptr)
94 {}
95 
96 
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98 
100 {
101  return points_;
102 }
103 
105 inline const Foam::edgeList& Foam::edgeMesh::edges() const noexcept
106 {
107  return edges_;
108 }
109 
110 
112 {
113  if (!pointEdgesPtr_)
114  {
115  calcPointEdges();
116  }
117  return *pointEdgesPtr_;
118 }
119 
120 
121 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
122 
123 inline void Foam::edgeMesh::operator=(const edgeMesh& rhs)
124 {
125  points_ = rhs.points_;
126  edges_ = rhs.edges_;
127  pointEdgesPtr_.reset(nullptr);
128 }
129 
130 
131 inline void Foam::edgeMesh::operator=(edgeMesh&& rhs)
132 {
133  transfer(rhs);
134 }
135 
136 
137 // ************************************************************************* //
const pointField & points() const noexcept
Return points.
Definition: edgeMeshI.H:92
void operator=(const edgeMesh &rhs)
Copy assignment.
Definition: edgeMeshI.H:116
edgeMesh()
Default construct.
Definition: edgeMeshI.H:38
pointField & storedPoints() noexcept
Non-const access to global points.
Definition: edgeMeshI.H:24
const labelListList & pointEdges() const
Return edges.
Definition: edgeMeshI.H:104
const pointField & points
const direction noexcept
Definition: Scalar.H:258
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:47
const edgeList & edges() const noexcept
Return edges.
Definition: edgeMeshI.H:98
edgeList & storedEdges() noexcept
Non-const access to the edges.
Definition: edgeMeshI.H:30