polyMeshGenPointsI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25 
26 
27 \*---------------------------------------------------------------------------*/
28 
29 
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 #include "polyMeshGenPoints.H"
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 inline const Time& polyMeshGenPoints::returnTime() const
40 {
41  return runTime_;
42 }
43 
45 {
46  return points_;
47 }
48 
50 {
51  return points_;
52 }
53 
55 {
56  points_.append(p);
57 }
58 
60 (
61  const label setI,
62  const label pointI
63 )
64 {
65  std::map<label, meshSubset>::iterator it = pointSubsets_.find(setI);
66  if( it == pointSubsets_.end() )
67  return;
68 
69  it->second.addElement(pointI);
70 }
71 
73 (
74  const label setI,
75  const label pointI
76 )
77 {
78  std::map<label, meshSubset>::iterator it = pointSubsets_.find(setI);
79  if( it == pointSubsets_.end() )
80  return;
81 
82  it->second.removeElement(pointI);
83 }
84 
86 (
87  const label pointI,
88  DynList<label>& pointSubsets
89 ) const
90 {
91  pointSubsets.clear();
92 
93  std::map<label, meshSubset>::const_iterator it;
94  for
95  (
96  it=pointSubsets_.begin();
97  it!=pointSubsets_.end();
98  ++it
99  )
100  {
101  if( it->second.contains(pointI) )
102  pointSubsets.append(it->first);
103  }
104 }
105 
107 {
108  indices.clear();
109 
110  std::map<label, meshSubset>::const_iterator it;
111  for
112  (
113  it=pointSubsets_.begin();
114  it!=pointSubsets_.end();
115  ++it
116  )
117  indices.append(it->first);
118 }
119 
120 template<class ListType>
122 (
123  const label setI,
124  ListType& pointLabels
125 ) const
126 {
127  pointLabels.clear();
128 
129  std::map<label, meshSubset>::const_iterator it =
130  pointSubsets_.find(setI);
131  if( it == pointSubsets_.end() )
132  return;
133 
134  it->second.containedElements(pointLabels);
135 }
136 
137 template<class ListType>
138 inline void polyMeshGenPoints::updatePointSubsets(const ListType& newNodeLabels)
139 {
140  for
141  (
142  std::map<label, meshSubset>::iterator it=pointSubsets_.begin();
143  it!=pointSubsets_.end();
144  ++it
145  )
146  it->second.updateSubset(newNodeLabels);
147 }
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
p
p
Definition: pEqn.H:62
Foam::polyMeshGenPoints::points
const pointFieldPMG & points() const
access to points
Definition: polyMeshGenPointsI.H:44
Foam::label
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
Foam::polyMeshGenPoints::pointSubsetIndices
void pointSubsetIndices(DynList< label > &) const
Definition: polyMeshGenPointsI.H:106
Foam::polyMeshGenPoints::removePointFromSubset
void removePointFromSubset(const label, const label)
Definition: polyMeshGenPointsI.H:73
Foam::polyMeshGenPoints::pointSubsets_
std::map< label, meshSubset > pointSubsets_
map of point subsets
Definition: polyMeshGenPoints.H:67
Foam::polyMeshGenPoints::updatePointSubsets
void updatePointSubsets(const ListType &)
Definition: polyMeshGenPointsI.H:138
Foam::polyMeshGenPoints::addPointToSubset
void addPointToSubset(const label, const label)
Definition: polyMeshGenPointsI.H:60
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pointFieldPMG::append
void append(const point &)
add a point at the end of the list
Definition: pointFieldPMGI.H:98
Foam::polyMeshGenPoints::returnTime
const Time & returnTime() const
access to Time
Definition: polyMeshGenPointsI.H:39
Foam::DynList< label >
Foam::polyMeshGenPoints::pointsInSubset
void pointsInSubset(const label, ListType &) const
Definition: polyMeshGenPointsI.H:122
Foam::polyMeshGenPoints::pointInSubsets
void pointInSubsets(const label, DynList< label > &) const
Definition: polyMeshGenPointsI.H:86
Foam::Vector< scalar >
Foam::List::clear
void clear()
Clear the list, i.e. set size to zero.
Definition: List.C:379
Foam::polyMeshGenPoints::runTime_
const Time & runTime_
reference to the Time registry
Definition: polyMeshGenPoints.H:61
Foam::polyMeshGenPoints::points_
pointFieldPMG points_
list of vertices
Definition: polyMeshGenPoints.H:64
polyMeshGenPoints.H
Foam::pointFieldPMG
Definition: pointFieldPMG.H:50
pointLabels
labelList pointLabels(nPoints, -1)
Foam::DynList::clear
void clear()
Clear the list, i.e. set next free to zero.
Definition: DynListI.H:279
Foam::polyMeshGenPoints::appendVertex
void appendVertex(const point &p)
append a vertex to the end of the list
Definition: polyMeshGenPointsI.H:54
Foam::DynList::append
void append(const T &e)
Append an element at the end of the list.
Definition: DynListI.H:304