FreeFOAM The Cross-Platform CFD Toolkit
errorDrivenRefinement.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::errorDrivenRefinement
26 
27 Description
28  Refines and coarsens based on error estimate.
29 
30 SourceFiles
31  errorDrivenRefinement.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef errorDrivenRefinement_H
36 #define errorDrivenRefinement_H
37 
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 
48 /*---------------------------------------------------------------------------*\
49  Class errorDrivenRefinement Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public polyMeshModifier
55 {
56  // Private data
57 
58  //- Refinement/coarsening engine
59  mutable undoableMeshCutter refinementEngine_;
60 
61  //- Name of volVectorField which contains error.
62  word errorField_;
63 
64 
65  // Private Member Functions
66 
67  //- Disallow default bitwise copy construct
69 
70  //- Disallow default bitwise assignment
71  void operator=(const errorDrivenRefinement&);
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("errorDrivenRefinement");
78 
79 
80  // Constructors
81 
82  //- Construct from dictionary
84  (
85  const word& name,
86  const dictionary& dict,
87  const label index,
88  const polyTopoChanger& mme
89  );
90 
91 
92  // Destructor
93 
94  virtual ~errorDrivenRefinement();
95 
96 
97  // Member Functions
98 
99  //- Check for topology change
100  virtual bool changeTopology() const;
101 
102  //- Insert the layer addition/removal instructions
103  // into the topological change
104  virtual void setRefinement(polyTopoChange&) const;
105 
106  //- Modify motion points to comply with the topological change
107  virtual void modifyMotionPoints(pointField& motionPoints) const;
108 
109  //- Force recalculation of locally stored data on topological change
110  virtual void updateMesh(const mapPolyMesh&);
111 
112  //- Write
113  virtual void write(Ostream&) const;
114 
115  //- Write dictionary
116  virtual void writeDict(Ostream&) const;
117 
118 
119  // Access
120 
121  //- Underlying mesh modifier
123  {
124  return refinementEngine_;
125  }
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************ vim: set sw=4 sts=4 et: ************************ //