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"
32
33
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36namespace Foam
37{
40}
41
42
43// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44
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{
88 if (solver::readDict(dict))
89 {
90 return true;
91 }
92
93 return false;
94}
95
96
98{
99 // Do nothing
100}
101
102
103// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Base class for primal solvers.
Definition: primalSolver.H:55
virtual bool readDict(const dictionary &dict)
Definition: primalSolver.C:86
virtual void correctBoundaryConditions()
update boundary conditions
Definition: primalSolver.C:97
Base class for solution control classes.
Definition: solver.H:54
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
dynamicFvMesh & mesh
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:478
Namespace for OpenFOAM.
IOerror FatalIOError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
dictionary dict