genericPointPatchField.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2016-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
31
32// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
33
34template<class Type>
36(
37 const pointPatch& p,
39)
40:
41 parent_bctype(p, iF)
42{
44 << "Trying to construct genericPointPatchField on patch "
45 << this->patch().name()
46 << " of field " << this->internalField().name() << nl
47 << abort(FatalError);
48}
49
50
51template<class Type>
53(
54 const pointPatch& p,
56 const dictionary& dict
57)
58:
59 parent_bctype(p, iF, dict),
61{
62 const label patchSize = this->size();
63 const word& patchName = this->patch().name();
64 const IOobject& io = this->internalField();
65
66 // No separate "value"
67 processGeneric(patchSize, patchName, io, false);
68}
69
70
71template<class Type>
73(
75 const pointPatch& p,
77 const pointPatchFieldMapper& mapper
78)
79:
80 parent_bctype(rhs, p, iF, mapper),
82{
83 this->mapGeneric(rhs, mapper);
84}
85
86
87template<class Type>
89(
92)
93:
94 parent_bctype(rhs, iF),
96{}
97
98
99// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100
101template<class Type>
103{
104 // No separate treatment for "value"
106}
107
108
109template<class Type>
111(
112 const pointPatchFieldMapper& m
113)
114{
115 this->autoMapGeneric(m);
116}
117
118
119template<class Type>
121(
122 const pointPatchField<Type>& rhs,
123 const labelList& addr
124)
125{
126 const auto* base = isA<genericPatchFieldBase>(rhs);
127 if (base)
128 {
129 this->rmapGeneric(*base, addr);
130 }
131}
132
133
134// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A calculated boundary condition for pointField.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
virtual bool write()
Write the output fields.
Generic infrastructure for reading/writing unknown patch types.
void writeGeneric(Ostream &os, const bool separateValue) const
void processGeneric(const label patchSize, const word &patchName, const IOobject &io, const bool separateValue)
void mapGeneric(const genericPatchFieldBase &rhs, const MapperType &mapper)
Implementation for construct with mapper.
A generic version of calculatedPointPatchField, useful as a fallback for handling unknown patch types...
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given pointPatchField onto this pointPatchField.
Foam::pointPatchFieldMapper.
Abstract base class for point-mesh patch fields.
const pointPatch & patch() const
Return patch.
const DimensionedField< Type, pointMesh > & internalField() const
Return dimensioned internal field reference.
label size() const
Return size.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
virtual const word & name() const =0
Return name.
A class for handling words, derived from Foam::string.
Definition: word.H:68
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
volScalarField & p
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
errorManip< error > abort(error &err)
Definition: errorManip.H:144
error FatalError
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
dictionary dict