triSurfPointsI.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 "triSurfPoints.H"
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
40 {
41  return points_.size();
42 }
43 
44 inline const pointField& triSurfPoints::points() const
45 {
46  return points_;
47 }
48 
49 inline void triSurfPoints::appendVertex(const point& p)
50 {
51  const label s = points_.size();
52  points_.setSize(s+1);
53  points_[s] = p;
54 }
55 
57 (
58  const label setI,
59  const label pointI
60 )
61 {
62  Map<meshSubset>::iterator it = pointSubsets_.find(setI);
63  if( it == pointSubsets_.end() )
64  return;
65 
66  it().addElement(pointI);
67 }
68 
70 (
71  const label setI,
72  const label pointI
73 )
74 {
75  Map<meshSubset>::iterator it = pointSubsets_.find(setI);
76  if( it == pointSubsets_.end() )
77  return;
78 
79  it().removeElement(pointI);
80 }
81 
83 (
84  const label pointI,
85  DynList<label>& pointSubsets
86 ) const
87 {
88  pointSubsets.clear();
89 
91  (
93  pointSubsets_,
94  it
95  )
96  {
97  if( it().contains(pointI) )
98  pointSubsets.append(it.key());
99  }
100 }
101 
103 {
104  indices.clear();
105 
107  (
110  it
111  )
112  indices.append(it.key());
113 }
114 
115 template<class ListType>
117 (
118  const label setI,
119  ListType& pointLabels
120 ) const
121 {
122  pointLabels.clear();
123 
125  pointSubsets_.find(setI);
126  if( it == pointSubsets_.end() )
127  return;
128 
129  it().containedElements(pointLabels);
130 }
131 
132 template<class ListType>
133 inline void triSurfPoints::updatePointSubsets(const ListType& newNodeLabels)
134 {
135  for
136  (
138  it!=pointSubsets_.end();
139  ++it
140  )
141  it().updateSubset(newNodeLabels);
142 }
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::triSurfPoints::pointsInSubset
void pointsInSubset(const label, ListType &) const
Definition: triSurfPointsI.H:117
p
p
Definition: pEqn.H:62
Foam::HashTable::iterator
An STL-conforming iterator.
Definition: HashTable.H:415
Foam::triSurfPoints::pointInSubsets
void pointInSubsets(const label, DynList< label > &) const
Definition: triSurfPointsI.H:83
Foam::triSurfPoints::points
const pointField & points() const
access to points
Definition: triSurfPointsI.H:44
Foam::triSurfPoints::updatePointSubsets
void updatePointSubsets(const ListType &)
Definition: triSurfPointsI.H:133
Foam::HashTable::const_iterator
An STL-conforming const_iterator.
Definition: HashTable.H:470
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: PrimitivePatchTemplate.H:68
Foam::triSurfPoints::appendVertex
void appendVertex(const point &p)
append a vertex to the end of the list
Definition: triSurfPointsI.H:49
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
Foam::triSurfPoints::nPoints
label nPoints() const
return the number of points
Definition: triSurfPointsI.H:39
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::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::triSurfPoints::addPointToSubset
void addPointToSubset(const label, const label)
Definition: triSurfPointsI.H:57
Foam::triSurfPoints::removePointFromSubset
void removePointFromSubset(const label, const label)
Definition: triSurfPointsI.H:70
triSurfPoints.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::triSurfPoints::pointSubsets_
Map< meshSubset > pointSubsets_
map of point subsets
Definition: triSurfPoints.H:58
s
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Foam::DynList< label >
Foam::triSurfPoints::pointSubsetIndices
void pointSubsetIndices(DynList< label > &) const
Definition: triSurfPointsI.H:102
Foam::Vector< scalar >
Foam::List::clear
void clear()
Clear the list, i.e. set size to zero.
Definition: List.C:379
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::triSurfPoints::points_
pointField points_
list of vertices
Definition: triSurfPoints.H:55
Foam::DynList::append
void append(const T &e)
Append an element at the end of the list.
Definition: DynListI.H:304