1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Implementation of the fluxCorrector base class
32 University of Massachusetts Amherst
35 \*---------------------------------------------------------------------------*/
37 #include "fluxCorrector.H"
38 #include "dlLibraryTable.H"
43 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
45 defineTypeNameAndDebug(fluxCorrector, 0);
46 defineRunTimeSelectionTable(fluxCorrector, mesh);
48 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
50 autoPtr<fluxCorrector> fluxCorrector::New
53 const dictionary& dict
56 // Check if an optional entry was specified
57 if (dict.found("fluxCorrector"))
59 word correctorTypeName(dict.lookup("fluxCorrector"));
61 // Open any supplied libraries in dictionary
66 meshConstructorTablePtr_
69 if (!meshConstructorTablePtr_)
73 "autoPtr<fluxCorrector> fluxCorrector::New"
74 "(const fvMesh& mesh, const dictionary& dict)"
75 ) << "fluxCorrector table is empty"
79 correctorTypeName = word(dict.lookup("fluxCorrector"));
81 meshConstructorTable::iterator cstrIter =
82 meshConstructorTablePtr_->find(correctorTypeName);
84 if (cstrIter == meshConstructorTablePtr_->end())
88 "autoPtr<fluxCorrector> fluxCorrector::New"
89 "(const fvMesh& mesh, const dictionary& dict)"
90 ) << "Unknown fluxCorrector type " << correctorTypeName
92 << "Valid fluxCorrector types are: " << endl
93 << meshConstructorTablePtr_->toc()
97 return autoPtr<fluxCorrector>(cstrIter()(mesh, dict));
100 // Return the default fluxCorrector
101 return autoPtr<fluxCorrector>(new fluxCorrector(mesh, dict));
105 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
107 //- Return reference to mesh
108 const fvMesh& fluxCorrector::mesh() const
114 //- Return reference to dictionary
115 const dictionary& fluxCorrector::dict() const
121 //- Is flux-correction required?
122 bool fluxCorrector::required() const
124 // Support for cases which do not involve a flow-solver.
125 // Notify the user, just in case.
126 Info << " ~~~ No flux correction ~~~ " << endl;
132 //- Interpolate fluxes to a specified list of faces
133 void fluxCorrector::interpolateFluxes(const labelList& faces) const
137 // Throw an error stating that the scheme hasn't been implemented
140 "void fluxCorrector::interpolateFluxes"
141 "(const labelList& faces) const"
147 //- Update fluxes in the registry, if required
148 void fluxCorrector::updateFluxes() const
152 // Throw an error stating that the scheme hasn't been implemented
153 notImplemented("void fluxCorrector::updateFluxes() const");
158 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
159 void fluxCorrector::operator=(const fluxCorrector& rhs)
161 // Check for assignment to self
164 FatalErrorIn("fluxCorrector::operator=(const fluxCorrector&)")
165 << "Attempted assignment to self"
166 << abort(FatalError);
170 } // End namespace Foam
172 // ************************************************************************* //