triSurfFacets.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 Class
25  triSurfFacets
26 
27 Description
28  Facets for the triangulated surface
29 
30 SourceFiles
31  triSurfFacets.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef triSurfFacets_H
36 #define triSurfFacets_H
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 #include "triSurfAddressing.H"
41 #include "meshSubset.H"
42 #include "geometricSurfacePatchList.H"
43 #include "LongList.H"
44 #include "labelledTri.H"
45 #include "DynList.H"
46 #include "Map.H"
47 
48 namespace Foam
49 {
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 class triSurfFacets
54 {
55 protected:
56 
57  // Protected data
58  //- list of triangles
60 
61  //- list of boundary patches and their properties
63 
64  //- map of point subsets
66 
67  // Disallow bitwise assignment
68  void operator=(const triSurfFacets&);
69 
71 
72 public:
73 
74  // Constructors
75  //- Null constructor
76  triSurfFacets();
77 
78  //- Construct from components without the boundary
79  triSurfFacets(const LongList<labelledTri>& triangles);
80 
81  //- Construct from components
83  (
84  const LongList<labelledTri>& triangles,
86  );
87 
88  // Destructor
90 
91  // Member functions
92  //- return the number of triangles
93  inline label size() const;
94 
95  //- access to facets
96  inline const LongList<labelledTri>& facets() const;
97 
98  //- access to patches
99  inline const geometricSurfacePatchList& patches() const;
100 
101  //- return list of patches in the boundary
102  wordList patchNames() const;
103 
104  //- return a list of patch indices corresponding to the given
105  // name, expanding regular expressions
106  labelList findPatches(const word& patchName) const;
107 
108  //- append a triangle to the end of the list
109  inline void appendTriangle(const labelledTri& tria);
110 
111  //- point subsets
112  label addFacetSubset(const word&);
113  void removeFacetSubset(const label);
114  word facetSubsetName(const label) const;
115  label facetSubsetIndex(const word&) const;
116  inline void addFacetToSubset(const label, const label);
117  inline void removeFacetFromSubset(const label, const label);
118  inline void facetInSubsets(const label, DynList<label>&) const;
119  inline void facetSubsetIndices(DynList<label>&) const;
120  template<class ListType>
121  inline void facetsInSubset(const label, ListType&) const;
122  template<class ListType>
123  inline void updateFacetsSubsets(const ListType&);
124 
125  // Operators
126 
127  //- access to a triangle
128  inline const labelledTri& operator[](const label) const;
129 };
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #include "triSurfFacetsI.H"
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
meshSubset.H
Foam::triSurfFacets
Definition: triSurfFacets.H:52
LongList.H
triSurfFacetsI.H
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::triSurfFacets::triangles_
LongList< labelledTri > triangles_
list of triangles
Definition: triSurfFacets.H:58
Foam::triSurfFacets::patches_
geometricSurfacePatchList patches_
list of boundary patches and their properties
Definition: triSurfFacets.H:61
Foam::triSurfFacets::appendTriangle
void appendTriangle(const labelledTri &tria)
append a triangle to the end of the list
Definition: triSurfFacetsI.H:54
Foam::triSurfFacets::patchNames
wordList patchNames() const
return list of patches in the boundary
Definition: triSurfFacets.C:76
Foam::triSurfFacets::operator=
void operator=(const triSurfFacets &)
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: PrimitivePatchTemplate.H:68
Foam::triSurfFacets::triSurfFacets
triSurfFacets()
Null constructor.
Definition: triSurfFacets.C:39
Foam::LongList
Definition: LongList.H:55
Foam::triSurfFacets::removeFacetSubset
void removeFacetSubset(const label)
Definition: triSurfFacets.C:127
Map.H
Foam::triSurfFacets::addFacetToSubset
void addFacetToSubset(const label, const label)
Definition: triSurfFacetsI.H:60
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::triSurfFacets::removeFacetFromSubset
void removeFacetFromSubset(const label, const label)
Definition: triSurfFacetsI.H:73
triSurfAddressing.H
Foam::triSurfFacets::patches
const geometricSurfacePatchList & patches() const
access to patches
Definition: triSurfFacetsI.H:49
Foam::triSurfFacets::findPatches
labelList findPatches(const word &patchName) const
return a list of patch indices corresponding to the given
Definition: triSurfFacets.C:88
Foam::triSurfFacets::addFacetSubset
label addFacetSubset(const word &)
point subsets
Definition: triSurfFacets.C:105
Foam::triSurfFacets::~triSurfFacets
~triSurfFacets()
Definition: triSurfFacets.C:71
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::DynList< label >
Foam::triSurfFacets::operator[]
const labelledTri & operator[](const label) const
access to a triangle
Definition: triSurfFacetsI.H:146
Foam::triSurfFacets::facetSubsetIndices
void facetSubsetIndices(DynList< label > &) const
Definition: triSurfFacetsI.H:105
Foam::triSurfFacets::size
label size() const
return the number of triangles
Definition: triSurfFacetsI.H:39
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::triSurfFacets::facetSubsets_
Map< meshSubset > facetSubsets_
map of point subsets
Definition: triSurfFacets.H:64
Foam::labelledTri
Triangle with additional region number.
Definition: labelledTri.H:49
Foam::triSurfFacets::updateFacetsSubsets
void updateFacetsSubsets(const ListType &)
Definition: triSurfFacetsI.H:135
Foam::triSurfFacets::facets
const LongList< labelledTri > & facets() const
access to facets
Definition: triSurfFacetsI.H:44
Foam::triSurfFacets::facetInSubsets
void facetInSubsets(const label, DynList< label > &) const
Definition: triSurfFacetsI.H:86
Foam::triSurfFacets::facetSubsetName
word facetSubsetName(const label) const
Definition: triSurfFacets.C:135
Foam::triSurfFacets::facetSubsetIndex
label facetSubsetIndex(const word &) const
Definition: triSurfFacets.C:147
Foam::triSurfFacets::facetsInSubset
void facetsInSubset(const label, ListType &) const
Definition: triSurfFacetsI.H:120
labelledTri.H
DynList.H