FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

setUpdater.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "setUpdater.H"
00027 #include <dynamicMesh/polyTopoChanger.H>
00028 #include <dynamicMesh/polyTopoChange.H>
00029 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00030 #include <OpenFOAM/mapPolyMesh.H>
00031 #include <meshTools/cellSet.H>
00032 #include <meshTools/faceSet.H>
00033 #include <meshTools/pointSet.H>
00034 
00035 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00036 
00037 namespace Foam
00038 {
00039     defineTypeNameAndDebug(setUpdater, 0);
00040     addToRunTimeSelectionTable
00041     (
00042         polyMeshModifier,
00043         setUpdater,
00044         dictionary
00045     );
00046 }
00047 
00048 
00049 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00050 
00051 
00052 
00053 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00054 
00055 // Construct from dictionary
00056 Foam::setUpdater::setUpdater
00057 (
00058     const word& name,
00059     const dictionary& dict,
00060     const label index,
00061     const polyTopoChanger& mme
00062 )
00063 :
00064     polyMeshModifier(name, index, mme, Switch(dict.lookup("active")))
00065 {}
00066 
00067 
00068 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00069 
00070 Foam::setUpdater::~setUpdater()
00071 {}
00072 
00073 
00074 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00075 
00076 bool Foam::setUpdater::changeTopology() const
00077 {
00078     // I am never cause of changeTopo
00079     return false;
00080 }
00081 
00082 
00083 void Foam::setUpdater::setRefinement(polyTopoChange&) const
00084 {}
00085 
00086 
00087 void Foam::setUpdater::modifyMotionPoints(pointField&) const
00088 {}
00089 
00090 
00091 void Foam::setUpdater::updateMesh(const mapPolyMesh& morphMap)
00092 {
00093     // Mesh has changed topologically. Update all sets.
00094     if (debug)
00095     {
00096         Pout<< "setUpdater::updateMesh(const mapPolyMesh& morphMap)"
00097             << endl;
00098     }
00099 
00100     updateSets<cellSet>(morphMap);
00101     updateSets<faceSet>(morphMap);
00102     updateSets<pointSet>(morphMap);
00103 }
00104 
00105 
00106 void Foam::setUpdater::write(Ostream& os) const
00107 {
00108     os  << nl << type() << nl;
00109 }
00110 
00111 
00112 void Foam::setUpdater::writeDict(Ostream& os) const
00113 {
00114     os  << nl << name() << nl << token::BEGIN_BLOCK << nl
00115         << "    type " << type()
00116         << token::END_STATEMENT << nl
00117         << "    active " << active()
00118         << token::END_STATEMENT << nl
00119         << token::END_BLOCK << endl;
00120 }
00121 
00122 
00123 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
00124 
00125 
00126 // * * * * * * * * * * * * * * * Friend Functions  * * * * * * * * * * * * * //
00127 
00128 
00129 // * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //
00130 
00131 
00132 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines