1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
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
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
45 const pointMeshMapper m(*this, mpm);
47 MapGeometricFields<scalar, pointPatchField, pointMeshMapper, pointMesh>(m);
48 MapGeometricFields<vector, pointPatchField, pointMeshMapper, pointMesh>(m);
57 MapGeometricFields<symmTensor, pointPatchField, pointMeshMapper, pointMesh>
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
79 alwaysConstructGlobalPatch
80 || GeoMesh<polyMesh>::mesh_.globalData().nGlobalPoints()
83 boundary_.setSize(boundary_.size() + 1);
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
105 const_cast<pointBoundaryMesh&>(boundary_).movePoints();
111 bool Foam::pointMesh::updateMesh(const mapPolyMesh& mpm) const
113 // Casting const-ness to answer the interface of meshObject
115 const_cast<pointBoundaryMesh&>(boundary_).updateMesh();
117 // Map all registered point fields
124 // ************************************************************************* //