Loading...
Searching...
No Matches
fvMotionSolverTemplates.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) 2012-2016 OpenFOAM Foundation
9 Copyright (C) 2024 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
29#include "fvMotionSolver.H"
32#include "facePointPatch.H"
33
34// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
35
36template<class Type>
38(
40 Boundary& pmUbf
41) const
42{
43 wordList cmUbf(fvMesh_.boundary().size());
44
45 forAll(pmUbf, patchi)
46 {
47 const auto& pfld = pmUbf[patchi];
48 const auto* fppPtr = isA<facePointPatch>(pfld.patch());
49 if (fppPtr)
50 {
51 const auto& fpp = *fppPtr;
52 const label polyPatchi = fpp.patch().index();
53
55 {
57 }
58 else
59 {
60 // Take over pointPatch type
61 cmUbf[polyPatchi] = pfld.type();
62 }
63
64 if (debug)
65 {
66 Pout<< "Patch:" << fvMesh_.boundary()[patchi].patch().name()
67 << " pointType:" << pfld.type()
68 << " cellType:" << cmUbf[patchi] << endl;
69 }
70 }
71 }
72
73 return cmUbf;
74}
75
76
77// ************************************************************************* //
static const char *const typeName
Typename for Field.
Definition Field.H:93
Generic GeometricField class.
A FixedValue boundary condition for pointField.
const fvMesh & fvMesh_
The fvMesh to be moved.
wordList cellMotionBoundaryTypes(const typename GeometricField< Type, pointPatchField, pointMesh >::Boundary &pmUbf) const
Create the corresponding patch types for cellMotion from those.
Namespace for handling debugging switches.
Definition debug.C:45
List< word > wordList
List of word.
Definition fileName.H:60
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
Definition typeInfo.H:87
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299