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 
55 :
56  fileFormats::edgeMeshFormatsCore(),
57  points_(em.points_),
58  edges_(em.edges_),
59  pointEdgesPtr_(nullptr)
60 {}
61 
62 
64 :
65  edgeMesh()
66 {
67  transfer(em);
68 }
69 
70 
72 (
73  const pointField& points,
74  const edgeList& edges
75 )
76 :
78  points_(points),
79  edges_(edges),
80  pointEdgesPtr_(nullptr)
81 {}
82 
83 
85 (
87  edgeList&& edges
88 )
89 :
91  points_(std::move(points)),
92  edges_(std::move(edges)),
93  pointEdgesPtr_(nullptr)
94 {}
95 
96 
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98 
99 inline const Foam::pointField& Foam::edgeMesh::points() const noexcept
100 {
101  return points_;
102 }
103 
104 
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 
132 {
133  transfer(rhs);
134 }
135 
136 
137 // ************************************************************************* //
Foam::edgeMesh::points
const pointField & points() const noexcept
Return points.
Definition: edgeMeshI.H:99
Foam::edgeMesh::operator=
void operator=(const edgeMesh &rhs)
Copy assignment.
Definition: edgeMeshI.H:123
Foam::edgeMesh::edgeMesh
edgeMesh()
Default construct.
Definition: edgeMeshI.H:45
Foam::edgeMesh::storedPoints
pointField & storedPoints() noexcept
Non-const access to global points.
Definition: edgeMeshI.H:31
Foam::Field< vector >
Foam::edgeMesh::pointEdges
const labelListList & pointEdges() const
Return edges.
Definition: edgeMeshI.H:111
Foam::edgeMesh::edges
const edgeList & edges() const noexcept
Return edges.
Definition: edgeMeshI.H:105
Foam::List< edge >
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::edgeMesh::storedEdges
edgeList & storedEdges() noexcept
Non-const access to the edges.
Definition: edgeMeshI.H:37
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:53
Foam::fileFormats::edgeMeshFormatsCore
A collection of helper functions for reading/writing edge formats.
Definition: edgeMeshFormatsCore.H:60
Foam::edgeMesh::transfer
void transfer(edgeMesh &mesh)
Transfer the contents of the argument and annul the argument.
Definition: edgeMesh.C:124