sampledSurface::writers:noSurfaceWriter: new rational and consistent class to disable surface writing

Selected by

    surfaceFormat none;

rather than the previous inconsistent

    surfaceFormat null;
This commit is contained in:
Henry Weller
2019-01-22 11:10:24 +00:00
parent 8baec3bc5d
commit 457c02e63f
15 changed files with 342 additions and 48 deletions

View File

@ -37,6 +37,7 @@ sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C
surfWriters = sampledSurface/writers
$(surfWriters)/surfaceWriter.C
$(surfWriters)/none/noSurfaceWriter.C
$(surfWriters)/ensight/ensightSurfaceWriter.C
$(surfWriters)/ensight/ensightPTraits.C
$(surfWriters)/foam/foamSurfaceWriter.C

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-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,13 +24,11 @@ License
\*---------------------------------------------------------------------------*/
#include "ensightSurfaceWriter.H"
#include "OFstream.H"
#include "OSspecific.H"
#include "IOmanip.H"
#include "ensightPartFaces.H"
#include "ensightPTraits.H"
#include "makeSurfaceWriterMethods.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

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-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,10 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "foamSurfaceWriter.H"
#include "OFstream.H"
#include "OSspecific.H"
#include "makeSurfaceWriterMethods.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "nastranSurfaceWriter.H"
#include "IOmanip.H"
#include "Tuple2.H"
#include "makeSurfaceWriterMethods.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -111,7 +109,7 @@ void Foam::nastranSurfaceWriter::writeCoord
os.unsetf(ios_base::left);
os.setf(ios_base::right);
os << setw(8) << pointi + 1
<< " "
<< " "
<< setw(8) << p.x()
<< setw(8) << p.y()
<< setw(8) << p.z()

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 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/>.
\*---------------------------------------------------------------------------*/
#include "noSurfaceWriter.H"
#include "makeSurfaceWriterMethods.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
makeSurfaceWriterType(noSurfaceWriter);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::noSurfaceWriter::noSurfaceWriter()
:
surfaceWriter()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::noSurfaceWriter::~noSurfaceWriter()
{}
// ************************************************************************* //

View File

@ -0,0 +1,168 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 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/>.
Class
Foam::noSurfaceWriter
Description
A dummy surfaceWriter selected to disable surface writing.
SourceFiles
noSurfaceWriter.C
\*---------------------------------------------------------------------------*/
#ifndef noSurfaceWriter_H
#define noSurfaceWriter_H
#include "surfaceWriter.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class noSurfaceWriter Declaration
\*---------------------------------------------------------------------------*/
class noSurfaceWriter
:
public surfaceWriter
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct null
noSurfaceWriter();
//- Destructor
virtual ~noSurfaceWriter();
// Member Functions
//- Write single surface geometry to file.
virtual void write
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const bool verbose = false
) const
{}
//- Write scalarField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

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-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,11 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "proxySurfaceWriter.H"
#include "MeshedSurfaceProxy.H"
#include "OFstream.H"
#include "OSspecific.H"
#include "makeSurfaceWriterMethods.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

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-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,6 +94,80 @@ public:
const bool verbose = false
) const;
//- Write scalarField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
};

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-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,11 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "rawSurfaceWriter.H"
#include "OFstream.H"
#include "OSspecific.H"
#include "IOmanip.H"
#include "makeSurfaceWriterMethods.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

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-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,11 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "starcdSurfaceWriter.H"
#include "MeshedSurfaceProxy.H"
#include "OFstream.H"
#include "OSspecific.H"
#include "makeSurfaceWriterMethods.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

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-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -167,6 +167,35 @@ public:
const bool verbose = false
) const;
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
virtual void write
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const word& fieldName, // name of field
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
};

View File

@ -24,12 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "surfaceWriter.H"
#include "MeshedSurfaceProxy.H"
#include "proxySurfaceWriter.H"
#include "HashTable.H"
#include "word.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

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-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -123,8 +123,7 @@ public:
const pointField& points,
const faceList& faces,
const bool verbose = false
) const
{}
) const = 0;
//- Write scalarField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -138,8 +137,7 @@ public:
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
) const = 0;
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -153,8 +151,7 @@ public:
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
) const = 0;
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -168,8 +165,7 @@ public:
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
) const = 0;
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -183,8 +179,7 @@ public:
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
) const = 0;
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -198,8 +193,7 @@ public:
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const
{}
) const = 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-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,10 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "vtkSurfaceWriter.H"
#include "OFstream.H"
#include "OSspecific.H"
#include "makeSurfaceWriterMethods.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -19,7 +19,7 @@ inletMassFlowRate
writeFields false;
log true;
surfaceFormat null;
surfaceFormat none;
regionType patch;
name inlet;
@ -42,7 +42,7 @@ outletMassFlowRate
writeFields false;
log true;
surfaceFormat null;
surfaceFormat none;
regionType patch;
name outlet;