lduPrimitiveProcessorInterface.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) 2016-2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
29#include "transformField.H"
30
31// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32
33namespace Foam
34{
36}
37
38
39// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40
42(
44)
45:
46 faceCells_(p.faceCells()),
47 myProcNo_(p.myProcNo()),
48 neighbProcNo_(p.neighbProcNo()),
49 forwardT_(p.forwardT()),
50 tag_(p.tag()),
51 comm_(p.comm())
52{}
53
54
56(
57 const labelUList& faceCells,
58 const label myProcNo,
59 const label neighbProcNo,
60 const tensorField& forwardT,
61 const int tag,
62 const label comm
63)
64:
65 faceCells_(faceCells),
66 myProcNo_(myProcNo),
67 neighbProcNo_(neighbProcNo),
68 forwardT_(forwardT),
69 tag_(tag),
70 comm_(comm)
71{}
72
73
74// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
75
78(
79 const labelUList& internalData
80) const
81{
82 return interfaceInternalField(internalData, faceCells_);
83}
84
85
88(
89 const labelUList& internalData,
91) const
92{
93 auto tfld = tmp<labelField>::New(faceCells.size());
94 auto& fld = tfld.ref();
95
97 {
98 fld[i] = internalData[faceCells[i]];
99 }
100 return tfld;
101}
102
103
105(
106 const Pstream::commsTypes commsType,
107 const labelUList& iF
108) const
109{
110 processorLduInterface::send(commsType, interfaceInternalField(iF)());
111}
112
113
115(
116 const Pstream::commsTypes commsType,
117 const labelUList& iF,
118 const labelUList& faceCells
119) const
120{
122 (
123 commsType,
124 interfaceInternalField(iF, faceCells)()
125 );
126}
127
128
131(
132 const Pstream::commsTypes commsType,
133 const labelUList&
134) const
135{
136 return processorLduInterface::receive<label>(commsType, faceCells_.size());
137}
138
139// ************************************************************************* //
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
commsTypes
Types of communications.
Definition: UPstream.H:67
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:59
Concrete implementation of processor interface. Used to temporarily store settings.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise neighbour field transfer.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
void send(const Pstream::commsTypes commsType, const UList< Type > &f) const
Raw send function.
A class for managing temporary objects.
Definition: tmp.H:65
#define defineTypeName(Type)
Define the typeName.
Definition: className.H:96
volScalarField & p
Namespace for OpenFOAM.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
Spatial transformation functions for primitive fields.