Commit Graph

102 Commits

Author SHA1 Message Date
Mark Olesen
b5435cc83e ENH: separate registry and revised file locations for finite-area
- The internal storage location of finite-area changes from being
  piggybacked on the polyMesh registry to a having its own dedicated
  registry:

  * allows a clearer separation of field types without name clashes.
  * prerequisite for supporting multiple finite-area regions (future)

Old Locations:
```
   0/Us
   constant/faMesh
   system/faMeshDefinition
   system/faSchemes
   system/faSolution
```

New Locations:
```
   0/finite-area/Us
   constant/finite-area/faMesh
   system/finite-area/faMeshDefinition  (or system/faMeshDefinition)
   system/finite-area/faSchemes
   system/finite-area/faSolution
```

NOTES:
    The new locations represent a hard change (breaking change) that
    is normally to be avoided, but seamless compatibility handling
    within the code was found to be unworkable.

    The `foamUpgradeFiniteArea` script provides assistance with migration.

    As a convenience, the system/faMeshDefinition location continues
    to be supported (may be deprecated in the future).
2024-04-19 17:20:09 +02:00
Mark Olesen
7e0acfa4ed ENH: handle 64-bit memory information (#3060)
- on large memory systems (eg, 6TB) the process information
  exceeds an 'int' range, so adjust parsing of the /proc/..
  to use int64

ENH: update/modernize OSspecific system information

ENH: minor update of profiling code

- std::string, noexcept, lazier evaluations

STYLE: use direct call of memInfo
2023-12-15 17:21:38 +01:00
Mark Olesen
16591012e9 ENH: add -verbose option to surface conversion, cleanup
- by default, reduce the amount of output

ENH: support default text description for -verbose option

- simplifies use in more places.
2023-05-09 19:30:57 +02:00
Mark Olesen
88061f3b28 ENH: improved argList handling of libs, functionObjects
- include -no-libs option by default, similar to '-lib',
  which makes it available to all solvers/utilities.
  Add argList allowLibs() method to query it.

- relocate with/no functionObjects logic from Time to argList
  itself as argList allowFunctionObjects()

- add libs/functionObjects override handling to decomposePar etc

ENH: report the stream relativeName for IOerrors (see c9333a5ac8)
2022-09-22 16:08:52 +02:00
Mark Olesen
ba10afea77 ENH: add 'filtered' polyMesh regionName() method
- in various situations with mesh regions it is also useful to
  filter out or remove the defaultRegion name (ie, "region0").

  Can now do that conveniently from the polyMesh itself or as a static
  function. Simply use this

      const word& regionDir = polyMesh::regionName(regionName);

  OR  mesh.regionName()

  instead of

      const word& regionDir =
      (
           regionName != polyMesh::defaultRegion
         ? regionName
         : word::null
      );

  Additionally, since the string '/' join operator filters out empty
  strings, the following will work correctly:

      (polyMesh::regionName(regionName)/polyMesh::meshSubDir)

      (mesh.regionName()/polyMesh::meshSubDir)
2022-05-27 14:10:31 +02:00
Mark Olesen
d38de84d21 ENH: bundle Pstream:: AllGather methods
- bundles frequently used 'gather/scatter' patterns more consistently.

  - combineAllGather     -> combineGather + broadcast
  - listCombineAllGather -> listCombineGather + broadcast
  - mapCombineAllGather  -> mapCombineGather + broadcast
  - allGatherList        -> gatherList + scatterList
  - reduce               -> gather + broadcast (ie, allreduce)

- The allGatherList currently wraps gatherList/scatterList, but may be
  replaced with a different algorithm in the future.

STYLE: PstreamCombineReduceOps.H is mostly unneeded now
2022-03-31 15:56:04 +02:00
Mark Olesen
c4d4becbac ENH: -exclude-fields, -no-fields options for foamToEnsight, foamToVTK
- additional verbosity option for conversions

- ignore old `-finite-area` option and always convert available
  finiteArea mesh/fields unless `-no-finite-area` is specified (#2374)

ENH: simplify point offset handling for ensight output

- extend writing to include compact face/cell lists
2022-03-12 21:16:30 +01:00
Mark Olesen
295822daa6 ENH: cleanup/reorganize surfaceWriter and fileFormats
- remove unused surfaceWriter constructors, noexcept on methods

- relocate/rename writerCaching from surfMesh -> fileFormats

- changed from surfaceWriters::writerCaching to
  ensightOutput::writerCaching to permit reuse elsewhere

- relocate static output helpers to ensightCase

- refactor NAS coordinate writing
2022-02-10 19:28:51 +01:00
Mark Olesen
3e87a46498 ENH: multi-region support for foamToEnsight (#2080)
- additional finite-area support too.
2021-05-30 21:02:59 +02:00
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
Mark Olesen
676a904c99 BUG: flipped cellZones compat setting for foamToEnsight (#1579)
STYLE: reword text for -excludePatches
2020-06-22 11:19:34 +02:00
Mark Olesen
31b172217c ENH: support predicate checks for argList (similar to dictionary methods)
- Favour use of argList methods that are more similar to dictionary
  method names with the aim of reducing the cognitive load.

  * Silently deprecate two-parameter get() method in favour of the
    more familiar getOrDefault.
  * Silently deprecate opt() method in favour of get()

  These may be verbosely deprecated in future versions.
2020-06-02 13:51:18 +02:00
Mark Olesen
a97628121c ENH: overhaul ensight handling (#1579)
- includes restructuring and simplification of low-level ensight part
  handling and refactor of backends to improve code reuse.

foamToEnsight
-------------

  * new cellZone support.
    This was previously only possible via a separate foamToEnsightParts
    utility that was not parallelized.

  * support for point fields.

  * `-nearCellValue` option (as per foamToVTK)

  * data indexing now uses values from the time index.
    This is consistent with the ensightWrite function object and
    can help with restarts.

  * existing ensight directories are removed, unless the -no-overwrite
    option is supplied

foamToEnsightParts
------------------
  * now redundant and removed.

ensightOutputSurface (new class)
--------------------------------
  * a lightweight wrapper for point/face references that is tailored
    for the ensightSurfaceWriter. It uses compact face/point information
    and is serial only, since this is the format requirements from the
    surfaceWriter class.

ensightMesh (revised class)
---------------------------
  * now only holds a polyMesh reference, which removes its dependency
    on finiteVolume and allows it to be relocated under fileFormats
    instead of conversion.

Removed classes: ensightParts, ensighPartFaces, ensightPartCells

- these were used by foamToEnsightParts, but not needed anymore.
2020-02-18 11:09:43 +00:00
Mark Olesen
1310e85225 ENH: support 'get()' for retrieving argList options
- previously only had 'opt<..>()' for options, but 'get<..>()'
  provides more similarity with dictionary methods.
  The 'opt<..>()' method is retained.
2019-11-26 21:07:11 +01:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
b7fb6116c3 ENH: restructuring of ensight output files
- changed ensightOutput from a class solely comprising static methods to
  a namespace and added in sub-namespaces Detail and Serial.

  This makes it easier to "mix-in" functions at different levels.
  Refactored and combined some serial/parallel code where possible.

  The general ensightOutput namespace has now shifted to be in the
  fileFormats lib, while leaving volField outputs in the conversion lib
  and cloud outputs in the lagrangian-intermediate lib.

  The ensightCloud namespace is now simply folded into the new
  ensightOutput namespace.

  These changes clean up some code, reduce fragmentation and
  duplication and removes the previous libconversion dependency for
  sampling.

- use int for ensight nTypes constexpr

Note: issue #1176 is unaffected except for the change in file name:

   ensightOutputTemplates.C -> ensightOutputVolFieldTemplates.C
2019-01-29 15:18:17 +01:00
Mark Olesen
78fd05051b STYLE: juggle some advanced/non-advanced options (foamToVTK, foamToEnsight) 2018-12-13 02:39:41 +01:00
Mark Olesen
29a5793b5b STYLE: argList::opt method instead of the longer argList::lookupOrDefault
- also replaced a few instances of readIfPresent with opt<> for
  constant values.
2018-12-12 12:10:39 +01:00
Mark Olesen
68ec561df8 STYLE: add usage notes to more utilities and solvers 2018-12-11 15:25:27 +01:00
Mark Olesen
51a3f4e6e4 ENH: make foamToVTK faceZone writing explicit (closes #1117)
- change previous default (convert all faceZones unless -noFaceZones
  specified) with the default behaviour to only convert face zones on
  request.

- uses the '-faceZones' option as per foamToEnsight
2018-12-10 14:35:44 +01:00
Mark Olesen
d8a55e46b6 ENH: align foamToEnsightParts internals with foamToEnsight
- add -region option and -fields filtering
2018-11-25 12:12:19 +01:00
Mark Olesen
b5432011fa ENH: improve option naming consistency in
- foamToVTK, foamToEnsight, foamToEnsightParts
2018-11-25 10:47:00 +01:00
Mark Olesen
2b42076d58 ENH: restructuring of foamToEnsight code
- align with foamToVTK code base
2018-10-09 21:28:53 +02:00
Mark Olesen
e4fac35d60 ENH: cleanup ensightMesh method names and handling of internal vs boundary
- this removes the old 'magically' means of suppressing the internal
  mesh in favour of specifying it directly.
2018-10-09 17:49:15 +02:00
Mark Olesen
2fb382bf8a ENH: multiple zone selection for fvMeshSubsetProxy (#973)
- handle tmp fields in interpolate methods

- special method interpolateInternal() for creating a volume field
  with zero-gradient treatment for patches from an internal field.

  This method was previously also called interpolate(), but that
  masked the ability to subset the internal field only.

  Ensight output needs the volume field:
      uses interpolateInternal().

  VTK output has separate handling of internal and patch fields:
      uses interpolate().

ENH: added fvMeshSubset mesh() method for baseMesh or subMesh.

- simplies coding when the fvMeshSubset may or may not be in active use.

ENH: update foamToEnsight to use newer methods in wrapped form

- static interpolate functions with renaming for manual use with
  fvMeshSubset (when fvMeshSubsetProxy may be too limiting in
  functionality)
2018-10-02 17:06:44 +02:00
Mark Olesen
69f6f63810 ENH: add globalPath() to argList and TimePaths
- simply combines (rootPath()/globalCaseName())
2018-09-28 15:24:59 +02:00
Mark Olesen
ae36f5f504 ENH: change argList get<> and getList<> from read<>, readList<>
- more consistent with dictionary method naming. The get<> or
  getList<> returns a value, doesn't read into a existing location.
2018-08-09 11:27:36 +02:00
Mark Olesen
cb919a6c41 ENH: tag some options as 'advanced' (only shown with -help-full)
General:
    * -roots, -hostRoots, -fileHandler

Specific:
    * -to <coordinateSystem> -from <coordinateSystem>

- Display -help-compat when compatibility or ignored options are available

STYLE: capitalization of options text
2018-07-31 11:54:15 +02:00
Mark Olesen
02ad76df4f ENH: allow wordHashSet filter for IOobjectList::names
- simplifies usage.
  Support syncPar check on names() to detect inconsistencies.

- simplify readFields, ReadFields and other routines by using these
  new methods.
2018-07-26 14:56:52 +02:00
Mark Olesen
a8ef5610d0 STYLE: renamed meshSubsetHelper -> fvMeshSubsetProxy 2018-07-26 01:57:16 +02:00
Mark Olesen
bcabe827f6 ENH: dedicated HashSetOps, HashTableOps namespaces
- relocated HashSetPlusEqOp and HashTablePlusEqOp to
  HashSetOps::plusEqOp and HashTableOps::plusEqOp, respectively

- additional functions for converting between a labelHashSet
  and a PackedBoolList or List<bool>:

  From lists selections to labelHashSet indices:

      HashSetOps::used(const PackedBoolList&);
      HashSetOps::used(const UList<bool>&);

  From labelHashSet to list forms:

      PackedBoolList bitset(const labelHashSet&);
      List<bool> bools(const labelHashSet&);
2018-03-06 11:41:34 +01:00
Mark Olesen
c126464d1c ENH: change wordRes to be a List of wordRe instead of a wrapper (issue #259)
- this permits direct storage of a list with additional matcher
  capabilities

- provide wordRes::matcher class for similar behaviour as previously
2018-02-21 10:05:30 +01:00
Mark Olesen
7f3d4b3554 Merge branch 'master' into develop 2018-01-23 16:11:28 +01:00
Mark Olesen
294a3d05ba BUG: problems converting clouds to ensight or vtk format (closes #708)
- problems when the cloud was not available on all processors.

- NB: ensight measured data only allows a single cloud, but
  foamToEnsight writes all clouds.
2018-01-23 15:39:45 +01:00
Mark Olesen
345a2a42f1 ENH: simplify method names for reading argList options and arguments
- use succincter method names that more closely resemble dictionary
  and HashTable method names. This improves method name consistency
  between classes and also requires less typing effort:

    args.found(optName)        vs.  args.optionFound(optName)
    args.readIfPresent(..)     vs.  args.optionReadIfPresent(..)
    ...
    args.opt<scalar>(optName)  vs.  args.optionRead<scalar>(optName)
    args.read<scalar>(index)   vs.  args.argRead<scalar>(index)

- the older method names forms have been retained for code compatibility,
  but are now deprecated
2018-01-08 15:35:18 +01:00
Andrew Heather
c2ff8ea99e ENH: Added finiteArea support to foamToVTK 2017-11-21 16:33:33 +00:00
Mark Olesen
cce74d493b ENH: remove deprecated ensight output order (issue #523)
- Added for transition purposes only in 1612 but can now be removed.
2017-07-11 14:57:05 +02:00
Mark Olesen
2d530401fd ENH: add foamToVTK -name option
- as per foamToEnsight, foamToEnsightParts.
  Allows the user to specify different output directories.
2017-06-14 08:14:24 +02:00
Mark Olesen
49500b0194 STYLE: more meaningful variable name when using meshSubsetHelper 2017-06-14 07:56:57 +02:00
Mark Olesen
b2edd73881 ENH: simplify foamToEnsight using new IOobjectList methods
BUG: foamToEnsight fails with missing field at time 0 (fixes #473)
2017-05-17 14:41:21 +02:00
Mark Olesen
e5d9fd13c2 ENH: relocate meshSubsetHelper into dynamicMesh for re-use
- reuse for foamToTecplot360 and foamToVTK.
- remove dependency on vtkMesh where possible.
2016-11-09 23:33:24 +01:00
Mark Olesen
b2ee629a94 BUG: removed oddness in pointer allocations (ensight parts).
- manifest in some parallel operations.

STYLE: update foamToEnsight, foamToEnsightParts to use C++ initializer_list

- avoid warning message when removing a non-existent directory (ensight output).
2016-10-27 15:11:30 +02:00
Mark Olesen
e57ca15bda ENH: complete reworking of foamToEnsight to make into a library (issue #241)
- eliminate ensightAsciiStream, ensightBinaryStream, ensightStream in
  favour of using ensightFile and ensightGeoFile classes throughout.

- encapsulate mesh-parts sorting with the ensightCells, ensightFaces
  class.

- handle of patches/faceZones entirely within ensightMesh for a lighter
  interaction with field output. Both faceZones and point fields need
  more testing to see if they behave properly for all cases.

- move some output functionality into its own namespace
  'ensightOutput', move into a library.

- use the ensightCase class to open new ensight output streams
  in the proper sub-directory locations.
2016-10-06 10:43:22 +02:00
Mark Olesen
3e0e4532fd STYLE: minor adjustments to doxygen comments 2016-10-04 09:16:08 +02:00
Andrew Heather
47eb24bed5 GIT: Resolved conflicts arising from merge with develop branch 2016-09-26 10:57:34 +01:00
Mark Olesen
88ca081c8c ENH: reduce startup time for ensight conversion (issue #240).
- Less looping when detecting lagrangian clouds and their fields.

- Avoid using Time::setTime() and IOobjectList in tight loops.
  They both kill performance immensely.

ENH: provide a -noLagrangian option to foamToEnsight and foamToEnsightParts
for even more control.
2016-09-23 17:45:47 +02:00
Andrew Heather
b9940cbbb1 COMP: Multiple changes - first clean build after latest merge - UNTESTED 2016-09-23 15:36:53 +01:00
Mark Olesen
0c168c43fa ENH: improve startup time for foamToEnsight conversion (issue #240).
Old code:
    Found 10990 time steps
    Search for moving mesh ... no moving mesh detected.
    Startup in 329.09 s

Updated:
    Found 10990 time steps
    Search for moving mesh ... no moving mesh detected.
    Startup in 1.6 s

- Cause was checking "polyMesh/points" via an IOobject.
  Short-circuit with a check for a polyMesh/ directory first.

  Limit the check to the master-node as well to further reduce
  load on the file-system.

------------------------------

ENH: improve per-step conversion times for foamToEnsight.

Old code:
    Converting 11001 time steps
    Time [0] = 0       Wrote in 1.53 s
    Time [1] = 1       Wrote in 1.52 s
    ...
    Time [100] = 100   Elapsed time 205.35 s

Updated:
    Converting 11001 time steps
    Time [0] = 0       Wrote in 1.4 s
    Time [1] = 1       Wrote in 0.07 s
    ...
    Time [100] = 100   Elapsed time 42.4 s

- Speedup by hashing test results from the first conversion step
  instead of checking each time.

  Check data on all nodes to avoid problems with incomplete writes.

------------------------------

BUG: moving mesh detection failed for foamToEnsightParts

- adjusted to agree with updated foamToEnsight

------------------------------

Note:

- foamToEnsightParts (serial) still has about twice the throughput of
  foamToEnsight.
2016-09-21 18:15:19 +02:00
Andrew Heather
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00