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 -------------------------------------------------------------------------------
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 "fvMotionSolver.H"
32 #include "facePointPatch.H"
33 
34 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
35 
36 template<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  {
56  cmUbf[polyPatchi] = cellMotionFvPatchField<Type>::typeName;
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 // ************************************************************************* //
A FixedValue boundary condition for pointField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:529
const fvMesh & fvMesh_
The fvMesh to be moved.
Foam::cellMotionFvPatchField.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:286
label size() const noexcept
The number of entries in the list.
Definition: UPtrListI.H:106
wordList cellMotionBoundaryTypes(const typename GeometricField< Type, pointPatchField, pointMesh >::Boundary &pmUbf) const
Create the corresponding patch types for cellMotion from those.
int debug
Static debugging option.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
Definition: fvMesh.H:395
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.