fromFile.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) 2020 PCOpt/NTUA
9 Copyright (C) 2020 FOSS GP
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
30#include "fromFile.H"
31#include "IOdictionary.H"
32
33
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36namespace Foam
37{
38
41 (
45 );
46}
47
48
49// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
50
52{
53 Info<< "Reading control points from file " << endl;
54 const fvMesh& mesh = box_.mesh();
55 const dictionary& dict = box_.dict();
56 IOdictionary cpsDict
57 (
59 (
60 dict.dictName() + "cpsBsplines" + mesh.time().timeName(),
62 "controlPoints",
63 mesh,
66 false
67 )
68 );
69
70 cpsDict.readEntry("controlPoints", cps_);
71 const label nCPsU(box_.basisU().nCPs());
72 const label nCPsV(box_.basisV().nCPs());
73 const label nCPsW(box_.basisW().nCPs());
74 if (cps_.size() != nCPsU*nCPsV*nCPsW)
75 {
77 << "Number of control points does not agree with "
78 << "nCPsU*nCPv*nCPsW"
79 << exit(FatalError);
80 }
81}
82
83
84// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
85
87:
89{
91}
92
93
94// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
NURBS3DVolume morpher. Includes support functions for gradient computations Base class providing supp...
Definition: NURBS3DVolume.H:76
const dictionary & dict() const
Get dictionary.
const NURBSbasis & basisV() const
const NURBSbasis & basisW() const
const fvMesh & mesh() const
Get mesh.
const NURBSbasis & basisU() const
Get basis functions.
const label & nCPs() const
Definition: NURBSbasisI.H:46
fileName caseConstant() const
Definition: TimePathsI.H:108
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:780
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
Abstract base for selecting how to construct the control points of a volumetric B-Splines morpher.
vectorField & cps_
The volumetric B-Splines control points.
NURBS3DVolume & box_
The volumetric B-Splines box.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
word dictName() const
The local dictionary name (final part of scoped name)
Definition: dictionaryI.H:60
Reads control points from constant/controlPoints.
Definition: fromFile.H:55
virtual void computeControlPoints()
Compute control points.
Definition: fromFile.C:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:290
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
dynamicFvMesh & mesh
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Namespace for OpenFOAM.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
error FatalError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
dictionary dict