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
26 PolyPatch mapper for the cell tetFem decomposition
28 \*---------------------------------------------------------------------------*/
30 #include "tetPolyPatchMapperCellDecomp.H"
31 #include "tetPolyPatchCellDecomp.H"
32 #include "tetPolyBoundaryMeshCellDecomp.H"
33 #include "tetPolyMeshCellDecomp.H"
34 #include "tetFemMatrices.H"
35 #include "mapPolyMesh.H"
36 #include "pointMapper.H"
37 #include "faceTetPolyPatchCellDecomp.H"
39 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
41 void Foam::tetPolyPatchMapperCellDecomp::calcAddressing() const
47 "void tetPolyPatchMapperCellDecomp::calcAddressing() const)"
48 ) << "Addressing already calculated"
54 const labelList& curPatchPointMap = mpm_.patchPointMap()[patch_.index()];
56 // Assemble the map (direct mapping)
57 directAddrPtr_ = new labelList(size());
58 labelList& addr = *directAddrPtr_;
61 forAll (curPatchPointMap, pointI)
63 if (curPatchPointMap[pointI] > -1)
65 addr[nAddr] = curPatchPointMap[pointI];
76 void Foam::tetPolyPatchMapperCellDecomp::clearOut()
78 deleteDemandDrivenData(directPtr_);
79 deleteDemandDrivenData(directAddrPtr_);
83 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
85 // Construct from components
86 Foam::tetPolyPatchMapperCellDecomp::tetPolyPatchMapperCellDecomp
88 const tetPolyPatchCellDecomp& patch,
89 const mapPolyMesh& meshMap
99 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
101 Foam::tetPolyPatchMapperCellDecomp::~tetPolyPatchMapperCellDecomp()
107 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
109 Foam::label Foam::tetPolyPatchMapperCellDecomp::size() const
111 return patch_.size();
115 Foam::label Foam::tetPolyPatchMapperCellDecomp::sizeBeforeMapping() const
117 return mpm_.oldPatchNMeshPoints()[patch_.index()];
121 const Foam::unallocLabelList&
122 Foam::tetPolyPatchMapperCellDecomp::directAddressing() const
129 return *directAddrPtr_;
133 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
136 // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
139 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
142 // ************************************************************************* //