fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / OpenFOAM / meshes / pointMesh / pointMesh.C
blob84a3215822aadfc70f418f1d6bbfbb4a6649338b
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 "pointMesh.H"
28 #include "globalMeshData.H"
29 #include "globalPointPatch.H"
30 #include "pointMeshMapper.H"
31 #include "pointFields.H"
32 #include "MapGeometricFields.H"
33 #include "MapPointField.H"
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 defineTypeNameAndDebug(Foam::pointMesh, 0);
40 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
42 void Foam::pointMesh::mapFields(const mapPolyMesh& mpm) const
44     // Create a mapper
45     const pointMeshMapper m(*this, mpm);
47     MapGeometricFields<scalar, pointPatchField, pointMeshMapper, pointMesh>(m);
48     MapGeometricFields<vector, pointPatchField, pointMeshMapper, pointMesh>(m);
49     MapGeometricFields
50     <
51         sphericalTensor,
52         pointPatchField,
53         pointMeshMapper,
54         pointMesh
55     >(m);
57     MapGeometricFields<symmTensor, pointPatchField, pointMeshMapper, pointMesh>
58     (m);
60     MapGeometricFields<tensor, pointPatchField, pointMeshMapper, pointMesh>(m);
64 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
66 Foam::pointMesh::pointMesh
68     const polyMesh& pMesh,
69     bool alwaysConstructGlobalPatch
72     MeshObject<polyMesh, pointMesh>(pMesh),
73     GeoMesh<polyMesh>(pMesh),
74     boundary_(*this, pMesh.boundaryMesh())
76     // Add the globalPointPatch if there are global points
77     if
78     (
79         alwaysConstructGlobalPatch
80      || GeoMesh<polyMesh>::mesh_.globalData().nGlobalPoints()
81     )
82     {
83         boundary_.setSize(boundary_.size() + 1);
85         boundary_.set
86         (
87             boundary_.size() - 1,
88             new globalPointPatch
89             (
90                 boundary_,
91                 boundary_.size() - 1
92             )
93         );
94     }
96     // Calculate the geometry for the patches (transformation tensors etc.)
97     boundary_.calcGeometry();
101 bool Foam::pointMesh::movePoints() const
103     // Casting const-ness to answer the interface of meshObject
104     // HJ, 30/Aug/2010
105     const_cast<pointBoundaryMesh&>(boundary_).movePoints();
107     return true;
111 bool Foam::pointMesh::updateMesh(const mapPolyMesh& mpm) const
113     // Casting const-ness to answer the interface of meshObject
114     // HJ, 30/Aug/2010
115     const_cast<pointBoundaryMesh&>(boundary_).updateMesh();
117     // Map all registered point fields
118     mapFields(mpm);
120     return true;
124 // ************************************************************************* //