From 08588134fbb4bdfa72e0e5b9dd6eaf56cf83484c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 29 Oct 2021 19:11:18 +0200 Subject: [PATCH] ENH: report filter settings for distance surface (#1631) --- .../surfaceFieldValue/surfaceFieldValue.C | 7 ++++++ .../distanceSurface/sampledDistanceSurface.C | 6 ++--- .../distanceSurface/sampledDistanceSurface.H | 2 +- .../isoSurface/sampledIsoSurface.C | 9 ++++--- .../isoSurface/sampledIsoSurface.H | 4 +-- .../sampledCuttingPlane/sampledCuttingPlane.C | 18 +++++++------ .../sampledCuttingPlane/sampledCuttingPlane.H | 4 +-- .../sampledCuttingSurface.C | 4 +-- .../sampledCuttingSurface.H | 7 ------ .../sampledFaceZone/sampledFaceZone.C | 14 +++++++---- .../sampledFaceZone/sampledFaceZone.H | 4 +-- .../sampledMeshedSurface.C | 14 +++++++---- .../sampledMeshedSurface.H | 6 ++--- .../sampledPatch/sampledPatch.C | 16 +++++++----- .../sampledPatch/sampledPatch.H | 6 ++--- .../sampledPatchInternalField.C | 14 +++++++---- .../sampledPatchInternalField.H | 4 +-- .../sampledPlane/sampledPlane.C | 16 +++++++----- .../sampledPlane/sampledPlane.H | 4 +-- .../sampledSurface/sampledSurface.C | 6 ++--- .../sampledSurface/sampledSurface.H | 25 ++++++++++--------- .../sampledSurfaces/sampledSurfaces.C | 5 +++- .../sampledThresholdCellFaces.C | 19 ++++++++------ .../sampledThresholdCellFaces.H | 4 +-- src/sampling/surface/cutting/cuttingSurface.C | 13 ++++++---- src/sampling/surface/cutting/cuttingSurface.H | 5 ++-- .../surface/distanceSurface/distanceSurface.C | 19 +++++++++----- .../surface/distanceSurface/distanceSurface.H | 2 +- .../surface/isoSurface/isoSurfaceParams.C | 8 ++++++ .../surface/isoSurface/isoSurfaceParams.H | 7 ++++++ .../sampledInterface/sampledInterface.C | 2 +- .../sampledInterface/sampledInterface.H | 4 +-- 32 files changed, 168 insertions(+), 110 deletions(-) diff --git a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C index 23fd4e1806..3400e1b66b 100644 --- a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C +++ b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C @@ -1095,6 +1095,13 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read } } + if (stSampled == regionType_ && sampledPtr_) + { + Info<< " sampled surface: "; + sampledPtr_->print(Info, 0); + Info<< nl; + } + if (writeFields_) { const word formatName(dict.get("surfaceFormat")); diff --git a/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.C b/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.C index c7656ae6a6..3d9e7a597b 100644 --- a/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.C +++ b/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -203,10 +203,10 @@ Foam::tmp Foam::sampledDistanceSurface::interpolate } -void Foam::sampledDistanceSurface::print(Ostream& os) const +void Foam::sampledDistanceSurface::print(Ostream& os, int level) const { os << "distanceSurface: " << name() << " :"; - distanceSurface::print(os); + distanceSurface::print(os, level); } diff --git a/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.H b/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.H index 8a365e9ae8..5477ad3595 100644 --- a/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.H +++ b/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.H @@ -265,7 +265,7 @@ public: // Output //- Print information - virtual void print(Ostream& os) const; + virtual void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C index 2764242d5b..8b92f7a6e2 100644 --- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C +++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C @@ -854,11 +854,12 @@ Foam::sampledIsoSurface::interpolate } -void Foam::sampledIsoSurface::print(Ostream& os) const +void Foam::sampledIsoSurface::print(Ostream& os, int level) const { - os << "isoSurfacePoint: " << name() << " :" - << " field :" << isoField_ - << " value :" << flatOutput(isoValues_); + os << "isoSurface: " << name() << " :"; + isoParams_.print(os); + os << " field:" << isoField_ + << " value:" << flatOutput(isoValues_); } diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H index d31aac7ac2..c68468bfff 100644 --- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H +++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H @@ -385,8 +385,8 @@ public: // Output - //- Write - virtual void print(Ostream& os) const; + //- Print information + virtual void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C index b3d0982fe2..fe4765d050 100644 --- a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C +++ b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -496,7 +496,7 @@ void Foam::sampledCuttingPlane::createGeometry() if (debug) { - print(Pout); + print(Pout, debug); Pout<< endl; } } @@ -746,13 +746,17 @@ Foam::sampledCuttingPlane::interpolate } -void Foam::sampledCuttingPlane::print(Ostream& os) const +void Foam::sampledCuttingPlane::print(Ostream& os, int level) const { os << "sampledCuttingPlane: " << name() << " :" - << " plane:" << plane_ - << " offsets:" << flatOutput(offsets_) - << " faces:" << faces().size() - << " points:" << points().size(); + << " plane:" << plane_ + << " offsets:" << flatOutput(offsets_); + + if (level) + { + os << " faces:" << faces().size() + << " points:" << points().size(); + } } diff --git a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H index c35d5a7472..2705ba850e 100644 --- a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H +++ b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -365,7 +365,7 @@ public: // Output //- Print information - virtual void print(Ostream& os) const; + virtual void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/sampledSurface/sampledCuttingSurface/sampledCuttingSurface.C b/src/sampling/sampledSurface/sampledCuttingSurface/sampledCuttingSurface.C index 35ad3b9935..14b5151da1 100644 --- a/src/sampling/sampledSurface/sampledCuttingSurface/sampledCuttingSurface.C +++ b/src/sampling/sampledSurface/sampledCuttingSurface/sampledCuttingSurface.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -142,7 +142,7 @@ bool Foam::sampledCuttingSurface::update() if (debug) { - cuttingSurface::print(Pout); + cuttingSurface::print(Pout, debug); Pout<< endl; } diff --git a/src/sampling/sampledSurface/sampledCuttingSurface/sampledCuttingSurface.H b/src/sampling/sampledSurface/sampledCuttingSurface/sampledCuttingSurface.H index 9c97df15ca..20776dfb94 100644 --- a/src/sampling/sampledSurface/sampledCuttingSurface/sampledCuttingSurface.H +++ b/src/sampling/sampledSurface/sampledCuttingSurface/sampledCuttingSurface.H @@ -261,13 +261,6 @@ public: ( const interpolation& interpolator ) const; - - - // Output - -// //- Print information -// void print(Ostream& os) const; - }; diff --git a/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.C b/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.C index 7b5cf52b49..19e5a6914c 100644 --- a/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.C +++ b/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -390,12 +390,16 @@ Foam::tmp Foam::sampledFaceZone::interpolate } -void Foam::sampledFaceZone::print(Ostream& os) const +void Foam::sampledFaceZone::print(Ostream& os, int level) const { os << "faceZone: " << name() << " :" - << " zones: " << flatOutput(selectionNames_) - << " faces:" << faces().size() - << " points:" << points().size(); + << " zones:" << flatOutput(selectionNames_); + + if (level) + { + os << " faces:" << faces().size() + << " points:" << points().size(); + } } diff --git a/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.H b/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.H index 1354084c8f..7daa45c2dc 100644 --- a/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.H +++ b/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -322,7 +322,7 @@ public: // Output //- Print information - virtual void print(Ostream& os) const; + virtual void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/sampledSurface/sampledMeshedSurface/sampledMeshedSurface.C b/src/sampling/sampledSurface/sampledMeshedSurface/sampledMeshedSurface.C index 001532061e..a8d6379a0c 100644 --- a/src/sampling/sampledSurface/sampledMeshedSurface/sampledMeshedSurface.C +++ b/src/sampling/sampledSurface/sampledMeshedSurface/sampledMeshedSurface.C @@ -772,13 +772,17 @@ Foam::tmp Foam::sampledMeshedSurface::interpolate } -void Foam::sampledMeshedSurface::print(Ostream& os) const +void Foam::sampledMeshedSurface::print(Ostream& os, int level) const { os << "meshedSurface: " << name() << " :" - << " surface:" << surfaceName_ - << " faces:" << faces().size() - << " points:" << points().size() - << " zoneids:" << zoneIds().size(); + << " surface:" << surfaceName_; + + if (level) + { + os << " faces:" << faces().size() + << " points:" << points().size() + << " zoneids:" << zoneIds().size(); + } } diff --git a/src/sampling/sampledSurface/sampledMeshedSurface/sampledMeshedSurface.H b/src/sampling/sampledSurface/sampledMeshedSurface/sampledMeshedSurface.H index 5b61d0ef18..fc62e9ed74 100644 --- a/src/sampling/sampledSurface/sampledMeshedSurface/sampledMeshedSurface.H +++ b/src/sampling/sampledSurface/sampledMeshedSurface/sampledMeshedSurface.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -380,8 +380,8 @@ public: // Output - //- Write - virtual void print(Ostream& os) const; + //- Print information + virtual void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/sampledSurface/sampledPatch/sampledPatch.C b/src/sampling/sampledSurface/sampledPatch/sampledPatch.C index 360000f6c4..5a175ce469 100644 --- a/src/sampling/sampledSurface/sampledPatch/sampledPatch.C +++ b/src/sampling/sampledSurface/sampledPatch/sampledPatch.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -233,7 +233,7 @@ bool Foam::sampledPatch::update() if (debug) { - print(Pout); + print(Pout, debug); Pout<< endl; } @@ -414,12 +414,16 @@ Foam::tmp Foam::sampledPatch::interpolate } -void Foam::sampledPatch::print(Ostream& os) const +void Foam::sampledPatch::print(Ostream& os, int level) const { os << "sampledPatch: " << name() << " :" - << " patches: " << flatOutput(selectionNames_) - << " faces:" << faces().size() - << " points:" << points().size(); + << " patches:" << flatOutput(selectionNames_); + + if (level) + { + os << " faces:" << faces().size() + << " points:" << points().size(); + } } diff --git a/src/sampling/sampledSurface/sampledPatch/sampledPatch.H b/src/sampling/sampledSurface/sampledPatch/sampledPatch.H index 2e6cd48680..7627441a6f 100644 --- a/src/sampling/sampledSurface/sampledPatch/sampledPatch.H +++ b/src/sampling/sampledSurface/sampledPatch/sampledPatch.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -349,8 +349,8 @@ public: // Output - //- Write - virtual void print(Ostream&) const; + //- Print information + virtual void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C index c3f6893f7a..00e525d4f6 100644 --- a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C +++ b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2013 OpenFOAM Foundation - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -228,12 +228,16 @@ Foam::tmp Foam::sampledPatchInternalField::interpolate } -void Foam::sampledPatchInternalField::print(Ostream& os) const +void Foam::sampledPatchInternalField::print(Ostream& os, int level) const { os << "sampledPatchInternalField: " << name() << " :" - << " patches:" << patchNames() - << " faces:" << faces().size() - << " points:" << points().size(); + << " patches:" << patchNames(); + + if (level) + { + os << " faces:" << faces().size() + << " points:" << points().size(); + } } diff --git a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.H b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.H index 884efce23b..d2728becf1 100644 --- a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.H +++ b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -202,7 +202,7 @@ public: // Output //- Print information - virtual void print(Ostream& os) const; + virtual void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C index 94a36ec6ce..cfd6e99a1b 100644 --- a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C +++ b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -203,7 +203,7 @@ bool Foam::sampledPlane::update() if (debug) { - print(Pout); + print(Pout, debug); Pout<< endl; } @@ -301,14 +301,18 @@ Foam::tmp Foam::sampledPlane::interpolate } -void Foam::sampledPlane::print(Ostream& os) const +void Foam::sampledPlane::print(Ostream& os, int level) const { os << "sampledPlane: " << name() << " :" << " origin:" << plane::origin() << " normal:" << plane::normal() - << " triangulate:" << triangulate_ - << " faces:" << faces().size() - << " points:" << points().size(); + << " triangulate:" << triangulate_; + + if (level) + { + os << " faces:" << faces().size() + << " points:" << points().size(); + } } diff --git a/src/sampling/sampledSurface/sampledPlane/sampledPlane.H b/src/sampling/sampledSurface/sampledPlane/sampledPlane.H index ee3ce97240..3c3f125187 100644 --- a/src/sampling/sampledSurface/sampledPlane/sampledPlane.H +++ b/src/sampling/sampledSurface/sampledPlane/sampledPlane.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -291,7 +291,7 @@ public: // Output //- Print information - virtual void print(Ostream& os) const; + virtual void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C index 985d99d738..333a8a8e56 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C @@ -49,7 +49,6 @@ const Foam::wordList Foam::sampledSurface::surfaceFieldTypes }); - // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::sampledSurface::clearGeom() const @@ -219,7 +218,7 @@ Foam::tmp Foam::sampledSurface::sample } -void Foam::sampledSurface::print(Ostream& os) const +void Foam::sampledSurface::print(Ostream& os, int level) const { os << type(); } @@ -229,7 +228,8 @@ void Foam::sampledSurface::print(Ostream& os) const Foam::Ostream& Foam::operator<<(Ostream& os, const sampledSurface& s) { - s.print(os); + // Print with more information + s.print(os, 1); os.check(FUNCTION_NAME); return os; } diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H index 381d52d1e7..e9d8bba81d 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H @@ -54,15 +54,16 @@ Description Property | Description | Required | Default name | Alternative name | no | enabled | Enable/disable the surface? | no | yes - interpolate | Sample to nodes instead of faces | no | false + interpolate | Interpolate to nodes instead of faces | no | false invariant | Invariant with geometry change (use with caution!) | no | false \endtable Note - The invariant switch is an advanced feature to declare that the surface is - unaffected by changes in the general mesh geometry. For example, if sampling - on a static patch while some other motion occurs elsewhere. If used improperly, - there is a significant possibility for problems (caveat emptor). + The invariant switch is an advanced feature to declare that the surface + is unaffected by changes in the general mesh geometry. For example, if + sampling on a static patch while some other motion occurs elsewhere. If + used improperly, there is a significant possibility for problems + (caveat emptor). SourceFiles sampledSurface.C @@ -288,31 +289,31 @@ public: // Access //- Access to the underlying mesh - const polyMesh& mesh() const + const polyMesh& mesh() const noexcept { return mesh_; } //- Name of surface - const word& name() const + const word& name() const noexcept { return name_; } //- Surface is enabled - bool enabled() const + bool enabled() const noexcept { return enabled_; } //- Surface is invariant with geometry change (caution) - bool invariant() const + bool invariant() const noexcept { return invariant_; } //- Using interpolation to surface points - bool isPointData() const + bool isPointData() const noexcept { return isPointData_; } @@ -564,13 +565,13 @@ public: // Write //- Print information - virtual void print(Ostream& os) const; + virtual void print(Ostream& os, int level=0) const; // Housekeeping //- Same as isPointData() - bool interpolate() const { return isPointData_; } + bool interpolate() const noexcept { return isPointData_; } }; diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C index 938bbf3cf1..385b10e5b3 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C @@ -470,9 +470,12 @@ bool Foam::sampledSurfaces::read(const dictionary& dict) } if (actions_[surfi] & ACTION_SURF_MESH) { - Info<< ", store as surfMesh (deprecated)"; + Info<< ", store as surfMesh (DEPRECATED)"; } Info<< nl; + Info<< " "; + s.print(Info, 0); + Info<< nl; } Info<< nl; } diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C index bf728543aa..b1d6fe1e7f 100644 --- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C +++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -286,14 +286,19 @@ Foam::tmp Foam::sampledThresholdCellFaces::interpolate } -void Foam::sampledThresholdCellFaces::print(Ostream& os) const +void Foam::sampledThresholdCellFaces::print(Ostream& os, int level) const { os << "sampledThresholdCellFaces: " << name() << " :" - << " field:" << fieldName_ - << " lowerLimit:" << lowerThreshold_ - << " upperLimit:" << upperThreshold_; - //<< " faces:" << faces().size() // possibly no geom yet - //<< " points:" << points().size(); + << " field:" << fieldName_ + << " lowerLimit:" << lowerThreshold_ + << " upperLimit:" << upperThreshold_; + + // Possibly no geom yet... + // if (level) + // { + // os << " faces:" << faces().size() + // << " points:" << points().size(); + // } } diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H index c4c105709a..e0b67e807e 100644 --- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H +++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -278,7 +278,7 @@ public: // Output //- Print information - virtual void print(Ostream& os) const; + virtual void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/surface/cutting/cuttingSurface.C b/src/sampling/surface/cutting/cuttingSurface.C index 936b5654f4..9d26aa93d6 100644 --- a/src/sampling/surface/cutting/cuttingSurface.C +++ b/src/sampling/surface/cutting/cuttingSurface.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -167,11 +167,14 @@ void Foam::cuttingSurface::performCut } -void Foam::cuttingSurface::print(Ostream& os) const +void Foam::cuttingSurface::print(Ostream& os, int level) const { - os << " surface:" << surfaceName() - << " faces:" << Mesh::surfFaces().size() - << " points:" << Mesh::points().size(); + os << " surface:" << surfaceName(); + if (level) + { + os << " faces:" << Mesh::surfFaces().size() + << " points:" << Mesh::points().size(); + } } diff --git a/src/sampling/surface/cutting/cuttingSurface.H b/src/sampling/surface/cutting/cuttingSurface.H index b987f56c69..b3d2de4caf 100644 --- a/src/sampling/surface/cutting/cuttingSurface.H +++ b/src/sampling/surface/cutting/cuttingSurface.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -133,8 +133,7 @@ public: // Output //- Print information - void print(Ostream& os) const; - + void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/surface/distanceSurface/distanceSurface.C b/src/sampling/surface/distanceSurface/distanceSurface.C index e2baa1b14c..3d0f1f4d9b 100644 --- a/src/sampling/surface/distanceSurface/distanceSurface.C +++ b/src/sampling/surface/distanceSurface/distanceSurface.C @@ -734,18 +734,25 @@ void Foam::distanceSurface::createGeometry() if (debug) { - print(Pout); + print(Pout, debug); Pout<< endl; } } -void Foam::distanceSurface::print(Ostream& os) const +void Foam::distanceSurface::print(Ostream& os, int level) const { - os << " surface:" << surfaceName() - << " distance:" << distance() - << " faces:" << surface().surfFaces().size() - << " points:" << surface().points().size(); + os << " surface:" << surfaceName() + << " distance:" << distance() + << " topology:" << topoFilterNames_[topoFilter_]; + + isoParams_.print(os); + + if (level) + { + os << " faces:" << surface().surfFaces().size() + << " points:" << surface().points().size(); + } } diff --git a/src/sampling/surface/distanceSurface/distanceSurface.H b/src/sampling/surface/distanceSurface/distanceSurface.H index 8563020331..184b24d8c3 100644 --- a/src/sampling/surface/distanceSurface/distanceSurface.H +++ b/src/sampling/surface/distanceSurface/distanceSurface.H @@ -392,7 +392,7 @@ public: // Output //- Print information - void print(Ostream& os) const; + void print(Ostream& os, int level=0) const; }; diff --git a/src/sampling/surface/isoSurface/isoSurfaceParams.C b/src/sampling/surface/isoSurface/isoSurfaceParams.C index 60b003dcb4..4a79d01c82 100644 --- a/src/sampling/surface/isoSurface/isoSurfaceParams.C +++ b/src/sampling/surface/isoSurface/isoSurfaceParams.C @@ -180,4 +180,12 @@ void Foam::isoSurfaceParams::setClipBounds(const boundBox& bb) } +void Foam::isoSurfaceParams::print(Ostream& os) const +{ + os << " isoMethod:" << algorithmNames[algo_] + << " regularise:" << filterNames[filter_] + << " snap:" << snap_; +} + + // ************************************************************************* // diff --git a/src/sampling/surface/isoSurface/isoSurfaceParams.H b/src/sampling/surface/isoSurface/isoSurfaceParams.H index d73da00c27..df16e68a07 100644 --- a/src/sampling/surface/isoSurface/isoSurfaceParams.H +++ b/src/sampling/surface/isoSurface/isoSurfaceParams.H @@ -69,6 +69,7 @@ namespace Foam // Forward Declarations class dictionary; +class Ostream; /*---------------------------------------------------------------------------*\ Class isoSurfaceSelector Declaration @@ -241,6 +242,12 @@ public: //- Set optional clipping bounding box void setClipBounds(const boundBox& bb); + + + // Information + + //- Print information about the settings + void print(Ostream& os) const; }; diff --git a/src/transportModels/geometricVoF/sampledInterface/sampledInterface.C b/src/transportModels/geometricVoF/sampledInterface/sampledInterface.C index 25b410f7d5..6b6edc0eda 100644 --- a/src/transportModels/geometricVoF/sampledInterface/sampledInterface.C +++ b/src/transportModels/geometricVoF/sampledInterface/sampledInterface.C @@ -267,7 +267,7 @@ Foam::tmp Foam::sampledInterface::interpolate } -void Foam::sampledInterface::print(Ostream& os) const +void Foam::sampledInterface::print(Ostream& os, int level) const { os << "sampledInterface: " << name(); } diff --git a/src/transportModels/geometricVoF/sampledInterface/sampledInterface.H b/src/transportModels/geometricVoF/sampledInterface/sampledInterface.H index f9a293b4ee..aaa5c3c558 100644 --- a/src/transportModels/geometricVoF/sampledInterface/sampledInterface.H +++ b/src/transportModels/geometricVoF/sampledInterface/sampledInterface.H @@ -267,8 +267,8 @@ public: // Output - //- Write - virtual void print(Ostream&) const; + //- Print information + virtual void print(Ostream& os, int level=0) const; };