primalSolver.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2007-2019 PCOpt/NTUA
9  Copyright (C) 2013-2019 FOSS GP
10  Copyright (C) 2019-2021 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 \*---------------------------------------------------------------------------*/
29 
30 #include "primalSolver.H"
32 
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38  defineTypeNameAndDebug(primalSolver, 0);
39  defineRunTimeSelectionTable(primalSolver, primalSolver);
40 }
41 
42 
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 
45 Foam::primalSolver::primalSolver
46 (
47  fvMesh& mesh,
48  const word& managerType,
49  const dictionary& dict
50 )
51 :
52  solver(mesh, managerType, dict)
53 {}
54 
55 
56 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
57 
59 (
60  fvMesh& mesh,
61  const word& managerType,
62  const dictionary& dict
63 )
64 {
65  const word solverType(dict.get<word>("type"));
66 
67  auto* ctorPtr = primalSolverConstructorTable(solverType);
68 
69  if (!ctorPtr)
70  {
72  (
73  dict,
74  "primalSolver",
75  solverType,
76  *primalSolverConstructorTablePtr_
77  ) << exit(FatalIOError);
78  }
79 
80  return autoPtr<primalSolver>(ctorPtr(mesh, managerType, dict));
81 }
82 
83 
84 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
85 
87 {
89  {
90  return true;
91  }
92 
93  return false;
94 }
95 
96 
98 {
99  // Do nothing
100 }
101 
102 
103 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::primalSolver::New
static autoPtr< primalSolver > New(fvMesh &mesh, const word &managerType, const dictionary &dict)
Return a reference to the selected primal solver.
Definition: primalSolver.C:59
Foam::FatalIOError
IOerror FatalIOError
primalSolver.H
FatalIOErrorInLookup
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:478
Foam::solver
Base class for solution control classes.
Definition: solver.H:51
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::primalSolver::correctBoundaryConditions
virtual void correctBoundaryConditions()
update boundary conditions
Definition: primalSolver.C:97
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::primalSolver::readDict
virtual bool readDict(const dictionary &dict)
Definition: primalSolver.C:86
Foam::solver::readDict
virtual bool readDict(const dictionary &dict)
Definition: solver.C:82
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::solver::dict
virtual const dictionary & dict() const
Return the solver dictionary.
Definition: solver.C:113