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

errorDrivenRefinement.H

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 Class
00025     Foam::errorDrivenRefinement
00026 
00027 Description
00028     Refines and coarsens based on error estimate.
00029 
00030 SourceFiles
00031     errorDrivenRefinement.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef errorDrivenRefinement_H
00036 #define errorDrivenRefinement_H
00037 
00038 #include <dynamicMesh/polyMeshModifier.H>
00039 #include <dynamicMesh/undoableMeshCutter.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 // Forward declaration of classes
00047 
00048 /*---------------------------------------------------------------------------*\
00049                        Class errorDrivenRefinement Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class errorDrivenRefinement
00053 :
00054     public polyMeshModifier
00055 {
00056     // Private data
00057 
00058         //- Refinement/coarsening engine
00059         mutable undoableMeshCutter refinementEngine_;
00060 
00061         //- Name of volVectorField which contains error.
00062         word errorField_;
00063 
00064 
00065     // Private Member Functions
00066 
00067         //- Disallow default bitwise copy construct
00068         errorDrivenRefinement(const errorDrivenRefinement&);
00069 
00070         //- Disallow default bitwise assignment
00071         void operator=(const errorDrivenRefinement&);
00072 
00073 
00074 public:
00075 
00076     //- Runtime type information
00077     TypeName("errorDrivenRefinement");
00078 
00079 
00080     // Constructors
00081 
00082         //- Construct from dictionary
00083         errorDrivenRefinement
00084         (
00085             const word& name,
00086             const dictionary& dict,
00087             const label index,
00088             const polyTopoChanger& mme
00089         );
00090 
00091 
00092     // Destructor
00093 
00094         virtual ~errorDrivenRefinement();
00095 
00096 
00097     // Member Functions
00098 
00099         //- Check for topology change
00100         virtual bool changeTopology() const;
00101 
00102         //- Insert the layer addition/removal instructions
00103         //  into the topological change
00104         virtual void setRefinement(polyTopoChange&) const;
00105 
00106         //- Modify motion points to comply with the topological change
00107         virtual void modifyMotionPoints(pointField& motionPoints) const;
00108 
00109         //- Force recalculation of locally stored data on topological change
00110         virtual void updateMesh(const mapPolyMesh&);
00111 
00112         //- Write
00113         virtual void write(Ostream&) const;
00114 
00115         //- Write dictionary
00116         virtual void writeDict(Ostream&) const;
00117 
00118 
00119     // Access
00120 
00121         //- Underlying mesh modifier        
00122         const undoableMeshCutter& refinementEngine() const
00123         {
00124             return refinementEngine_;
00125         }
00126 };
00127 
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 } // End namespace Foam
00132 
00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00134 
00135 #endif
00136 
00137 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines