OpenFOAM: API Guide
v2112
The open source CFD toolbox
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>
35
Foam::genericPointPatchField<Type>::genericPointPatchField
36
(
37
const
pointPatch
&
p
,
38
const
DimensionedField<Type, pointMesh>
& iF
39
)
40
:
41
parent_bctype
(
p
, iF)
42
{
43
FatalErrorInFunction
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>
52
Foam::genericPointPatchField<Type>::genericPointPatchField
53
(
54
const
pointPatch
&
p
,
55
const
DimensionedField<Type, pointMesh>
& iF,
56
const
dictionary
&
dict
57
)
58
:
59
parent_bctype
(
p
, iF,
dict
),
60
genericPatchFieldBase
(
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>
72
Foam::genericPointPatchField<Type>::genericPointPatchField
73
(
74
const
genericPointPatchField<Type>
& rhs,
75
const
pointPatch
&
p
,
76
const
DimensionedField<Type, pointMesh>
& iF,
77
const
pointPatchFieldMapper
& mapper
78
)
79
:
80
parent_bctype
(rhs,
p
, iF, mapper),
81
genericPatchFieldBase
(
zero
{}, rhs)
82
{
83
this->
mapGeneric
(rhs, mapper);
84
}
85
86
87
template
<
class
Type>
88
Foam::genericPointPatchField<Type>::genericPointPatchField
89
(
90
const
genericPointPatchField<Type>
& rhs,
91
const
DimensionedField<Type, pointMesh>
& iF
92
)
93
:
94
parent_bctype
(rhs, iF),
95
genericPatchFieldBase
(rhs)
96
{}
97
98
99
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100
101
template
<
class
Type>
102
void
Foam::genericPointPatchField<Type>::write
(
Ostream
&
os
)
const
103
{
104
// No separate treatment for "value"
105
genericPatchFieldBase::writeGeneric
(
os
,
false
);
106
}
107
108
109
template
<
class
Type>
110
void
Foam::genericPointPatchField<Type>::autoMap
111
(
112
const
pointPatchFieldMapper
& m
113
)
114
{
115
this->autoMapGeneric(m);
116
}
117
118
119
template
<
class
Type>
120
void
Foam::genericPointPatchField<Type>::rmap
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::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition:
DimensionedField.H:80
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition:
IOobject.H:170
Foam::IOobject::name
const word & name() const noexcept
Return the object name.
Definition:
IOobjectI.H:65
Foam::List< label >
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition:
Ostream.H:62
Foam::calculatedPointPatchField
A calculated boundary condition for pointField.
Definition:
calculatedPointPatchField.H:54
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition:
dictionary.H:126
Foam::functionObjects::ObukhovLength::write
virtual bool write()
Write the output fields.
Definition:
ObukhovLength.C:222
Foam::genericPatchFieldBase
Generic infrastructure for reading/writing unknown patch types.
Definition:
genericPatchFieldBase.H:55
Foam::genericPatchFieldBase::writeGeneric
void writeGeneric(Ostream &os, const bool separateValue) const
Definition:
genericPatchFieldBase.C:466
Foam::genericPatchFieldBase::processGeneric
void processGeneric(const label patchSize, const word &patchName, const IOobject &io, const bool separateValue)
Definition:
genericPatchFieldBase.C:120
Foam::genericPatchFieldBase::mapGeneric
void mapGeneric(const genericPatchFieldBase &rhs, const MapperType &mapper)
Implementation for construct with mapper.
Definition:
genericPatchFieldBaseTemplates.C:34
Foam::genericPointPatchField
A generic version of calculatedPointPatchField, useful as a fallback for handling unknown patch types...
Definition:
genericPointPatchField.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::genericPointPatchField::rmap
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given pointPatchField onto this pointPatchField.
Definition:
genericPointPatchField.C:121
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition:
pointPatchFieldMapper.H:50
Foam::pointPatchField
Abstract base class for point-mesh patch fields.
Definition:
pointPatchField.H:76
Foam::pointPatchField::patch
const pointPatch & patch() const
Return patch.
Definition:
pointPatchField.H:276
Foam::pointPatchField::internalField
const DimensionedField< Type, pointMesh > & internalField() const
Return dimensioned internal field reference.
Definition:
pointPatchField.H:283
Foam::pointPatchField::size
label size() const
Return size.
Definition:
pointPatchField.H:270
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition:
pointPatch.H:64
Foam::pointPatch::name
virtual const word & name() const =0
Return name.
Foam::word
A class for handling words, derived from Foam::string.
Definition:
word.H:68
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition:
zero.H:63
p
volScalarField & p
Definition:
createFieldRefs.H:8
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition:
error.H:453
os
OBJstream os(runTime.globalPath()/outputName)
genericPointPatchField.H
io
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Foam::abort
errorManip< error > abort(error &err)
Definition:
errorManip.H:144
Foam::FatalError
error FatalError
Foam::nl
constexpr char nl
The newline '\n' character (0x0a)
Definition:
Ostream.H:53
pointPatchFieldMapper.H
dict
dictionary dict
Definition:
searchingEngine.H:14
src
genericPatchFields
genericPointPatchField
genericPointPatchField.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.