Loading...
Searching...
No Matches
setUpdater.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 OpenFOAM Foundation
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 "setUpdater.H"
29#include "polyTopoChanger.H"
30#include "polyTopoChange.H"
32#include "mapPolyMesh.H"
33#include "cellSet.H"
34#include "faceSet.H"
35#include "pointSet.H"
36
37// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38
39namespace Foam
40{
43 (
47 );
48}
49
50
51// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52
53Foam::setUpdater::setUpdater
54(
55 const word& name,
56 const dictionary& dict,
57 const label index,
58 const polyTopoChanger& mme
59)
61 polyMeshModifier(name, index, mme, dict.get<bool>("active"))
62{}
63
64
65// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
66
69 // I am never cause of changeTopo
70 return false;
72
73
75{}
76
77
79{}
80
81
82void Foam::setUpdater::updateMesh(const mapPolyMesh& morphMap)
83{
84 // Mesh has changed topologically. Update all sets.
85 if (debug)
86 {
87 Pout<< "setUpdater::updateMesh(const mapPolyMesh& morphMap)"
88 << endl;
89 }
91 updateSets<cellSet>(morphMap);
92 updateSets<faceSet>(morphMap);
93 updateSets<pointSet>(morphMap);
94}
95
98{
99 os << nl << type() << nl;
100}
101
102
104{
105 os << nl;
106
107 os.beginBlock(name());
108 os.writeEntry("type", type());
109 os.writeEntry("active", active());
110 os.endBlock();
111}
112
113
114// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Virtual base class for mesh modifiers.
label index() const
Return the index of this modifier.
const word & name() const
Return name of this modifier.
Switch active() const
If modifier activate?
Direct mesh changes based on v1.3 polyTopoChange syntax.
List of mesh modifiers defining the mesh dynamics.
Keeps cell/face/vertex sets uptodate. Both the ones loaded and the ones on disk.
Definition setUpdater.H:52
virtual void write(Ostream &) const
Write.
Definition setUpdater.C:90
virtual bool changeTopology() const
Check for topology change.
Definition setUpdater.C:60
virtual void writeDict(Ostream &) const
Write dictionary.
Definition setUpdater.C:96
virtual void setRefinement(polyTopoChange &) const
Insert the layer addition/removal instructions.
Definition setUpdater.C:67
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
Definition setUpdater.C:71
virtual void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Definition setUpdater.C:75
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
OBJstream os(runTime.globalPath()/outputName)
auto & name
Namespace for handling debugging switches.
Definition debug.C:45
Namespace for OpenFOAM.
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
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
dictionary dict