diff --git a/src/surfMesh/meshedSurf/meshedSurfRef.H b/src/surfMesh/meshedSurf/meshedSurfRef.H index f228a0c11c..f45e435f80 100644 --- a/src/surfMesh/meshedSurf/meshedSurfRef.H +++ b/src/surfMesh/meshedSurf/meshedSurfRef.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,6 +33,7 @@ Description #define meshedSurfRef_H #include "meshedSurf.H" +#include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,19 +48,11 @@ class meshedSurfRef : public meshedSurf { - const pointField& points_; - const faceList& faces_; - const labelList& zoneIds_; + std::reference_wrapper points_; + std::reference_wrapper faces_; + std::reference_wrapper zoneIds_; - // Private Member Functions - - //- No copy construct - meshedSurfRef(const meshedSurfRef&) = delete; - - //- No copy assignment - void operator=(const meshedSurfRef&) = delete; - public: // Constructors @@ -69,12 +62,12 @@ public: ( const pointField& pts, const faceList& faces, - const labelList& ids = labelList() + const labelList& ids = emptyLabelList ) : - points_(pts), - faces_(faces), - zoneIds_(ids) + points_(std::cref(pts)), + faces_(std::cref(faces)), + zoneIds_(std::cref(ids)) {} @@ -82,24 +75,24 @@ public: virtual ~meshedSurfRef() = default; - // Access Member Functions + // Member Functions //- Const access to (global) points used for the surface virtual const pointField& points() const { - return points_; + return points_.get(); } //- Const access to the surface faces virtual const faceList& faces() const { - return faces_; + return faces_.get(); } //- Const access to per-face zone/region information virtual const labelList& zoneIds() const { - return zoneIds_; + return zoneIds_.get(); } };