From fe7832cf638ca452bae799ce953464d21cb2e735 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Tue, 3 Apr 2018 21:16:06 +0200 Subject: [PATCH] STYLE: cleanup headers --- Allwmake | 22 ++++++++++---- src/catalyst/catalystCloud.H | 18 ++++++++--- src/catalyst/catalystFaMesh.C | 1 + src/catalyst/catalystFaMesh.H | 21 ++++++++----- src/catalyst/catalystFvMesh.H | 16 +++++++--- src/catalyst/foamVtkCloudAdaptor.C | 6 ++-- src/catalyst/foamVtkCloudAdaptor.H | 8 +++-- src/catalyst/foamVtkFaMeshAdaptor.H | 46 ++++++++++++---------------- src/catalyst/foamVtkFvMeshAdaptor.C | 5 ++- src/catalyst/foamVtkFvMeshAdaptor.H | 47 ++++++++++++++--------------- 10 files changed, 106 insertions(+), 84 deletions(-) diff --git a/Allwmake b/Allwmake index 084698a..9499e0d 100755 --- a/Allwmake +++ b/Allwmake @@ -3,12 +3,22 @@ cd ${0%/*} || exit 1 # Run from this directory targetType=libso . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -[ -n "$FOAM_USER_LIBBIN" ] || { - echo "Error: FOAM_USER_LIBBIN not set" - echo " Check the OpenFOAM entries in your dot-files and source them." - exit 1 -} +#------------------------------------------------------------------------------ +echo "========================================" +date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown" +echo "Starting compile of catalyst with ${WM_PROJECT_DIR##*/} ${0##*}" +echo " $WM_COMPILER $WM_COMPILER_TYPE compiler" +echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}" +echo -src/Allwmake $targetType $* +src/Allwmake +# Some summary information +echo +date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown" +echo "========================================" +echo " Finished compile of catalyst with ${WM_PROJECT_DIR##*/}" +echo " $WM_COMPILER $WM_COMPILER_TYPE compiler" +echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}" +echo #------------------------------------------------------------------------------ diff --git a/src/catalyst/catalystCloud.H b/src/catalyst/catalystCloud.H index 29f8cfd..4271bca 100644 --- a/src/catalyst/catalystCloud.H +++ b/src/catalyst/catalystCloud.H @@ -30,25 +30,33 @@ Group Description A Paraview Catalyst adaptor for a single OpenFOAM cloud (lagrangian). + The output comprises a single "cloud" channel, which is a multi-block + dataset (one block per cloud). + Example of function object specification: \verbatim catalystCloud1 { type catalyst::cloud; libs ("libcatalystFoam.so"); - executeControl timeStep; - executeInterval 101; cloud NAME; fields (U T rho); scripts ( ... ); + executeControl timeStep; + executeInterval 1; } \endverbatim Usage \table - Property | Description | Required | Default value - cloud | | no | defaultCloud - clouds | List of wordRe | no | + Property | Description | Required | Default value + type | catalyst::cloud | yes | + cloud | | no | defaultCloud + clouds | wordRe list of clouds | no | + region | | no | region0 + regions | wordRe list of regions | no | + fields | wordRe list of fields | yes | + scripts | Python pipeline scripts | yes | \endtable See also diff --git a/src/catalyst/catalystFaMesh.C b/src/catalyst/catalystFaMesh.C index 305b9b3..7b5ef24 100644 --- a/src/catalyst/catalystFaMesh.C +++ b/src/catalyst/catalystFaMesh.C @@ -27,6 +27,7 @@ License #include "catalystCoprocess.H" #include "addToRunTimeSelectionTable.H" #include "faMesh.H" +#include "fvMesh.H" #include <vtkNew.h> #include <vtkCPDataDescription.h> diff --git a/src/catalyst/catalystFaMesh.H b/src/catalyst/catalystFaMesh.H index 1182d11..597e75a 100644 --- a/src/catalyst/catalystFaMesh.H +++ b/src/catalyst/catalystFaMesh.H @@ -30,29 +30,34 @@ Group Description A Paraview Catalyst adaptor for OpenFOAM faMesh regions. + The output comprises a single "input" channel, which is a multi-block + dataset (one block per area mesh). + Example of function object specification: \verbatim catalyst { - type catalyst; + type catalyst::area; libs ("libcatalystFoam.so"); - writeControl writeTime; - writeInterval 1; - regions ( ".*Solid" ) fields (U p); scripts ( ... ); + executeControl timeStep; + executeInterval 1; } \endverbatim Usage \table - Property | Description | Required | Default value - region | | no | region0 - regions | List of wordRe | no | + Property | Description | Required | Default + type | catalyst::area | yes | + region | | no | region0 + regions | wordRe list of regions | no | + fields | wordRe list of fields | yes | + scripts | Python pipeline scripts | yes | \endtable See also - Foam::functionObjects::functionObject + Foam::functionObjects::fvMeshFunctionObject Foam::functionObjects::timeControl SourceFiles diff --git a/src/catalyst/catalystFvMesh.H b/src/catalyst/catalystFvMesh.H index b18a401..7556503 100644 --- a/src/catalyst/catalystFvMesh.H +++ b/src/catalyst/catalystFvMesh.H @@ -30,25 +30,31 @@ Group Description A Paraview Catalyst adaptor for OpenFOAM fvMesh regions. + The output comprises up to three channels ("input", "mesh", "patches"), + each of which is a multi-block dataset. + Example of function object specification: \verbatim catalyst { type catalyst; libs ("libcatalystFoam.so"); - writeControl writeTime; - writeInterval 1; regions ( ".*Solid" ) fields (U p); scripts ( ... ); + executeControl timeStep; + executeInterval 1; } \endverbatim Usage \table - Property | Description | Required | Default value - region | | no | region0 - regions | List of wordRe | no | + Property | Description | Required | Default + type | catalyst | yes | + region | | no | region0 + regions | wordRe list of regions | no | + fields | wordRe list of fields | yes | + scripts | Python pipeline scripts | yes | \endtable See also diff --git a/src/catalyst/foamVtkCloudAdaptor.C b/src/catalyst/foamVtkCloudAdaptor.C index 6903e5c..184196f 100644 --- a/src/catalyst/foamVtkCloudAdaptor.C +++ b/src/catalyst/foamVtkCloudAdaptor.C @@ -167,15 +167,15 @@ vtkSmartPointer<vtkMultiPieceDataSet> Foam::vtk::cloudAdaptor::getCloud ( const word& cloudName, - const wordRes& matcher + const wordRes& selectFields ) const { - if (matcher.empty()) + if (selectFields.empty()) { return getCloud(cloudName); } - return getCloudImpl(mesh_, cloudName, matcher); + return getCloudImpl(mesh_, cloudName, selectFields); } diff --git a/src/catalyst/foamVtkCloudAdaptor.H b/src/catalyst/foamVtkCloudAdaptor.H index 99e85c8..d8c6de0 100644 --- a/src/catalyst/foamVtkCloudAdaptor.H +++ b/src/catalyst/foamVtkCloudAdaptor.H @@ -27,6 +27,10 @@ Class Description A simple backend for converting an OpenFOAM cloud to vtkPolyData. + The output is a multi-piece PolyData dataset corresponding to the + cloud. Each piece corresponds to its MPI rank. + +Note No caching of converted data since clouds are not stationary. SourceFiles @@ -42,10 +46,8 @@ SourceFiles #include "Enum.H" #include "foamVtkTools.H" -#include <vtkPoints.h> #include <vtkPolyData.h> #include <vtkSmartPointer.h> -#include <vtkMultiBlockDataSet.h> #include <vtkMultiPieceDataSet.h> // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -140,7 +142,7 @@ public: vtkSmartPointer<vtkMultiPieceDataSet> getCloud ( const word& cloudName, - const wordRes& fieldsSubset + const wordRes& selectFields ) const; }; diff --git a/src/catalyst/foamVtkFaMeshAdaptor.H b/src/catalyst/foamVtkFaMeshAdaptor.H index 2123e32..5b37ccb 100644 --- a/src/catalyst/foamVtkFaMeshAdaptor.H +++ b/src/catalyst/foamVtkFaMeshAdaptor.H @@ -27,6 +27,9 @@ Class Description The backend for the catalystFaMesh function object. + The output is a multi-piece PolyData dataset corresponding to the + finite area mesh. Each piece corresponds to its MPI rank. + SourceFiles foamVtkFaMeshAdaptor.C foamVtkFaMeshAdaptorGeom.C @@ -43,10 +46,8 @@ SourceFiles #include "stringList.H" #include "wordList.H" #include "Enum.H" +#include "polyMesh.H" #include "areaFieldsFwd.H" -#include "primitivePatch.H" -#include "PrimitivePatchInterpolation.H" -#include "volPointInterpolation.H" #include "foamVtkTools.H" #include "foamVtkMeshMaps.H" @@ -68,10 +69,9 @@ class vtkIndent; namespace Foam { -// OpenFOAM class forward declarations +// Forward declarations class Time; class faMesh; - template<class Type> class Field; namespace vtk @@ -103,9 +103,6 @@ public: private: - // Convenience typedefs - typedef PrimitivePatchInterpolation<primitivePatch> patchInterpolator; - //- Bookkeeping for vtkPolyData struct foamVtpData : @@ -126,13 +123,16 @@ private: HashTable<foamVtpData, string> cachedVtp_; - // Mesh Conversion Functions + // Mesh Conversion //- Convert internal void convertGeometryInternal(); - // Field conversion functions + // Field Conversion + + //- Convert specified area fields + void convertAreaFields(const wordRes& selectFields); //- Area field template<class Type> @@ -143,22 +143,20 @@ private: ) const; - //- Convert specified area fields - void convertAreaFields(const wordRes& selectFields); - + //- Update geometry and fields void updateContent(const wordRes& selectFields); // Convert OpenFOAM fields - //- Volume field - all types + //- Area field - all types template<class Type> void convertAreaField ( const GeometricField<Type, faPatchField, areaMesh>& fld ); - //- Volume fields - all types + //- Area fields - all types template<class Type> void convertAreaFields(const wordRes& selectFields); @@ -191,22 +189,16 @@ public: // Member Functions - //- Return the names of known (supported fields) + //- Return the names of known (supported) fields wordHashSet knownFields(const wordRes& selectFields) const; void updateState(polyMesh::readUpdateState state); - //- The output with point/cell data. - vtkSmartPointer<vtkMultiPieceDataSet> - output(const wordRes& selectFields); - - - // Access - - //- Debug information - void PrintSelf(ostream&, vtkIndent) const; - - void printInfo() const; + //- The output with cell data. + vtkSmartPointer<vtkMultiPieceDataSet> output + ( + const wordRes& selectFields + ); }; diff --git a/src/catalyst/foamVtkFvMeshAdaptor.C b/src/catalyst/foamVtkFvMeshAdaptor.C index 8249bef..0684207 100644 --- a/src/catalyst/foamVtkFvMeshAdaptor.C +++ b/src/catalyst/foamVtkFvMeshAdaptor.C @@ -2,8 +2,8 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. + \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,7 +28,6 @@ License // OpenFOAM includes #include "fvMesh.H" -#include "Time.H" // VTK includes #include <vtkMultiBlockDataSet.h> diff --git a/src/catalyst/foamVtkFvMeshAdaptor.H b/src/catalyst/foamVtkFvMeshAdaptor.H index 68d974a..8253e41 100644 --- a/src/catalyst/foamVtkFvMeshAdaptor.H +++ b/src/catalyst/foamVtkFvMeshAdaptor.H @@ -27,6 +27,14 @@ Class Description The backend for the catalystFvMesh function object. + The output is a multi-block dataset with two blocks corresponding + to the internal (volume) mesh (block 0) and the patches as (block 1). + These two blocks correspond simultaneously to the catalyst channels + "mesh" and "patches", respectively. + The patches are further divided into sub-blocks. The lowest data blocks + are multi-piece datasets (UnstructuredGrid and PolyData for internal mesh + and patches, respectively) with each piece corresponding to its MPI rank. + SourceFiles foamVtkFvMeshAdaptor.C foamVtkFvMeshAdaptorGeom.C @@ -68,10 +76,8 @@ class vtkIndent; namespace Foam { -// OpenFOAM class forward declarations -class Time; +// Forward declarations class fvMesh; - template<class Type> class Field; namespace vtk @@ -166,7 +172,7 @@ private: HashTable<foamVtuData, string> cachedVtu_; - // Mesh Conversion Functions + // Mesh Conversion //- Convert internal void convertGeometryInternal(); @@ -177,7 +183,10 @@ private: void convertGeometryPatches(); - // Field conversion functions + // Field Conversion + + //- Convert specified volume fields + void convertVolFields(const wordRes& selectFields); //- Volume field template<class Type> @@ -188,14 +197,6 @@ private: ) const; - //- Convert specified volume fields - void convertVolFields(const wordRes& selectFields); - - void updateContent(const wordRes& selectFields); - - - // Convert OpenFOAM fields - //- Volume field - all types template<class Type> void convertVolField @@ -238,6 +239,10 @@ private: ); + //- Update geometry and fields + void updateContent(const wordRes& selectFields); + + // Constructors //- No copy construct @@ -282,23 +287,17 @@ public: //- used - otherwise 0. label nPatches() const; - //- Return the names of known (supported fields) + //- Return the names of known (supported) fields wordHashSet knownFields(const wordRes& selectFields) const; void updateState(polyMesh::readUpdateState state); //- The output is a pair (MESH/PATCHES channels) of vtk meshes with //- point/cell data. - vtkSmartPointer<vtkMultiBlockDataSet> - output(const wordRes& selectFields); - - - // Access - - //- Debug information - void PrintSelf(ostream&, vtkIndent) const; - - void printInfo() const; + vtkSmartPointer<vtkMultiBlockDataSet> output + ( + const wordRes& selectFields + ); }; -- GitLab