STYLE: use simpler typedefs for PrimitivePatch instances

This commit is contained in:
Mark Olesen
2020-04-28 16:10:09 +02:00
parent 8cbf55acad
commit 344940829a
10 changed files with 43 additions and 46 deletions

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -23,26 +24,26 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::patchToPatchInterpolation
Description
Foam::patchToPatchInterpolation
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef patchToPatchInterpolation_H #ifndef patchToPatchInterpolation_H
#define patchToPatchInterpolation_H #define patchToPatchInterpolation_H
#include "PatchToPatchInterpolation.H" #include "PatchToPatchInterpolation.H"
#include "PrimitivePatch.H" #include "primitivePatch.H"
#include "face.H"
#include "SubList.H"
#include "pointField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef PatchToPatchInterpolation typedef PatchToPatchInterpolation<primitivePatch, primitivePatch>
< patchToPatchInterpolation;
PrimitivePatch<face, SubList, const pointField&>,
PrimitivePatch<face, SubList, const pointField&>
> patchToPatchInterpolation;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -64,7 +64,7 @@ void PrimitivePatchInterpolation<Patch>::makeFaceToPointWeights() const
const List<typename Patch::face_type>& faces = patch_.localFaces(); const List<typename Patch::face_type>& faces = patch_.localFaces();
faceToPointWeightsPtr_ = new scalarListList(points.size()); faceToPointWeightsPtr_ = new scalarListList(points.size());
scalarListList& weights = *faceToPointWeightsPtr_; auto& weights = *faceToPointWeightsPtr_;
// get reference to addressing // get reference to addressing
const labelListList& pointFaces = patch_.pointFaces(); const labelListList& pointFaces = patch_.pointFaces();
@ -122,7 +122,7 @@ void PrimitivePatchInterpolation<Patch>::makeFaceToEdgeWeights() const
const labelListList& edgeFaces = patch_.edgeFaces(); const labelListList& edgeFaces = patch_.edgeFaces();
faceToEdgeWeightsPtr_ = new scalarList(patch_.nInternalEdges()); faceToEdgeWeightsPtr_ = new scalarList(patch_.nInternalEdges());
scalarList& weights = *faceToEdgeWeightsPtr_; auto& weights = *faceToEdgeWeightsPtr_;
forAll(weights, edgei) forAll(weights, edgei)
{ {
@ -301,12 +301,8 @@ tmp<Field<Type>> PrimitivePatchInterpolation<Patch>::faceToEdgeInterpolate
<< abort(FatalError); << abort(FatalError);
} }
tmp<Field<Type>> tresult auto tresult = tmp<Field<Type>>::New(patch_.nEdges(), Zero);
( auto& result = tresult.ref();
new Field<Type>(patch_.nEdges(), Zero)
);
Field<Type>& result = tresult.ref();
const edgeList& edges = patch_.edges(); const edgeList& edges = patch_.edges();
const labelListList& edgeFaces = patch_.edgeFaces(); const labelListList& edgeFaces = patch_.edgeFaces();

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -35,19 +36,14 @@ Description
#define primitivePatchInterpolation_H #define primitivePatchInterpolation_H
#include "PrimitivePatchInterpolation.H" #include "PrimitivePatchInterpolation.H"
#include "PrimitivePatch.H" #include "primitivePatch.H"
#include "face.H"
#include "SubList.H"
#include "pointField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef PrimitivePatchInterpolation typedef PrimitivePatchInterpolation<primitivePatch>
< primitivePatchInterpolation;
PrimitivePatch<face, SubList, const pointField&>
> primitivePatchInterpolation;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,7 +28,8 @@ Typedef
Foam::indirectPrimitivePatch Foam::indirectPrimitivePatch
Description Description
A PrimitivePatch using an IndirectList for the faces. A PrimitivePatch with an IndirectList for the faces, const reference
for the point field.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,7 +28,10 @@ Typedef
Foam::primitiveFacePatch Foam::primitiveFacePatch
Description Description
Foam::primitiveFacePatch A PrimitivePatch with List storage for the faces,
const reference for the point field.
Can be used to store faces.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,7 +28,10 @@ Typedef
Foam::primitivePatch Foam::primitivePatch
Description Description
Addressing for a faceList slice. A PrimitivePatch with a SubList addressing for the faces,
const reference for the point field.
Can be used as addressing for a faceList slice.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,7 +28,8 @@ Typedef
Foam::uindirectPrimitivePatch Foam::uindirectPrimitivePatch
Description Description
A PrimitivePatch using a UIndirectList for the faces. A PrimitivePatch with UIndirectList for the faces, const reference
for the point field.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -36,6 +36,7 @@ License
#include "triSurface.H" #include "triSurface.H"
#include "SortableList.H" #include "SortableList.H"
#include "OFstream.H" #include "OFstream.H"
#include "primitiveFacePatch.H"
#include "uindirectPrimitivePatch.H" #include "uindirectPrimitivePatch.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -538,11 +539,7 @@ void Foam::boundaryMesh::read(const polyMesh& mesh)
// //
// Temporary primitivePatch to calculate compact points & faces. // Temporary primitivePatch to calculate compact points & faces.
PrimitivePatch<face, List, const pointField&> globalPatch primitiveFacePatch globalPatch(bFaces, mesh.points());
(
bFaces,
mesh.points()
);
// Store in local(compact) addressing // Store in local(compact) addressing
clearOut(); clearOut();

View File

@ -50,7 +50,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes // Forward Declarations
class Time; class Time;
class polyMesh; class polyMesh;
class primitiveMesh; class primitiveMesh;
@ -61,7 +61,7 @@ class primitiveMesh;
class boundaryMesh class boundaryMesh
{ {
// Static data // Static Data
//- Normal along which to divide faces into categories //- Normal along which to divide faces into categories
// (used in getNearest) // (used in getNearest)
@ -73,7 +73,7 @@ class boundaryMesh
static const scalar distanceTol_; static const scalar distanceTol_;
// Private data // Private Data
//- All boundary mesh data. Reconstructed every time faces are repatched //- All boundary mesh data. Reconstructed every time faces are repatched
bMesh* meshPtr_; bMesh* meshPtr_;

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -29,20 +30,14 @@ License
#define AMIPatchToPatchInterpolation_H #define AMIPatchToPatchInterpolation_H
#include "AMIInterpolation.H" #include "AMIInterpolation.H"
#include "PrimitivePatch.H" #include "primitivePatch.H"
#include "face.H"
#include "SubList.H"
#include "pointField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef AMIInterpolation typedef AMIInterpolation<primitivePatch, primitivePatch>
< AMIPatchToPatchInterpolation;
PrimitivePatch<face, SubList, const pointField&>,
PrimitivePatch<face, SubList, const pointField&>
> AMIPatchToPatchInterpolation;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //