openfoam/applications/utilities/postProcessing/dataConversion/foamToVTK/createMeshAccounting.H
Mark Olesen c410edf928 ENH: centralized handling of -allRegions, -regions, -region (#2072)
Step 1.
    include "addAllRegionOptions.H"

    Adds the -allRegions, -regions and -region options to argList.

Step 2.
    include "getAllRegionOptions.H"

    Processes the options with -allRegions selecting everything
    from the regionProperties.

    OR use -regions to specify multiple regions (from
       regionProperties), and can also contain regular expressions

    OR use the -region option

    Specifying a single -regions NAME (not a regular expresssion)
    is the same as -region NAME and doesn't use regionProperties

    Creates a `wordList regionNames`

Step 3.
    Do something with the region names.
    Either directly, or quite commonly with the following

    include "createNamedMeshes.H"

    Creates a `PtrList<fvMesh> meshes`

STYLE: add description to some central include files
2021-05-07 09:46:33 +02:00

47 lines
1.3 KiB
C

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
Description
Additional mesh accounting (foamToVTK)
\*---------------------------------------------------------------------------*/
PtrList<fvMeshSubsetProxy> meshProxies(meshes.size());
PtrList<vtk::vtuCells> vtuMappings(meshes.size());
{
forAll(meshes, regioni)
{
// Mesh subsetting, or pass through
meshProxies.set
(
regioni,
new fvMeshSubsetProxy
(
meshes[regioni],
cellSubsetType,
cellSelectionName
)
);
// VTU sizing and decomposition information
vtuMappings.set
(
regioni,
new vtk::vtuCells(writeOpts, decomposePoly)
);
}
}
// ************************************************************************* //