Newer
Older
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Foam::Detail::MeshedSurfaceIOAllocator
A helper class for storing points and faces with IO capabilities.
SourceFiles
MeshedSurfaceIOAllocator.C
\*---------------------------------------------------------------------------*/
#ifndef MeshedSurfaceIOAllocator_H
#define MeshedSurfaceIOAllocator_H
#include "pointIOField.H"
#include "faceIOList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace Detail
{
/*---------------------------------------------------------------------------*\
Class Detail::MeshedSurfaceIOAllocator Declaration
\*---------------------------------------------------------------------------*/
class MeshedSurfaceIOAllocator
{
faceCompactIOList faces_;
//- No copy construct
Mark Olesen
committed
MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator&) = delete;
//- No copy assignment
Mark Olesen
committed
void operator=(const MeshedSurfaceIOAllocator&) = delete;
public:
// Constructors
//- Read construct from IOobjects
MeshedSurfaceIOAllocator
(
const IOobject& ioPoints,
const IOobject& ioFaces
);
//- Construct from IOobjects, copying components
MeshedSurfaceIOAllocator
(
const IOobject& ioPoints, const pointField& points,
const IOobject& ioFaces, const faceList& faces
//- Construct from IOobjects, moving components
const IOobject& ioPoints, pointField&& points,
const IOobject& ioFaces, faceList&& faces
//- Destructor
virtual ~MeshedSurfaceIOAllocator();
// Database
//- Set the instance for mesh files
void setInstance(const fileName& inst);
//- Adjust the write option for all components
void setWriteOption(IOobject::writeOption wOpt);
//- Non-const access to the points
pointIOField& storedIOPoints()
{
return points_;
}
//- Non-const access to the faces
faceCompactIOList& storedIOFaces()
{
return faces_;
}
//- Const access to the points
const pointIOField& storedIOPoints() const
{
return points_;
}
//- Const access to the faces
const faceCompactIOList& storedIOFaces() const
{
return faces_;
}
// Storage Management
//- Clear primitive data (points, faces)
// Writing
//- Write using stream options
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Detail
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //