motionSmootherData.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2018 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,
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(),
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 // ************************************************************************* //
pointVectorField displacement_
Displacement field.
motionSmootherData(const pointMesh &)
Construct read.
const dimensionSet dimless
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:48
pointScalarField scale_
Scale factor for displacement.
const pointField & points
const pointField & oldPoints() const
Starting mesh position.
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
Definition: Time.C:666
pointField oldPoints_
Starting mesh position.
const pointScalarField & scale() const
Reference to scale field.
const Mesh & mesh() const
Return mesh.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const Time & time() const
Return time.
Definition: IOobject.C:318
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:98
pointVectorField & displacement()
Reference to displacement field.