Loading...
Searching...
No Matches
binField.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) 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
28#include "binField.H"
29#include "binModel.H"
32// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33
34namespace Foam
35{
36namespace functionObjects
37{
40}
41}
42
43
44// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45
47(
48 const word& name,
49 const Time& runTime,
50 const dictionary& dict,
51 bool readFields
52)
53:
54 fvMeshFunctionObject(name, runTime, dict),
55 binModelPtr_(nullptr)
56{
58 {
59 read(dict);
60 }
61}
62
63
65(
66 const word& name,
67 const objectRegistry& obr,
68 const dictionary& dict,
69 bool readFields
70)
71:
72 fvMeshFunctionObject(name, obr, dict),
73 binModelPtr_(nullptr)
74{
75 if (readFields)
76 {
78 }
79}
80
81
82// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
83
85{
87 {
88 return false;
89 }
90
91 Info<< type() << " " << name() << ":" << endl;
94
95 return true;
96}
97
98
100{
101 Log << type() << " " << name() << ":" << nl
102 << " Calculating bins" << nl << endl;
104 binModelPtr_->apply();
105
106 return true;
107}
108
111{
112 return true;
113}
114
117{
118 binModelPtr_->updateMesh(mpm);
119}
120
121
123{
124 binModelPtr_->movePoints(mesh);
125}
126
127
128// ************************************************************************* //
#define Log
Definition PDRblock.C:28
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
static autoPtr< binModel > New(const dictionary &dict, const fvMesh &mesh, const word &outputPrefix)
Return a reference to the selected bin model.
Definition binModelNew.C:27
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Abstract base-class for Time/database function objects.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
Calculates binned data, where specified patches are divided into segments according to various input ...
Definition binField.H:227
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
Definition binField.C:115
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
Definition binField.C:77
binField(const word &name, const Time &runTime, const dictionary &dict, const bool readFields=true)
Construct from name, Time and dictionary.
Definition binField.C:40
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
Definition binField.C:109
autoPtr< binModel > binModelPtr_
Runtime-selectable bin model.
Definition binField.H:235
virtual bool execute()
Execute the function-object operations.
Definition binField.C:92
virtual bool write()
Write the function-object results.
Definition binField.C:103
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Definition readFields.H:146
virtual const objectRegistry & obr() const
The region or sub-region registry being used.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
engineTime & runTime
auto & name
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
messageStream Info
Information stream (stdout output on master, null elsewhere).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition POSIX.C:801
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
dictionary dict