LagrangianPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2025-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::LagrangianPatch
26 
27 Description
28  Base class for Lagrangian patches
29 
30 SourceFiles
31  LagrangianPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef LagrangianPatch_H
36 #define LagrangianPatch_H
37 
38 #include "polyPatch.H"
39 #include "LagrangianSubMesh.H"
40 #include "LagrangianFieldsFwd.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class LagrangianBoundaryMesh;
48 class objectRegistry;
49 
50 /*---------------------------------------------------------------------------*\
51  Class LagrangianPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class LagrangianPatch
55 {
56  // Private Data
57 
58  //- Reference to the corresponding polyPatch
59  const polyPatch& poly_;
60 
61  //- Reference to boundary mesh
62  const LagrangianBoundaryMesh& boundaryMesh_;
63 
64  //- The sub-mesh for this patch
65  mutable autoPtr<LagrangianSubMesh> meshPtr_;
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName(polyPatch::typeName_());
72 
73 
74  //- Declare run-time constructor selection tables
75 
77  (
78  autoPtr,
80  polyPatch,
81  (
82  const polyPatch& poly,
84  ),
86  );
87 
88 
89  // Constructors
90 
91  //- Construct from a patch and a boundary mesh
93 
94  //- Disallow default bitwise copy construction
95  LagrangianPatch(const LagrangianPatch&) = delete;
96 
97 
98  // Selectors
99 
100  //- Return a pointer to a new LagrangianPatch of specified type
101  // corresponding to the given polyPatch
103  (
104  const word& type,
105  const polyPatch& poly,
107  );
108 
109  //- Return a pointer to a new LagrangianPatch corresponding to the
110  // given polyPatch
112  (
113  const polyPatch& poly,
115  );
116 
117 
118  //- Destructor
119  virtual ~LagrangianPatch();
120 
121 
122  // Member Functions
123 
124  //- Return the polyPatch
125  const polyPatch& poly() const
126  {
127  return poly_;
128  }
129 
130  //- Return name
131  virtual const word& name() const
132  {
133  return poly_.name();
134  }
135 
136  //- Return whether or not this patch is coupled
137  virtual bool coupled() const
138  {
139  return poly_.coupled();
140  }
141 
142  //- Return the boundary mesh
143  const LagrangianBoundaryMesh& boundaryMesh() const
144  {
145  return boundaryMesh_;
146  }
147 
148  //- Return the sub-mesh associated with this patch
149  virtual const LagrangianSubMesh& mesh() const;
150 
151  //- Return the local object registry
152  const objectRegistry& db() const;
153 
154  //- Return time
155  const Time& time() const;
156 
157  //- Lookup and return the patchField of the named field from the
158  // local objectRegistry.
159  template<class GeometricField, class Type>
161  (
162  const word& name
163  );
164 
165  //- Initialise evaluation of changes in elements that have tracked to
166  // this patch
167  virtual void initEvaluate
168  (
172  ) const;
173 
174  //- Evaluate changes in elements that have tracked to this patch
175  virtual void evaluate
176  (
180  ) const;
181 
182  //- Update for mesh changes
183  virtual void partition() const;
184 
185 
186  // Member Operators
187 
188  //- Disallow default bitwise assignment
189  void operator=(const LagrangianPatch&) = delete;
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
GeoMesh::template PatchField< Type > Patch
Type of the patch field of which the Boundary is composed.
Boundary part of a Lagrangian mesh. Just a list of Lagrangian patches with some added convenience fun...
Class containing Lagrangian geometry and topology.
Base class for Lagrangian patches.
const polyPatch & poly() const
Return the polyPatch.
virtual void evaluate(PstreamBuffers &, LagrangianMesh &, const LagrangianInternalScalarDynamicField &fraction) const
Evaluate changes in elements that have tracked to this patch.
const Time & time() const
Return time.
declareRunTimeSelectionTable(autoPtr, LagrangianPatch, polyPatch,(const polyPatch &poly, const LagrangianBoundaryMesh &boundaryMesh),(poly, boundaryMesh))
Declare run-time constructor selection tables.
virtual bool coupled() const
Return whether or not this patch is coupled.
const objectRegistry & db() const
Return the local object registry.
static autoPtr< LagrangianPatch > New(const word &type, const polyPatch &poly, const LagrangianBoundaryMesh &boundaryMesh)
Return a pointer to a new LagrangianPatch of specified type.
virtual const word & name() const
Return name.
virtual ~LagrangianPatch()
Destructor.
virtual void partition() const
Update for mesh changes.
void operator=(const LagrangianPatch &)=delete
Disallow default bitwise assignment.
const LagrangianBoundaryMesh & boundaryMesh() const
Return the boundary mesh.
virtual void initEvaluate(PstreamBuffers &, LagrangianMesh &mesh, const LagrangianInternalScalarDynamicField &fraction) const
Initialise evaluation of changes in elements that have tracked to.
LagrangianPatch(const polyPatch &, const LagrangianBoundaryMesh &)
Construct from a patch and a boundary mesh.
virtual const LagrangianSubMesh & mesh() const
Return the sub-mesh associated with this patch.
TypeName(polyPatch::typeName_())
Runtime type information.
const GeometricField::Patch & lookupPatchField(const word &name)
Lookup and return the patchField of the named field from the.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Registry of regIOobjects.
const word & name() const
Return name.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:71
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
Definition: polyPatch.H:296
A class for handling words, derived from string.
Definition: word.H:63
const unitSet fraction
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488