STYLE: update PrimitivePatch (#1648)

- simplified templating, which cleans up code and does not appear to
  break any normal user coding.

ENH: unique_ptr instead of homegrown demand-driven handling.
This commit is contained in:
Mark Olesen
2020-04-30 12:46:00 +02:00
parent 5c9f07df7a
commit 8a5d108fd2
44 changed files with 553 additions and 1118 deletions

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -53,7 +54,7 @@ class extrudedMesh
:
public polyMesh
{
// Private data
// Private Data
const extrudeModel& model_;
@ -64,26 +65,26 @@ class extrudedMesh
static bool sameOrder(const face&, const edge&);
//- Construct and return the extruded mesh points
template<class Face, template<class> class FaceList, class PointField>
template<class FaceList, class PointField>
pointField extrudedPoints
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const PrimitivePatch<FaceList, PointField>& extrudePatch,
const extrudeModel&
);
//- Construct and return the extruded mesh faces
template<class Face, template<class> class FaceList, class PointField>
template<class FaceList, class PointField>
faceList extrudedFaces
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const PrimitivePatch<FaceList, PointField>& extrudePatch,
const extrudeModel&
);
//- Construct and return the extruded mesh cells
template<class Face, template<class> class FaceList, class PointField>
template<class FaceList, class PointField>
cellList extrudedCells
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const PrimitivePatch<FaceList, PointField>& extrudePatch,
const extrudeModel&
);
@ -100,11 +101,11 @@ public:
// Constructors
//- Construct from the primitivePatch to extrude
template<class Face, template<class> class FaceList, class PointField>
template<class FaceList, class PointField>
extrudedMesh
(
const IOobject&,
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const PrimitivePatch<FaceList, PointField>& extrudePatch,
const extrudeModel&
);
};

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,15 +31,10 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template
<
class Face,
template<class> class FaceList,
class PointField
>
template<class FaceList, class PointField>
Foam::pointField Foam::extrudedMesh::extrudedPoints
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const PrimitivePatch<FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
{
@ -68,10 +64,10 @@ Foam::pointField Foam::extrudedMesh::extrudedPoints
}
template<class Face, template<class> class FaceList, class PointField>
template<class FaceList, class PointField>
Foam::faceList Foam::extrudedMesh::extrudedFaces
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const PrimitivePatch<FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
{
@ -194,10 +190,10 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
}
template<class Face, template<class> class FaceList, class PointField>
template<class FaceList, class PointField>
Foam::cellList Foam::extrudedMesh::extrudedCells
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const PrimitivePatch<FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
{
@ -302,16 +298,11 @@ Foam::cellList Foam::extrudedMesh::extrudedCells
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
<
class Face,
template<class> class FaceList,
class PointField
>
template<class FaceList, class PointField>
Foam::extrudedMesh::extrudedMesh
(
const IOobject& io,
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const PrimitivePatch<FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
:

View File

@ -81,7 +81,7 @@ SourceFiles
namespace Foam
{
typedef PrimitivePatch<face, List, const pointField, point> bPatch;
typedef PrimitivePatch<::Foam::List<face>, const pointField> bPatch;
typedef treeDataPrimitivePatch<bPatch> treeDataBPatch;
class Time;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2016 OpenCFD Ltd.
Copyright (C) 2016-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -199,7 +199,7 @@ Foam::tmp<Foam::triSurfacePointScalarField> Foam::automatic::load()
PrimitivePatchInterpolation
<
PrimitivePatch<labelledTri, ::Foam::List, pointField, point>
PrimitivePatch<::Foam::List<labelledTri>, pointField>
> patchInterpolate(surface_);
const Map<label>& meshPointMap = surface_.meshPointMap();

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -61,11 +61,11 @@ class nonUniformField
protected:
// Private typedef
// Typedefs
typedef PrimitivePatchInterpolation
<
PrimitivePatch<labelledTri, List, pointField, point>
PrimitivePatch<::Foam::List<labelledTri>, pointField>
> primitivePatchInterpolation;