1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "pointMesh.H"
27 #include "globalMeshData.H"
28 #include "globalPointPatch.H"
29 #include "pointMeshMapper.H"
30 #include "pointFields.H"
31 #include "MapGeometricFields.H"
32 #include "MapPointField.H"
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 defineTypeNameAndDebug(Foam::pointMesh, 0);
39 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
41 void Foam::pointMesh::mapFields(const mapPolyMesh& mpm) const
44 const pointMeshMapper m(*this, mpm);
46 MapGeometricFields<scalar, pointPatchField, pointMeshMapper, pointMesh>(m);
47 MapGeometricFields<vector, pointPatchField, pointMeshMapper, pointMesh>(m);
56 MapGeometricFields<symmTensor, pointPatchField, pointMeshMapper, pointMesh>
67 MapGeometricFields<diagTensor, pointPatchField, pointMeshMapper, pointMesh>
70 MapGeometricFields<tensor, pointPatchField, pointMeshMapper, pointMesh>(m);
74 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
76 Foam::pointMesh::pointMesh
78 const polyMesh& pMesh,
79 bool alwaysConstructGlobalPatch
82 MeshObject<polyMesh, pointMesh>(pMesh),
83 GeoMesh<polyMesh>(pMesh),
84 boundary_(*this, pMesh.boundaryMesh())
86 // Add the globalPointPatch if there are global points
89 alwaysConstructGlobalPatch
90 || GeoMesh<polyMesh>::mesh_.globalData().nGlobalPoints()
93 boundary_.setSize(boundary_.size() + 1);
106 // Calculate the geometry for the patches (transformation tensors etc.)
107 boundary_.calcGeometry();
111 bool Foam::pointMesh::movePoints() const
113 // Casting const-ness to answer the interface of meshObject
115 const_cast<pointBoundaryMesh&>(boundary_).movePoints();
121 bool Foam::pointMesh::updateMesh(const mapPolyMesh& mpm) const
123 // Casting const-ness to answer the interface of meshObject
125 const_cast<pointBoundaryMesh&>(boundary_).updateMesh();
127 // Map all registered point fields
134 // ************************************************************************* //