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 -------------------------------------------------------------------------------
11 License
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 
30 #include "pointPatchFieldMapper.H"
31 
32 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
33 
34 template<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 
51 template<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 
71 template<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 
87 template<class Type>
89 (
92 )
93 :
94  parent_bctype(rhs, iF),
96 {}
97 
98 
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 
101 template<class Type>
103 {
104  // No separate treatment for "value"
106 }
107 
108 
109 template<class Type>
111 (
112  const pointPatchFieldMapper& m
113 )
114 {
115  this->autoMapGeneric(m);
116 }
117 
118 
119 template<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 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:165
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:63
Foam::genericPatchFieldBase
Generic infrastructure for reading/writing unknown patch types.
Definition: genericPatchFieldBase.H:50
pointPatchFieldMapper.H
Foam::genericPointPatchField::write
virtual void write(Ostream &) const
Definition: genericPointPatchField.C:95
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:54
Foam::genericPointPatchField::autoMap
virtual void autoMap(const pointPatchFieldMapper &)
Definition: genericPointPatchField.C:104
Foam::genericPatchFieldBase::writeGeneric
void writeGeneric(Ostream &os, const bool separateValue) const
Definition: genericPatchFieldBase.C:459
Foam::pointPatchField< Type >
Foam::pointPatchField< Type >::patch
const pointPatch & patch() const
Definition: pointPatchField.H:264
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:42
Foam::genericPointPatchField::genericPointPatchField
genericPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Definition: genericPointPatchField.C:29
Foam::pointPatchField< Type >::internalField
const DimensionedField< Type, pointMesh > & internalField() const
Definition: pointPatchField.H:271
Foam::calculatedPointPatchField
A calculated boundary condition for pointField.
Definition: calculatedPointPatchField.H:47
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
genericPointPatchField.H
Foam::pointPatchField< Type >::size
label size() const
Definition: pointPatchField.H:258
Foam::genericPointPatchField::rmap
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Definition: genericPointPatchField.C:114
os
OBJstream os(runTime.globalPath()/outputName)
Foam::genericPointPatchField
A generic version of calculatedPointPatchField, useful as a fallback for handling unknown patch types...
Definition: genericPointPatchField.H:50
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:139
Foam::pointPatch::name
virtual const word & name() const =0
Foam::genericPatchFieldBase::processGeneric
void processGeneric(const label patchSize, const word &patchName, const IOobject &io, const bool separateValue)
Definition: genericPatchFieldBase.C:113
FatalErrorInFunction
#define FatalErrorInFunction
Definition: error.H:465
Foam::nl
constexpr char nl
Definition: Ostream.H:424
Foam::foamVersion::patch
const std::string patch
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:58
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:52
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:50
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:58