subTriSurfaceMesh.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) 2015-2018 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::subTriSurfaceMesh
28 
29 Description
30  On-the-fly subset of triSurfaceMesh (based on selected patches)
31 
32 Note
33 
34  Example usage:
35  \verbatim
36  spheres_solid1
37  {
38  type subTriSurfaceMesh;
39 
40  // Surface to operate on. Avoid duplicate loading
41  surface spheres.stl;
42 
43  // Regions to operate on (regular expressions allowed)
44  patches (solid1);
45  }
46  \endverbatim
47 
48  \heading Dictionary parameters
49  \table
50  Property | Description | Required | Default
51  type | subTriSurfaceMesh | selector |
52  surface | Name of the underlying surface | yes |
53  patches | List of surface region names or regexs | yes |
54  \endtable
55 
56 SourceFiles
57  subTriSurfaceMesh.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef subTriSurfaceMesh_H
62 #define subTriSurfaceMesh_H
63 
64 #include "triSurfaceMesh.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class subTriSurfaceMesh Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class subTriSurfaceMesh
76 :
77  public triSurfaceMesh
78 {
79  // Private member functions
80 
81  //- Extract patch names of triSurface
82  static wordList patchNames(const triSurface& s);
83 
84  //- Select regions by name
85  static labelList selectedRegions
86  (
87  const triSurface& s,
88  const wordRes& regionNameMatcher
89  );
90 
91  //- Subset triSurface based on regions
92  static triSurface subset(const IOobject&, const dictionary&);
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("subTriSurfaceMesh");
99 
100 
101  // Constructors
102 
103  //- Construct from IO and dictionary.
105  (
106  const IOobject& io,
107  const dictionary& dict
108  );
109 
110 
111  //- Destructor
112  virtual ~subTriSurfaceMesh() = default;
113 
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
Definition: gmvOutputSpray.H:25
Foam::subTriSurfaceMesh::~subTriSurfaceMesh
virtual ~subTriSurfaceMesh()=default
Destructor.
Foam::triSurfaceMesh
IOoject and searching on triSurface.
Definition: triSurfaceMesh.H:106
Foam::IOobject::IOobject
IOobject(const IOobject &)=default
Copy construct.
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:62
Foam::triSurface
Triangulated surface description with patch information.
Definition: triSurface.H:76
Foam::subTriSurfaceMesh::subTriSurfaceMesh
subTriSurfaceMesh(const IOobject &io, const dictionary &dict)
Construct from IO and dictionary.
Definition: subTriSurfaceMesh.C:130
Foam::triSurface::triSurface
triSurface()
Default construct.
Definition: triSurface.C:432
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< word >
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
triSurfaceMesh.H
Foam::subTriSurfaceMesh::TypeName
TypeName("subTriSurfaceMesh")
Runtime type information.
Foam::subTriSurfaceMesh
On-the-fly subset of triSurfaceMesh (based on selected patches)
Definition: subTriSurfaceMesh.H:94