lagrangianFieldDecomposerTemplates.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) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
30#include "IOobjectList.H"
31
32// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
33
34template<class Type>
37(
38 const word& cloudName,
39 const IOField<Type>& field
40) const
41{
42 // Create the field for the processor
44 (
46 (
47 field.name(),
48 procMesh_.time().timeName(),
50 procMesh_,
53 false
54 ),
55 // Mapping internal field values
56 Field<Type>(field, particleIndices_)
57 );
58}
59
60
61template<class Type>
64(
65 const word& cloudName,
66 const CompactIOField<Field<Type>, Type>& field
67) const
68{
69 // Create the field for the processor
71 (
73 (
74 field.name(),
75 procMesh_.time().timeName(),
77 procMesh_,
80 false
81 ),
82 // Mapping internal field values
83 Field<Field<Type>>(field, particleIndices_)
84 );
85}
86
87
88template<class GeoField>
90(
91 const word& cloudName,
93) const
94{
95 const bool existsOnProc = (particleIndices_.size() > 0);
96
97 for (const GeoField& fld : fields)
98 {
99 decomposeField(cloudName, fld)().write(existsOnProc);
100 }
101}
102
103
104template<class GeoField>
106(
107 const word& cloudName,
109) const
110{
111 const bool existsOnProc = (particleIndices_.size() > 0);
112
113 for (const GeoField& fld : fields)
114 {
115 decomposeFieldField(cloudName, fld)().write(existsOnProc);
116 }
117}
118
119
120// ************************************************************************* //
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))
A Field of objects of type <T> with automated input and output using a compact storage....
Generic templated field type.
Definition: Field.H:82
A primitive field of type <T> with automated input and output.
Definition: IOField.H:58
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:780
static const word prefix
The prefix to local: lagrangian.
Definition: cloud.H:87
tmp< IOField< Type > > decomposeField(const word &cloudName, const IOField< Type > &field) const
Decompose volume field.
void decomposeFields(const word &cloudName, const PtrList< GeoField > &fields) const
tmp< CompactIOField< Field< Type >, Type > > decomposeFieldField(const word &cloudName, const CompactIOField< Field< Type >, Type > &field) const
void decomposeFieldFields(const word &cloudName, const PtrList< GeoField > &fields) const
const Time & time() const noexcept
Return time registry.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
rDeltaTY field()
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
runTime write()
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
const word cloudName(propsDict.get< word >("cloud"))