mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: additional constructors and methods for meshedSurfRef
- construct null, clear() and reset() methods
This commit is contained in:
committed by
Andrew Heather
parent
e322894476
commit
0ca95ac0cf
@ -50,24 +50,33 @@ class meshedSurfRef
|
|||||||
{
|
{
|
||||||
std::reference_wrapper<const pointField> points_;
|
std::reference_wrapper<const pointField> points_;
|
||||||
std::reference_wrapper<const faceList> faces_;
|
std::reference_wrapper<const faceList> faces_;
|
||||||
std::reference_wrapper<const labelList> zoneIds_;
|
std::reference_wrapper<const labelList> ids_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
meshedSurfRef()
|
||||||
|
:
|
||||||
|
points_(std::cref<pointField>(pointField::null())),
|
||||||
|
faces_(std::cref<faceList>(faceList::null())),
|
||||||
|
ids_(std::cref<labelList>(labelList::null()))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
meshedSurfRef
|
meshedSurfRef
|
||||||
(
|
(
|
||||||
const pointField& pts,
|
const pointField& pts,
|
||||||
const faceList& faces,
|
const faceList& fcs,
|
||||||
const labelList& ids = labelList::null()
|
const labelList& ids = labelList::null()
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
points_(std::cref<pointField>(pts)),
|
points_(std::cref<pointField>(pts)),
|
||||||
faces_(std::cref<faceList>(faces)),
|
faces_(std::cref<faceList>(fcs)),
|
||||||
zoneIds_(std::cref<labelList>(ids))
|
ids_(std::cref<labelList>(ids))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -92,11 +101,32 @@ public:
|
|||||||
//- Per-face zone/region information.
|
//- Per-face zone/region information.
|
||||||
virtual const labelList& zoneIds() const
|
virtual const labelList& zoneIds() const
|
||||||
{
|
{
|
||||||
return zoneIds_.get();
|
return ids_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Remove all references by redirecting to null objects
|
||||||
|
void clear()
|
||||||
|
{
|
||||||
|
points_ = std::cref<pointField>(pointField::null());
|
||||||
|
faces_ = std::cref<faceList>(faceList::null());
|
||||||
|
ids_ = std::cref<labelList>(labelList::null());
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Reset components
|
||||||
|
void reset
|
||||||
|
(
|
||||||
|
const pointField& pts,
|
||||||
|
const faceList& fcs,
|
||||||
|
const labelList& ids = labelList::null()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
points_ = std::cref<pointField>(pts);
|
||||||
|
faces_ = std::cref<faceList>(fcs);
|
||||||
|
ids_ = std::cref<labelList>(ids);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
Reference in New Issue
Block a user