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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "motionSmootherData.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
33 (
34  const pointMesh& pMesh
35 )
36 :
37  displacement_
38  (
39  IOobject
40  (
41  "displacement",
42  pMesh.time().timeName(),
43  pMesh(),
44  IOobject::MUST_READ,
45  IOobject::AUTO_WRITE
46  ),
47  pMesh
48  ),
49  scale_
50  (
51  IOobject
52  (
53  "scale",
54  pMesh.time().timeName(),
55  pMesh(),
56  IOobject::NO_READ,
57  IOobject::AUTO_WRITE
58  ),
59  pMesh,
60  dimensionedScalar("scale", dimless, 1.0)
61  ),
62  oldPoints_(pMesh().points())
63 {}
64 
65 
67 (
68  const pointVectorField& displacement
69 )
70 :
71  displacement_
72  (
73  IOobject
74  (
75  "displacement",
76  displacement.time().timeName(),
77  displacement.mesh()(),
78  IOobject::NO_READ,
79  IOobject::AUTO_WRITE
80  ),
81  displacement
82  ),
83  scale_
84  (
85  IOobject
86  (
87  "scale",
88  displacement.time().timeName(),
89  displacement.mesh()(),
90  IOobject::NO_READ,
91  IOobject::AUTO_WRITE
92  ),
93  displacement.mesh(),
94  dimensionedScalar("scale", dimless, 1.0)
95  ),
96  oldPoints_(displacement.mesh()().points())
97 {}
98 
99 
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 
103 {
104  return displacement_;
105 }
106 
107 
109 {
110  return displacement_;
111 }
112 
113 
115 {
116  return scale_;
117 }
118 
119 
121 {
122  return oldPoints_;
123 }
124 
125 
126 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:780
Foam::pointMesh::time
const Time & time() const
Return Time from polyMesh.
Definition: pointMesh.H:127
Foam::motionSmootherData::displacement_
pointVectorField displacement_
Displacement field.
Definition: motionSmootherData.H:56
Foam::motionSmootherData::oldPoints
const pointField & oldPoints() const
Starting mesh position.
Definition: motionSmootherData.C:120
Foam::motionSmootherData::scale
const pointScalarField & scale() const
Reference to scale field.
Definition: motionSmootherData.C:114
Foam::Field< vector >
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
motionSmootherData.H
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:51
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::GeometricField< vector, pointPatchField, pointMesh >
Foam::motionSmootherData::motionSmootherData
motionSmootherData(const pointMesh &pMesh)
Construct read.
Definition: motionSmootherData.C:33
Foam::motionSmootherData::displacement
pointVectorField & displacement()
Reference to displacement field.
Definition: motionSmootherData.C:102
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189