Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / engine / enginePiston / enginePiston.C
blob6617580d4d829355a3f35f560d3cc2f94286e14f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "enginePiston.H"
28 #include "engineTime.H"
29 #include "polyMesh.H"
30 #include "interpolateXY.H"
32 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
34 // Construct from components
35 Foam::enginePiston::enginePiston
37     const polyMesh& mesh,
38     const word& pistonPatchName,
39     const autoPtr<coordinateSystem>& pistonCS,
40     const scalar minLayer,
41     const scalar maxLayer,
42     const word& pistonPointSetName,
43     const word& pistonFaceSetName,
44     const word& pistonCellSetName,
45     const word& bowlInPistonPatchName,
46     const word& bowlInCylinderPatchName
49     simpleEnginePiston
50     (
51         mesh,
52         pistonPatchName,
53         pistonCS,
54         minLayer,
55         maxLayer
56     ),
57     pistonPointSetName_(pistonPointSetName),
58     pistonFaceSetName_(pistonFaceSetName),
59     pistonCellSetName_(pistonPointSetName),
60     bowlInPistonPatchID_(bowlInPistonPatchName, mesh.boundaryMesh()),
61     bowlInCylinderPatchID_(bowlInCylinderPatchName, mesh.boundaryMesh())
65 // Construct from dictionary
66 Foam::enginePiston::enginePiston
68     const polyMesh& mesh,
69     const dictionary& dict
72     simpleEnginePiston(mesh, dict),
73     pistonPointSetName_(dict.lookup("pistonPointSetName")),
74     pistonFaceSetName_(dict.lookup("pistonFaceSetName")),
75     pistonCellSetName_(dict.lookup("pistonCellSetName")),
76     bowlInPistonPatchID_
77     (
78         dict.lookup("bowlInPistonPatchName"),
79         mesh.boundaryMesh()
80     ),
81     bowlInCylinderPatchID_
82     (
83         dict.lookup("bowlInCylinderPatchName"),
84         mesh.boundaryMesh()
85     )
89 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
92 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
94 void Foam::enginePiston::writeDict(Ostream& os) const
96     simpleEnginePiston::writeDict(os);
97     os  << nl << token::BEGIN_BLOCK
98         << "pistonPointSetName " << pistonPointSetName_
99         << token::END_STATEMENT << nl
100         << "pistonFaceSetName " << pistonFaceSetName_
101         << token::END_STATEMENT << nl
102         << "pistonCellSetName " << pistonCellSetName_
103         << token::END_STATEMENT << nl
104         << token::END_BLOCK << endl;
108 // ************************************************************************* //