motionSmootherData.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 | Copyright (C) 2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "motionSmootherData.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 (
32  const pointMesh& pMesh
33 )
34 :
35  displacement_
36  (
37  IOobject
38  (
39  "displacement",
40  pMesh.time().timeName(),
41  pMesh(),
42  IOobject::MUST_READ,
43  IOobject::AUTO_WRITE
44  ),
45  pMesh
46  ),
47  scale_
48  (
49  IOobject
50  (
51  "scale",
52  pMesh.time().timeName(),
53  pMesh(),
54  IOobject::NO_READ,
55  IOobject::AUTO_WRITE
56  ),
57  pMesh,
58  dimensionedScalar("scale", dimless, 1.0)
59  ),
60  oldPoints_(pMesh().points())
61 {}
62 
63 
65 (
66  const pointVectorField& displacement
67 )
68 :
69  displacement_
70  (
71  IOobject
72  (
73  "displacement",
74  displacement.time().timeName(),
75  displacement.mesh()(),
76  IOobject::NO_READ,
77  IOobject::AUTO_WRITE
78  ),
79  displacement
80  ),
81  scale_
82  (
83  IOobject
84  (
85  "scale",
86  displacement.time().timeName(),
87  displacement.mesh()(),
88  IOobject::NO_READ,
89  IOobject::AUTO_WRITE
90  ),
91  displacement.mesh(),
92  dimensionedScalar("scale", dimless, 1.0)
93  ),
94  oldPoints_(displacement.mesh()().points())
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 
101 {
102  return displacement_;
103 }
104 
105 
107 {
108  return displacement_;
109 }
110 
111 
113 {
114  return scale_;
115 }
116 
117 
119 {
120  return oldPoints_;
121 }
122 
123 
124 // ************************************************************************* //
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::dimless
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
Foam::motionSmootherData::displacement_
pointVectorField displacement_
Displacement field.
Definition: motionSmootherData.H:54
Foam::IOobject::time
const Time & time() const
Return time.
Definition: IOobject.C:245
Foam::motionSmootherData::motionSmootherData
motionSmootherData(const pointMesh &)
Construct read.
Definition: motionSmootherData.C:31
Foam::motionSmootherData::oldPoints
const pointField & oldPoints() const
Starting mesh position.
Definition: motionSmootherData.C:118
Foam::motionSmootherData::scale
const pointScalarField & scale() const
Reference to scale field.
Definition: motionSmootherData.C:112
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:41
motionSmootherData.H
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:48
Foam::Time::timeName
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:741
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::motionSmootherData::displacement
pointVectorField & displacement()
Reference to displacement field.
Definition: motionSmootherData.C:100
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52