sampledSurfaces: Put inside functionObjects namespace

This commit is contained in:
Will Bainbridge
2020-07-24 12:50:18 +01:00
parent dee1e4f4c2
commit 1a7f10a986
5 changed files with 40 additions and 82 deletions

View File

@ -1,49 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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/>.
Typedef
Foam::IOsampledSurfaces
Description
Instance of the generic IOOutputFilter for sampledSurfaces.
\*---------------------------------------------------------------------------*/
#ifndef IOsampledSurfaces_H
#define IOsampledSurfaces_H
#include "sampledSurfaces.H"
#include "IOOutputFilter.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOOutputFilter<sampledSurfaces> IOsampledSurfaces;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -31,6 +31,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
defineTypeNameAndDebug(sampledSurfaces, 0);
@ -41,14 +43,15 @@ namespace Foam
dictionary
);
}
}
bool Foam::sampledSurfaces::verbose_ = false;
Foam::scalar Foam::sampledSurfaces::mergeTol_ = 1e-10;
bool Foam::functionObjects::sampledSurfaces::verbose_ = false;
Foam::scalar Foam::functionObjects::sampledSurfaces::mergeTol_ = 1e-10;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::sampledSurfaces::writeGeometry() const
void Foam::functionObjects::sampledSurfaces::writeGeometry() const
{
// Write to time directory under outputPath_
// Skip surface without faces (eg, a failed cut-plane)
@ -88,7 +91,7 @@ void Foam::sampledSurfaces::writeGeometry() const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::sampledSurfaces::sampledSurfaces
Foam::functionObjects::sampledSurfaces::sampledSurfaces
(
const word& name,
const Time& t,
@ -129,7 +132,7 @@ Foam::sampledSurfaces::sampledSurfaces
}
Foam::sampledSurfaces::sampledSurfaces
Foam::functionObjects::sampledSurfaces::sampledSurfaces
(
const word& name,
const objectRegistry& obr,
@ -164,25 +167,25 @@ Foam::sampledSurfaces::sampledSurfaces
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::sampledSurfaces::~sampledSurfaces()
Foam::functionObjects::sampledSurfaces::~sampledSurfaces()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::sampledSurfaces::verbose(const bool verbosity)
void Foam::functionObjects::sampledSurfaces::verbose(const bool verbosity)
{
verbose_ = verbosity;
}
bool Foam::sampledSurfaces::execute()
bool Foam::functionObjects::sampledSurfaces::execute()
{
return true;
}
bool Foam::sampledSurfaces::write()
bool Foam::functionObjects::sampledSurfaces::write()
{
if (size())
{
@ -229,7 +232,7 @@ bool Foam::sampledSurfaces::write()
}
bool Foam::sampledSurfaces::read(const dictionary& dict)
bool Foam::functionObjects::sampledSurfaces::read(const dictionary& dict)
{
bool surfacesFound = dict.found("surfaces");
@ -285,7 +288,7 @@ bool Foam::sampledSurfaces::read(const dictionary& dict)
}
void Foam::sampledSurfaces::updateMesh(const mapPolyMesh& mpm)
void Foam::functionObjects::sampledSurfaces::updateMesh(const mapPolyMesh& mpm)
{
if (&mpm.mesh() == &mesh_)
{
@ -296,7 +299,7 @@ void Foam::sampledSurfaces::updateMesh(const mapPolyMesh& mpm)
}
void Foam::sampledSurfaces::movePoints(const polyMesh& mesh)
void Foam::functionObjects::sampledSurfaces::movePoints(const polyMesh& mesh)
{
if (&mesh == &mesh_)
{
@ -305,7 +308,10 @@ void Foam::sampledSurfaces::movePoints(const polyMesh& mesh)
}
void Foam::sampledSurfaces::readUpdate(const polyMesh::readUpdateState state)
void Foam::functionObjects::sampledSurfaces::readUpdate
(
const polyMesh::readUpdateState state
)
{
if (state != polyMesh::UNCHANGED)
{
@ -314,7 +320,7 @@ void Foam::sampledSurfaces::readUpdate(const polyMesh::readUpdateState state)
}
bool Foam::sampledSurfaces::needsUpdate() const
bool Foam::functionObjects::sampledSurfaces::needsUpdate() const
{
forAll(*this, surfI)
{
@ -328,7 +334,7 @@ bool Foam::sampledSurfaces::needsUpdate() const
}
bool Foam::sampledSurfaces::expire()
bool Foam::functionObjects::sampledSurfaces::expire()
{
bool justExpired = false;
@ -351,7 +357,7 @@ bool Foam::sampledSurfaces::expire()
}
bool Foam::sampledSurfaces::update()
bool Foam::functionObjects::sampledSurfaces::update()
{
bool updated = false;

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::sampledSurfaces
Foam::functionObjects::sampledSurfaces
Description
Set of surfaces to sample
@ -65,21 +65,15 @@ Usage
\endtable
See also
Foam::sampledSurfaces::distanceSurface
Foam::sampledSurfaces::isoSurface
Foam::sampledSurfaces::cuttingPlane
Foam::sampledSurfaces::patch
Foam::sampledSurfaces::plane
Foam::sampledSurfaces::triSurfaceMesh
Foam::sampledSurfaces::thresholdCellFaces
Foam::sampledSurfaces
SourceFiles
sampledSurfaces.C
\*---------------------------------------------------------------------------*/
#ifndef sampledSurfaces_H
#define sampledSurfaces_H
#ifndef functionObjects_sampledSurfaces_H
#define functionObjects_sampledSurfaces_H
#include "functionObject.H"
#include "sampledSurface.H"
@ -99,6 +93,9 @@ class Time;
class fvMesh;
class dictionary;
namespace functionObjects
{
/*---------------------------------------------------------------------------*\
Class sampledSurfaces Declaration
\*---------------------------------------------------------------------------*/
@ -286,6 +283,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,7 +27,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::label Foam::sampledSurfaces::classifyFields()
Foam::label Foam::functionObjects::sampledSurfaces::classifyFields()
{
label nFields = 0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,7 +32,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::sampledSurfaces::writeSurface
void Foam::functionObjects::sampledSurfaces::writeSurface
(
const Field<Type>& values,
const label surfI,
@ -107,7 +107,7 @@ void Foam::sampledSurfaces::writeSurface
template<class Type>
void Foam::sampledSurfaces::sampleAndWrite
void Foam::functionObjects::sampledSurfaces::sampleAndWrite
(
const GeometricField<Type, fvPatchField, volMesh>& vField
)
@ -148,7 +148,7 @@ void Foam::sampledSurfaces::sampleAndWrite
template<class Type>
void Foam::sampledSurfaces::sampleAndWrite
void Foam::functionObjects::sampledSurfaces::sampleAndWrite
(
const GeometricField<Type, fvsPatchField, surfaceMesh>& sField
)
@ -166,7 +166,10 @@ void Foam::sampledSurfaces::sampleAndWrite
template<class GeoField>
void Foam::sampledSurfaces::sampleAndWrite(const IOobjectList& objects)
void Foam::functionObjects::sampledSurfaces::sampleAndWrite
(
const IOobjectList& objects
)
{
wordList names;
if (loadFromFiles_)