blockFace.C
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) 2016 OpenFOAM Foundation
9 Copyright (C) 2019-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "blockFace.H"
30#include "blockMeshTools.H"
31#include "blockVertex.H"
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
39}
40
41
42// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43
45:
46 vertices_(vertices)
47{}
48
49
51(
52 const dictionary& dict,
53 const label index,
54 Istream& is
55)
56:
57 vertices_
58 (
59 blockMeshTools::read<label>
60 (
61 is,
62 dict.subOrEmptyDict("namedVertices")
63 )
64 )
65{}
66
67
69{
71 return nullptr;
72}
73
74
76(
77 const dictionary& dict,
78 const label index,
79 const searchableSurfaces& geometry,
80 Istream& is
81)
82{
83 DebugInFunction << "Constructing blockFace" << endl;
84
85 const word faceType(is);
86
87 auto* ctorPtr = IstreamConstructorTable(faceType);
88
89 if (!ctorPtr)
90 {
92 (
93 dict,
94 "blockFace",
95 faceType,
96 *IstreamConstructorTablePtr_
97 ) << abort(FatalIOError);
98 }
99
100 return autoPtr<blockFace>(ctorPtr(dict, index, geometry, is));
101}
102
103
104// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105
107{
108 // Write size and start delimiter
109 os << vertices_.size() << token::BEGIN_LIST;
110
111 // Write contents
112 forAll(vertices_, i)
113 {
114 if (i) os << token::SPACE;
115 blockVertex::write(os, vertices_[i], d);
116 }
117
118 // Write end delimiter
120}
121
122
123// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
124
126{
127 os << p.vertices_ << endl;
128
129 return os;
130}
131
132
133// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Define a curved face.
Definition: blockFace.H:58
virtual autoPtr< blockFace > clone() const
Clone function.
Definition: blockFace.C:68
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
virtual bool write()
Write the output fields.
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
@ BEGIN_LIST
Begin list [isseparator].
Definition: token.H:155
@ END_LIST
End list [isseparator].
Definition: token.H:156
@ SPACE
Space [isspace].
Definition: token.H:125
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
volScalarField & p
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:478
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
OBJstream os(runTime.globalPath()/outputName)
#define DebugInFunction
Report an information message using Foam::Info.
Namespace for OpenFOAM.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
pointField vertices(const blockVertexList &bvl)
errorManip< error > abort(error &err)
Definition: errorManip.H:144
IOerror FatalIOError
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333