FreeFOAM The Cross-Platform CFD Toolkit
motionDiffusivity.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 | 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 \*---------------------------------------------------------------------------*/
25 
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32  defineTypeNameAndDebug(motionDiffusivity, 0);
33 
34  defineRunTimeSelectionTable(motionDiffusivity, Istream);
35 }
36 
37 
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 
41 :
42  mSolver_(mSolver)
43 {}
44 
45 
46 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
47 
49 (
50  const fvMotionSolver& mSolver,
51  Istream& mdData
52 )
53 {
54  word diffTypeName(mdData);
55 
56  Info << "Selecting motion diffusion: " << diffTypeName << endl;
57 
58  IstreamConstructorTable::iterator cstrIter =
59  IstreamConstructorTablePtr_->find(diffTypeName);
60 
61  if (cstrIter == IstreamConstructorTablePtr_->end())
62  {
64  (
65  "motionDiffusivity::New(const tetPolyMesh& tetMesh, "
66  "const Istream& dict)"
67  ) << "Unknown diffusion type " << diffTypeName
68  << endl << endl
69  << "Valid diffusion types are :" << endl
70  << IstreamConstructorTablePtr_->sortedToc()
71  << exit(FatalError);
72  }
73 
74  return autoPtr<motionDiffusivity>(cstrIter()(mSolver, mdData));
75 }
76 
77 
78 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
79 
81 {}
82 
83 
84 // ************************ vim: set sw=4 sts=4 et: ************************ //