Commit Graph

110 Commits

Author SHA1 Message Date
Mark Olesen
50420f755c COMP: references to temporaries
COMP: include <limits>
2022-06-23 09:51:24 +02:00
Mark Olesen
1e95af4d57 STYLE: use more generic terms allow/deny for selections 2020-09-09 13:54:34 +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
fc26fb758d ENH: add stringListOps with whitelist/blacklist matching
- refactored from ensightMesh, foamToVTK, surfaceMeshExtract

STYLE: use wordRes matching() method instead of findString() function
2020-02-26 21:40:09 +01:00
Mark Olesen
ec3de7128c STYLE: adjust logic names for point-values in foamToVTK 2020-02-12 18:03:50 +01: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
Mark Olesen
f0f4af16d2 Merge remote-tracking branch 'origin/master' into develop 2019-04-08 12:05:24 +02:00
Mark Olesen
8ab09daad0 BUG: foamToVTK writes to undecomposed case (closes #1271)
- when running in serial but within a processor directory,
  argList::globalPath() is to be used instead of Time.globalPath()
  For other cases there is no difference.
2019-04-08 11:53:50 +02:00
Mark Olesen
5d445f4ed6 ENH: suppress cell/patch/proc ids for foamToVTK (#1230)
- reduces output size, consistent with vtkWrite function object

STYLE: mark some foamToVTK options as advanced (ie, visible with -help-full)
2019-03-11 11:02:58 +01:00
Mark Olesen
fe445ac516 ENH: support VTK output of point ids
- can be useful for diagnosing mesh internals and the locations of
  decomposed cells.
2019-02-17 15:09:36 +01:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
2a1d0f36ec ENH: new foamToVTK output option -processor-fields
- write values of processor boundaries only, for diagnostic purposes.

- parallel only, and non-legacy format only
2019-01-14 17:32:07 +01:00
Mark Olesen
e8f25b1385 BUG: foamToVTK, vtkWrite stopped by processorCyclic (closes #1135)
- they had an isType<> instead of isA<>() check
2018-12-19 13:56:20 +01:00
Mark Olesen
455c8ef540 ENH: simplify use of case-relative paths
- provide relativePath() for argList and for Time.
  These are relative to the case globalPath().
  Eg,

     Info<< "output: " << runTime.relativePath(outputFile) << nl;
2018-12-15 13:26:55 +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
b5432011fa ENH: improve option naming consistency in
- foamToVTK, foamToEnsight, foamToEnsightParts
2018-11-25 10:47:00 +01:00
Mark Olesen
05353da5f4 BUG: errors found in feature-vtm merge !213
- vtkWrite with moving mesh was not updated the subsets properly,
  which caused it to crash.

- foamToVTK -overwrite ignored for single region cases,
  was working for multi-region cases

- minor documentation changes
2018-11-23 14:04:07 +01:00
Mark Olesen
89cca8578c ENH: rewrite of foamToVTK to include parallel output (#926)
- Default format is now XML binary (base64) instead of legacy format.
  The old -xml option is redundant and ignored.
  The new -legacy option can be used to force legacy output instead.

- Polyhedral decomposition is now off by default (old -poly is ignored).
  The option -poly-decomp forces decomposition of polyhedrals into
  primitive shapes.

- reduced memory footprint by reading and converting fields
  successively.

- Creation of symlinks to processor files is no longer required or
  desired. The old -noLinks option is ignored.

- Ignore -useTimeName option. Always number according to timeIndex.
2018-10-09 20:00:55 +02:00
Mark Olesen
0d2dbaf61b ENH: parallel and xml output for vtk topoSet writers (issue #926)
- introduce lower-level vtk::indirectPatchWriter class
2018-09-17 15:41:58 +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
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
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
9bd7ea593e ENH: added fileName::relative() method
- this currently just strips off the leading parent directory name

     "/this/path/and/subdirs/name"

     relative("/this/path")  -> "and/subdirs/name"
     relative("/this")       -> "path/and/subdirs/name"
2018-01-23 18:25:55 +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
6f72f3452d BUG: foamToVTK - only convert finte area if -finiteAreaFields option is specified. Fixes #687 2017-12-29 23:50:10 +00:00
Andrew Heather
c2ff8ea99e ENH: Added finiteArea support to foamToVTK 2017-11-21 16:33:33 +00:00
Mark Olesen
14d4484fae STYLE: single-string findStrings deprecated in favour of stringOps::match
- reduces ambiguity between matching a list of strings and a single string.
2017-11-13 10:37:38 +01:00
Andrew Heather
2defba00a9 ENH: Lagrangian - provided backwards compatibility for cases using the
old "positions" file form

The change to barycentric-based tracking changed the contents of the
cloud "positions" file to a new format comprising the barycentric
co-ordinates and other cell position-based info.  This broke
backwards compatibility, providing no option to restart old cases
(v1706 and earlier), and caused difficulties for dependent code, e.g.
for post-processing utilities that could only infer the contents only
after reading.

The barycentric position info is now written to a file called
"coordinates" with provision to restart old cases for which only the
"positions" file is available. Related utilities, e.g. for parallel
running and data conversion have been updated to be able to support both
file types.

To write the "positions" file by default, use set the following option
in the InfoSwitches section of the controlDict:

    writeLagrangianPositions 1;
2017-09-13 13:13:36 +01:00
Mark Olesen
e62e34f0f0 ENH: add -cellZone option to foamToVTK 2017-07-04 14:16:18 +02:00
Mark Olesen
c5bd5393df ENH: lazier field loading in foamToVTK
- avoid loading surface fields if there are no faceZones

- avoid pointMesh if there are no appropriate point fields
2017-07-04 11:57:54 +02:00
Mark Olesen
6dd5a5f35f BUG: foamToVTK -cellSet produces rubbish or segfault (closes #516)
- erroneous double logic for subset meshes.

  The underlying vtk::vtuCells uses a cellMap to map into a global
  field, which also allows handling of decomposed polyhedral cells.

  If a mesh subset is involved (eg, cellSet, cellZone), then the
  set/zone cellMap can be used to ensure that the original number is
  properly adjusted. For foamToVTK, the meshSubsetHelper already
  does the subsetting and is used when loading fields.

  Does not affect ParaView reader module since there we work on the
  full field and do the subsetting manually (using the cellMap).
2017-07-04 13:19:16 +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
7ee1dba43a STYLE: adjust feedback comments in foamToVTK 2017-06-13 22:28:39 +02:00
Mark Olesen
cde12ad9e5 ENH: consolidate vtk classes into 'Foam::vtk' namespace
- elminate the foamVtkFormatter operator() in favour of xmlAttr.
  Improves readability and the purpose is clearer.
2017-06-13 14:10:07 +02:00
Mark Olesen
a2e978d43e ENH: add VTP, VTU output for most vtk writers (insitu only)
- with the xml append format it is possible to write raw binary
  (instead of base64), but the writer becomes more complicated.
  Either needs two passes to create, or need to allocate a block
  of space for the header information (like VTK itself does) and
  write later.

    * internalWriter
    * patchWriter
    * surfaceMeshWriter
    * lagrangianWriter

 Also these special purpose ones:
    * foamVtkWriteSurfFields
2017-06-01 18:28:40 +02:00
Mark Olesen
c4f1349496 ENH: construct VTK writers with the outputOptions and adjust internally
- this shifts responsibility away from caller to the individual writers
  for knowing which file formats are supported and which file ending is
  appropriate. When the writer receives the output format request,
  it can elect to downgrade or otherwise adjust it to what it can
  actually manage (eg, legacy vs xml vs xml-append).

  But currently still just with legacy format backends.
2017-05-31 22:08:54 +02:00
Mark Olesen
2495fcb42e ENH: replace foamToVTK routines with library-level equivalents 2017-05-22 16:13:53 +02:00
Mark Olesen
667b885116 STYLE: remove ununsed foamToVTK template functions 2017-05-17 18:59:51 +02:00
Mark Olesen
a8d2ebf298 ENH: cleanup wordRe interfaces etc.
- ensure that the string-related classes have consistently similar
  matching methods. Use operator()(const std::string) as an entry
  point for the match() method, which makes it easier to use for
  filters and predicates. In some cases this will also permit using
  a HashSet as a match predicate.

regExp
====
- the set method now returns a bool to signal that the requested
  pattern was compiled.

wordRe
====
- have separate constructors with the compilation option (was previously
  a default parameter). This leaves the single parameter constructor
  explicit, but the two parameter version is now non-explicit, which
  makes it easier to use when building lists.

- renamed compile-option from REGEX (to REGEXP) for consistency with
  with the <regex.h>, <regex> header names etc.

wordRes
====
- renamed from wordReListMatcher -> wordRes. For reduced typing and
  since it behaves as an entity only slightly related to its underlying
  list nature.

- Provide old name as typedef and include for code transition.

- pass through some list methods into wordRes

hashedWordList
====
- hashedWordList[const word& name] now returns a -1 if the name is is
  not found in the list of indices. That has been a pending change
  ever since hashedWordList was generalized out of speciesTable
  (Oct-2010).

- add operator()(const word& name) for easy use as a predicate

STYLE: adjust parameter names in stringListOps

- reflect if the parameter is being used as a primary matcher, or the
  matcher will be derived from the parameter.
  For example,
      (const char* re), which first creates a regExp
      versus (const regExp& matcher) which is used directly.
2017-05-16 23:54:43 +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
3e0e4532fd STYLE: minor adjustments to doxygen comments 2016-10-04 09:16:08 +02:00