Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
12License
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"
33
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36namespace Foam
37{
38 defineTypeNameAndDebug(primalSolver, 0);
39 defineRunTimeSelectionTable(primalSolver, primalSolver);
40}
41
42
43// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44
45Foam::primalSolver::primalSolver
46(
47 fvMesh& mesh,
48 const word& managerType,
49 const dictionary& dict,
50 const word& solverName
51)
54{}
55
56
57// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
58
60(
61 fvMesh& mesh,
62 const word& managerType,
63 const dictionary& dict,
64 const word& solverName
65)
66{
67 const word solverType(dict.get<word>("type"));
68
69 auto* ctorPtr = primalSolverConstructorTable(solverType);
70
71 if (!ctorPtr)
72 {
74 (
75 dict,
76 "primalSolver",
77 solverType,
78 *primalSolverConstructorTablePtr_
79 ) << exit(FatalIOError);
80 }
81
82 return
84}
85
86
87// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
88
90{
92 {
93 return true;
94 }
95
96 return false;
97}
98
99
101{
102 // Do nothing
103}
104
105
106// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
Base class for primal solvers.
virtual bool readDict(const dictionary &dict)
static autoPtr< primalSolver > New(fvMesh &mesh, const word &managerType, const dictionary &dict, const word &solverName)
Return a reference to the selected primal solver.
virtual void correctBoundaryConditions()
update boundary conditions
const word & managerType() const
Return the manager type.
Definition solverI.H:72
virtual bool readDict(const dictionary &dict)
Definition solver.C:70
const dictionary & dict() const
Return the solver dictionary.
Definition solverI.H:54
const fvMesh & mesh() const
Return the solver mesh.
Definition solverI.H:24
const word & solverName() const
Return the solver name.
Definition solverI.H:30
solver(const solver &)=delete
No copy construct.
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition error.H:637
Namespace for OpenFOAM.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
dictionary dict