triSurfFeatureEdgesI.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 "triSurfFeatureEdges.H"
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
40 {
41  return featureEdges_.size();
42 }
43 
45 {
46  return featureEdges_;
47 }
48 
50 {
52 }
53 
55 (
56  const label setI,
57  const label eI
58 )
59 {
60  Map<meshSubset>::iterator it = featureEdgeSubsets_.find(setI);
61  if( it == featureEdgeSubsets_.end() )
62  return;
63 
64  it().addElement(eI);
65 }
66 
68 (
69  const label setI,
70  const label eI
71 )
72 {
73  Map<meshSubset>::iterator it = featureEdgeSubsets_.find(setI);
74  if( it == featureEdgeSubsets_.end() )
75  return;
76 
77  it().removeElement(eI);
78 }
79 
81 (
82  const label eI,
83  DynList<label>& edgeSubsets
84 ) const
85 {
86  edgeSubsets.clear();
87 
89  (
91  featureEdgeSubsets_,
92  it
93  )
94  {
95  if( it().contains(eI) )
96  edgeSubsets.append(it.key());
97  }
98 }
99 
101 (
102  DynList<label>& indices
103 ) const
104 {
105  indices.clear();
106 
108  (
110  featureEdgeSubsets_,
111  it
112  )
113  indices.append(it.key());
114 }
115 
116 template<class ListType>
118 (
119  const label setI,
120  ListType& edgeLabels
121 ) const
122 {
123  edgeLabels.clear();
124 
125  Map<meshSubset>::const_iterator it = featureEdgeSubsets_.find(setI);
126  if( it == featureEdgeSubsets_.end() )
127  return;
128 
129  it().containedElements(edgeLabels);
130 }
131 
132 template<class ListType>
134 (
135  const ListType& newEdgeLabels
136 )
137 {
138  for
139  (
140  Map<meshSubset>::iterator it=featureEdgeSubsets_.begin();
141  it!=featureEdgeSubsets_.end();
142  ++it
143  )
144  it().updateSubset(newEdgeLabels);
145 }
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::LongList::append
void append(const T &e)
Append an element at the end of the list.
Definition: LongListI.H:265
Foam::HashTable::iterator
An STL-conforming iterator.
Definition: HashTable.H:415
triSurfFeatureEdges.H
Foam::triSurfFeatureEdges::edgesInSubset
void edgesInSubset(const label, ListType &) const
Definition: triSurfFeatureEdgesI.H:118
Foam::HashTable::const_iterator
An STL-conforming const_iterator.
Definition: HashTable.H:470
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:58
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: PrimitivePatchTemplate.H:68
Foam::LongList::size
label size() const
Size of the active part of the list.
Definition: LongListI.H:203
Foam::triSurfFeatureEdges::addEdgeToSubset
void addEdgeToSubset(const label, const label)
Definition: triSurfFeatureEdgesI.H:55
Foam::triSurfFeatureEdges::featureEdges
const edgeLongList & featureEdges() const
access to feature edges
Definition: triSurfFeatureEdgesI.H:44
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
Foam::triSurfFeatureEdges::removeEdgeFromSubset
void removeEdgeFromSubset(const label, const label)
Definition: triSurfFeatureEdgesI.H:68
Foam::LongList< edge >
Foam::triSurfFeatureEdges::nFeatureEdges
label nFeatureEdges() const
return the number of feature edges
Definition: triSurfFeatureEdgesI.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::triSurfFeatureEdges::appendFeatureEdge
void appendFeatureEdge(const edge &e)
append an edge to the end of the list
Definition: triSurfFeatureEdgesI.H:49
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
Foam::DynList< label >
Foam::triSurfFeatureEdges::updateEdgeSubsets
void updateEdgeSubsets(const ListType &)
Definition: triSurfFeatureEdgesI.H:134
Foam::triSurfFeatureEdges::edgeSubsetIndices
void edgeSubsetIndices(DynList< label > &) const
Definition: triSurfFeatureEdgesI.H:101
Foam::triSurfFeatureEdges::edgeInSubsets
void edgeInSubsets(const label, DynList< label > &) const
Definition: triSurfFeatureEdgesI.H:81
Foam::triSurfFeatureEdges::featureEdges_
edgeLongList featureEdges_
list of feature edges
Definition: triSurfFeatureEdges.H:54
Foam::DynList::clear
void clear()
Clear the list, i.e. set next free to zero.
Definition: DynListI.H:279
Foam::DynList::append
void append(const T &e)
Append an element at the end of the list.
Definition: DynListI.H:304