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 
82 void 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  }
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
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::setUpdater::modifyMotionPoints
virtual void modifyMotionPoints(pointField &motionPoints) const
Definition: setUpdater.C:71
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:63
Foam::setUpdater::writeDict
virtual void writeDict(Ostream &) const
Definition: setUpdater.C:96
mapPolyMesh.H
Foam::polyTopoChanger
List of mesh modifiers defining the mesh dynamics.
Definition: polyTopoChanger.H:58
polyTopoChanger.H
polyTopoChange.H
Foam::polyTopoChange
Direct mesh changes based on v1.3 polyTopoChange syntax.
Definition: polyTopoChange.H:95
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
Foam::Ostream::beginBlock
virtual Ostream & beginBlock(const keyType &kw)
Definition: Ostream.C:84
Foam::setUpdater::setRefinement
virtual void setRefinement(polyTopoChange &) const
Definition: setUpdater.C:67
Foam::Pout
prefixOSstream Pout
Foam::Field
Generic templated field type.
Definition: Field.H:59
faceSet.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::Ostream::endBlock
virtual Ostream & endBlock()
Definition: Ostream.C:102
Foam::setUpdater::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Definition: setUpdater.C:75
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Definition: atmBoundaryLayer.C:26
Foam::setUpdater::write
virtual void write(Ostream &) const
Definition: setUpdater.C:90
Foam::polyMeshModifier
Virtual base class for mesh modifiers.
Definition: polyMeshModifier.H:64
Foam::nl
constexpr char nl
Definition: Ostream.H:424
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Definition: POSIX.C:717
setUpdater.H
bool
bool
Definition: EEqn.H:20
Foam::Ostream::writeEntry
Ostream & writeEntry(const keyType &key, const T &value)
Definition: Ostream.H:232
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:157
Foam::PtrListOps::get
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
Foam::name
word name(const expressions::valueTypeCode typeCode)
Definition: exprTraits.C:52
cellSet.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:52
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::setUpdater::changeTopology
virtual bool changeTopology() const
Definition: setUpdater.C:60
pointSet.H