Loading...
Searching...
No Matches
faOptionI.H
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) 2019-2025 OpenCFD Ltd.
9------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
29
30inline bool Foam::fa::option::active(bool on) noexcept
32 bool old(active_);
33 active_ = on;
34 return old;
35}
36
38inline void Foam::fa::option::setApplied(const label fieldi)
39{
40 applied_[fieldi] = true;
41}
42
43
45{
46 if (!regionMeshPtr_)
47 {
48 regionMeshPtr_.reset(new faMesh(areaName_, mesh_));
49 }
50 return *regionMeshPtr_;
51}
52
53
55{
56 if (!vsmPtr_)
57 {
58 vsmPtr_.reset(new volSurfaceMapping(this->regionMesh()));
59 }
60 return *vsmPtr_;
61}
62
63
64inline Foam::word
65Foam::fa::option::suffixed(const char* base) const
66{
67 return word(base + suffixHint_);
68}
69
70
71inline Foam::word
72Foam::fa::option::suffixed(const std::string& base) const
73{
74 return word(base + suffixHint_);
75}
76
77
78// ************************************************************************* //
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
word areaName_
The finite-area mesh name.
Definition faOption.H:200
word suffixHint_
Suffix hint for variable names (default: "").
Definition faOption.H:210
List< bool > applied_
Applied flag list - corresponds to each fieldNames_ entry.
Definition faOption.H:195
const fvMesh & mesh_
Reference to the mesh database.
Definition faOption.H:175
void setApplied(const label fieldi)
Set the applied flag to true for field index fieldi.
Definition faOptionI.H:31
word suffixed(const char *base) const
Return the concatenation of base and the suffix hint.
Definition faOptionI.H:58
bool active() const noexcept
True if source is active.
Definition faOption.H:395
const volSurfaceMapping & vsm() const
Return volSurfaceMapping (demand-driven).
Definition faOptionI.H:47
const faMesh & regionMesh() const
Return the region mesh database (demand-driven).
Definition faOptionI.H:37
Volume to surface and surface to volume mapping.
A class for handling words, derived from Foam::string.
Definition word.H:66