processorLagrangianPatchField.C
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 \*---------------------------------------------------------------------------*/
25 
28 #include "transformField.H"
29 #include "symmTransformField.H"
30 
31 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
32 
33 template<class Type>
34 template<template<class> class GeoField>
36 (
37  PstreamBuffers& pBufs,
38  const GeoField<Type>& internalField
39 )
40 {
41  UIPstream uips(processorPatch_.processorPatch().neighbProcNo(), pBufs);
42  Field<Type> field(uips);
43 
44  const LagrangianMesh& mesh = processorPatch_.boundaryMesh().mesh();
45 
46  mesh.appendSpecifiedField<Type, GeoField>
47  (
48  processorPatch_.mesh(),
49  const_cast<GeoField<Type>&>(internalField),
50  field
51  );
52 }
53 
54 
55 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
56 
57 template<class Type>
59 (
60  const LagrangianPatch& p,
61  const regIOobject& iIo
62 )
63 :
64  LagrangianPatchField<Type>(p, iIo),
65  processorPatch_(refCast<const processorLagrangianPatch>(p))
66 {}
67 
68 
69 template<class Type>
71 (
72  const LagrangianPatch& p,
73  const regIOobject& iIo,
74  const dictionary& dict
75 )
76 :
77  LagrangianPatchField<Type>(p, iIo, dict),
78  processorPatch_(refCast<const processorLagrangianPatch>(p))
79 {}
80 
81 
82 template<class Type>
84 (
86 )
87 :
88  LagrangianPatchField<Type>(ptf),
89  processorPatch_(ptf.processorPatch_)
90 {}
91 
92 
93 template<class Type>
95 (
97  const regIOobject& iIo
98 )
99 :
100  LagrangianPatchField<Type>(ptf, iIo),
101  processorPatch_(ptf.processorPatch_)
102 {}
103 
104 
105 template<class Type>
107 (
109  const LagrangianPatch& p,
110  const regIOobject& iIo
111 )
112 :
113  LagrangianPatchField<Type>(ptf, p, iIo),
114  processorPatch_(refCast<const processorLagrangianPatch>(p))
115 {}
116 
117 
118 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
119 
120 template<class Type>
122 (
123  PstreamBuffers& pBufs,
125 )
126 {
127  UOPstream(processorPatch_.processorPatch().neighbProcNo(), pBufs)()
128  << this->primitiveSubField();
129 }
130 
131 
132 template<class Type>
134 (
135  PstreamBuffers& pBufs,
137 )
138 {
139  if (notNull(this->internalField_))
140  {
141  return
142  evaluate<LagrangianInternalDynamicField>
143  (
144  pBufs,
145  this->internalField_
146  );
147  }
148 
149  if (notNull(this->internalNonDynamicField_))
150  {
151  return
152  evaluate<LagrangianInternalField>
153  (
154  pBufs,
155  this->internalNonDynamicField_
156  );
157  }
158 
160  << "Internal field " << this->internalIo_.name() << " is not of type "
162  << exit(FatalError);
163 }
164 
165 
166 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Base class for Lagrangian boundary conditions.
Base class for Lagrangian patches.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Output inter-processor communications stream operating on external buffer.
Definition: UOPstream.H:58
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const polyMesh & mesh() const
Return the mesh reference.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:401
A processor boundary condition for Lagrangian. Properties are communicated to and from the neighbour ...
processorLagrangianPatchField(const LagrangianPatch &, const regIOobject &)
Construct from patch and internal field.
virtual void initEvaluate(PstreamBuffers &, const LagrangianScalarInternalDynamicField &fraction)
Initialise evaluation of the patch field.
Processor Lagrangian patch. This is used for the patches that interface between processors across fac...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:134
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
Definition: nullObjectI.H:64
error FatalError
dictionary dict
volScalarField & p
Spatial transformation functions for symmTensor fields.
Spatial transformation functions for primitive fields.