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 
29 #include "genericPointPatchField.H"
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"
105  genericPatchFieldBase::writeGeneric(os, false);
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:169
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::genericPatchFieldBase
Generic infrastructure for reading/writing unknown patch types.
Definition: genericPatchFieldBase.H:54
pointPatchFieldMapper.H
Foam::genericPointPatchField::write
virtual void write(Ostream &) const
Write.
Definition: genericPointPatchField.C:102
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::genericPointPatchField::autoMap
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: genericPointPatchField.C:111
Foam::pointPatchField
Abstract base class for point-mesh patch fields.
Definition: pointMVCWeight.H:60
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
Foam::genericPointPatchField::genericPointPatchField
genericPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Definition: genericPointPatchField.C:36
Foam::calculatedPointPatchField
A calculated boundary condition for pointField.
Definition: calculatedPointPatchField.H:51
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:123
genericPointPatchField.H
Foam::genericPointPatchField::rmap
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given pointPatchField onto this pointPatchField.
Definition: genericPointPatchField.C:121
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:54
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::List< label >
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:62