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 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& patch_;
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& patch,
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& patch,
107  );
108 
109  //- Return a pointer to a new LagrangianPatch corresponding to the
110  // given polyPatch
112  (
113  const polyPatch& patch,
115  );
116 
117 
118  //- Destructor
119  virtual ~LagrangianPatch();
120 
121 
122  // Member Functions
123 
124  //- Return the patch
125  const polyPatch& patch() const
126  {
127  return patch_;
128  }
129 
130  //- Return name
131  virtual const word& name() const
132  {
133  return patch_.name();
134  }
135 
136  //- Return whether or not this patch is coupled
137  virtual bool coupled() const
138  {
139  return patch().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  //- Lookup and return the patchField of the named field from the
155  // local objectRegistry.
156  template<class GeometricField, class Type>
158  (
159  const word& name
160  );
161 
162  //- Initialise evaluation of changes in elements that have tracked to
163  // this patch
164  virtual void initEvaluate
165  (
169  ) const;
170 
171  //- Evaluate changes in elements that have tracked to this patch
172  virtual void evaluate
173  (
177  ) const;
178 
179  //- Update for mesh changes
180  virtual void partition() const;
181 
182 
183  // Member Operators
184 
185  //- Disallow default bitwise assignment
186  void operator=(const LagrangianPatch&) = delete;
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
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.
virtual bool coupled() const
Return whether or not this patch is coupled.
virtual void initEvaluate(PstreamBuffers &, LagrangianMesh &mesh, const LagrangianScalarInternalDynamicField &fraction) const
Initialise evaluation of changes in elements that have tracked to.
const objectRegistry & db() const
Return the local object registry.
const polyPatch & patch() const
Return the patch.
virtual const word & name() const
Return name.
static autoPtr< LagrangianPatch > New(const word &type, const polyPatch &patch, const LagrangianBoundaryMesh &boundaryMesh)
Return a pointer to a new LagrangianPatch of specified type.
virtual ~LagrangianPatch()
Destructor.
declareRunTimeSelectionTable(autoPtr, LagrangianPatch, polyPatch,(const polyPatch &patch, const LagrangianBoundaryMesh &boundaryMesh),(patch, boundaryMesh))
Declare run-time constructor selection tables.
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 evaluate(PstreamBuffers &, LagrangianMesh &, const LagrangianScalarInternalDynamicField &fraction) const
Evaluate changes in elements that have tracked to this patch.
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).
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:70
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
Definition: polyPatch.H:290
A class for handling words, derived from string.
Definition: word.H:62
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