ENH: RASModel.C: clipping input to log
[OpenFOAM-1.7.x.git] / src / dynamicFvMesh / solidBodyMotionFvMesh / solidBodyMotionFvMesh.C
blobbb5601458a63df0ac6e08af8c6ee3f549733805c
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.
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.
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.
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "solidBodyMotionFvMesh.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "volFields.H"
29 #include "mathematicalConstants.H"
30 #include "transformField.H"
32 using namespace Foam::mathematicalConstant;
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
36 namespace Foam
38     defineTypeNameAndDebug(solidBodyMotionFvMesh, 0);
39     addToRunTimeSelectionTable(dynamicFvMesh, solidBodyMotionFvMesh, IOobject);
43 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
45 Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
47     dynamicFvMesh(io),
48     dynamicMeshCoeffs_
49     (
50         IOdictionary
51         (
52             IOobject
53             (
54                 "dynamicMeshDict",
55                 io.time().constant(),
56                 *this,
57                 IOobject::MUST_READ,
58                 IOobject::NO_WRITE
59             )
60         ).subDict(typeName + "Coeffs")
61     ),
62     SBMFPtr_(solidBodyMotionFunction::New(dynamicMeshCoeffs_, io.time())),
63     undisplacedPoints_
64     (
65         IOobject
66         (
67             "points",
68             io.time().constant(),
69             meshSubDir,
70             *this,
71             IOobject::MUST_READ,
72             IOobject::NO_WRITE
73         )
74     )
78 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
80 Foam::solidBodyMotionFvMesh::~solidBodyMotionFvMesh()
84 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
86 bool Foam::solidBodyMotionFvMesh::update()
88     static bool hasWarned = false;
90     fvMesh::movePoints
91     (
92         transform(SBMFPtr_().transformation(),
93         undisplacedPoints_)
94     );
96     if (foundObject<volVectorField>("U"))
97     {
98         const_cast<volVectorField&>(lookupObject<volVectorField>("U"))
99             .correctBoundaryConditions();
100     }
101     else if (!hasWarned)
102     {
103         hasWarned = true;
105         WarningIn("solidBodyMotionFvMesh::update()")
106             << "Did not find volVectorField U."
107             << " Not updating U boundary conditions." << endl;
108     }
110     return true;
114 // ************************************************************************* //