componentVelocityMotionSolver.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) 2012 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 
27 #include "mapPolyMesh.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33  defineTypeNameAndDebug(componentVelocityMotionSolver, 0);
34 }
35 
36 
37 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
38 
39 Foam::direction Foam::componentVelocityMotionSolver::cmpt
40 (
41  const word& cmptName
42 ) const
43 {
44  if (cmptName == "x")
45  {
46  return vector::X;
47  }
48  else if (cmptName == "y")
49  {
50  return vector::Y;
51  }
52  else if (cmptName == "z")
53  {
54  return vector::Z;
55  }
56  else
57  {
59  (
60  "componentVelocityMotionSolver::"
61  "componentVelocityMotionSolver"
62  "(const polyMesh& mesh, const IOdictionary&)"
63  ) << "Given component name " << cmptName << " should be x, y or z"
64  << exit(FatalError);
65 
66  return 0;
67  }
68 }
69 
70 
71 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
72 
73 Foam::componentVelocityMotionSolver::componentVelocityMotionSolver
74 (
75  const polyMesh& mesh,
76  const IOdictionary& dict,
77  const word& type
78 )
79 :
80  motionSolver(mesh, dict, type),
81  cmptName_(coeffDict().lookup("component")),
82  cmpt_(cmpt(cmptName_)),
83  pointMotionU_
84  (
85  IOobject
86  (
87  "pointMotionU" + cmptName_,
88  mesh.time().timeName(),
89  mesh,
90  IOobject::MUST_READ,
91  IOobject::AUTO_WRITE
92  ),
93  pointMesh::New(mesh)
94  )
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
99 
101 {}
102 
103 
104 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105 
107 {
108  // No local data to adapt
109 }
110 
111 
113 {
114  // pointMesh already updates pointFields.
115 
116  motionSolver::updateMesh(mpm);
117 }
118 
119 
120 // ************************************************************************* //