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 -------------------------------------------------------------------------------
10 License
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 
39 namespace Foam
40 {
41  defineTypeNameAndDebug(setUpdater, 0);
43  (
44  polyMeshModifier,
45  setUpdater,
46  dictionary
47  );
48 }
49 
50 
51 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52 
53 Foam::setUpdater::setUpdater
54 (
55  const word& name,
56  const dictionary& dict,
57  const label index,
58  const polyTopoChanger& mme
59 )
60 :
61  polyMeshModifier(name, index, mme, dict.get<bool>("active"))
62 {}
63 
64 
65 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
66 
68 {
69  // I am never cause of changeTopo
70  return false;
71 }
72 
73 
75 {}
76 
77 
79 {}
80 
81 
83 {
84  // Mesh has changed topologically. Update all sets.
85  if (debug)
86  {
87  Pout<< "setUpdater::updateMesh(const mapPolyMesh& morphMap)"
88  << endl;
89  }
90 
91  updateSets<cellSet>(morphMap);
92  updateSets<faceSet>(morphMap);
93  updateSets<pointSet>(morphMap);
94 }
95 
96 
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 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::setUpdater::modifyMotionPoints
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
Definition: setUpdater.C:78
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::setUpdater::writeDict
virtual void writeDict(Ostream &) const
Write dictionary.
Definition: setUpdater.C:103
mapPolyMesh.H
Foam::polyTopoChanger
List of mesh modifiers defining the mesh dynamics.
Definition: polyTopoChanger.H:62
polyTopoChanger.H
polyTopoChange.H
Foam::polyTopoChange
Direct mesh changes based on v1.3 polyTopoChange syntax.
Definition: polyTopoChange.H:99
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::Ostream::beginBlock
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
Definition: Ostream.C:91
Foam::setUpdater::setRefinement
virtual void setRefinement(polyTopoChange &) const
Insert the layer addition/removal instructions.
Definition: setUpdater.C:74
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Foam::Field< vector >
faceSet.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::Ostream::endBlock
virtual Ostream & endBlock()
Write end block group.
Definition: Ostream.C:109
Foam::setUpdater::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Definition: setUpdater.C:82
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::setUpdater::write
virtual void write(Ostream &) const
Write.
Definition: setUpdater.C:97
Foam::polyMeshModifier
Virtual base class for mesh modifiers.
Definition: polyMeshModifier.H:68
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
setUpdater.H
Foam::Ostream::writeEntry
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Definition: Ostream.H:236
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
cellSet.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::setUpdater::changeTopology
virtual bool changeTopology() const
Check for topology change.
Definition: setUpdater.C:67
pointSet.H