Commit Graph

40 Commits

Author SHA1 Message Date
12c91b9472 STYLE: check autoPtr as plain bool instead of valid()
- cleaner code, more similarity with unique_ptr

  Now
      if (ptr)
      if (!ptr)

  instead
      if (ptr.valid())
      if (!ptr.valid())
2020-07-16 11:39:24 +02:00
1b45599b26 ENH: enable user to control re-writing of function object output file headers. See #1556 2020-06-05 14:37:21 +01:00
3e43edf056 ENH: unify use of dictionary method names
- previously introduced `getOrDefault` as a dictionary _get_ method,
  now complete the transition and use it everywhere instead of
  `lookupOrDefault`. This avoids mixed usage of the two methods that
  are identical in behaviour, makes for shorter names, and promotes
  the distinction between "lookup" access (ie, return a token stream,
  locate and return an entry) and "get" access (ie, the above with
  conversion to concrete types such as scalar, label etc).
2020-06-02 17:26:03 +02:00
2c4b639e1f ENH: 'mag' postOperation for surfaceFieldValue (#1622)
- support postOperation for volFieldValue as well
2020-03-11 11:59:04 +01:00
31aad2159f STYLE: writeFile - renamed writeTime to writeCurrentTime to avoid conflicts 2019-09-09 09:19:38 +01:00
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
7354af5dff STYLE: Updated FO output 2019-06-19 20:53:24 +01:00
1544db3116 ENH: surfaceFieldValue - update selection on mesh changes 2019-05-22 08:15:19 +01:00
922c3c57d5 BUG: Sf field ignored for sumDirection operation (fixes #1287) 2019-04-16 18:32:07 +02:00
e322894476 STYLE: pass points, faces instead of meshedSurfRef in surfaceFieldValue
- removes a layer of opacity and may help with future restructuring
2019-02-22 11:08:07 +01:00
03e6aa1a6d ENH: replace surfMesh/fields support with polySurface/fields support (#1206)
- fits better into the general sampling framework, improves flexibilty
  and allows code reduction.

ENH: include surface fields on sampledSurfaces that support it
2019-02-12 13:54:02 +01:00
181c974b11 ENH: improved sample surfaces and surface writers (#1206)
- The writers have changed from being a generic state-less set of
  routines to more properly conforming to the normal notion of a writer.
  These changes allow us to combine output fields (eg, in a single
  VTK/vtp file for each timestep).

  Parallel data reduction and any associated bookkeeping is now part
  of the surface writers.
  This improves their re-usability and avoids unnecessary
  and premature data reduction at the sampling stage.

  It is now possible to have different output formats on a per-surface
  basis.

- A new feature of the surface sampling is the ability to "store" the
  sampled surfaces and fields onto a registry for reuse by other
  function objects.

  Additionally, the "store" can be triggered at the execution phase
  as well
2019-02-07 18:11:34 +01:00
bfb0693bbe ENH: delay evaluation of surfaces for surfaceFieldValue (issue #1202)
- complete any pending initialisation on write().
  Allows lazier evaluation until when the surfaces are actually needed.
2019-02-12 12:39:49 +01:00
de673f3bcf STYLE: consolidate 'clear' when initialising surfaceFieldValue 2019-02-11 15:59:14 +01:00
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
3b74512231 ENH: cleanup of Enum class
- more dictionary-like methods, enforce keyType::LITERAL for all
  lookups to avoid any spurious keyword matching.

- new readEntry, readIfPresent methods

- The get() method replaces the now deprecate lookup() method.

- Deprecate lookupOrFailsafe()
  Failsafe behaviour is now an optional parameter for lookupOrDefault,
  which makes it easier to tailor behaviour at runtime.

- output of the names is now always flatted without line-breaks.
  Thus,

     os << flatOutput(someEnumNames.names()) << nl;
     os << someEnumNames << nl;

  both generate the same output.

- Constructor now uses C-string (const char*) directly instead of
  Foam::word in its initializer_list.

- Remove special enum + initializer_list constructor form since
  it can create unbounded lookup indices.

- Removd old hasEnum, hasName forms that were provided during initial
  transition from NamedEnum.

- Added static_assert on Enum contents to restrict to enum or
  integral values.  Should not likely be using this class to enumerate
  other things since it internally uses an 'int' for its values.

  Changed volumeType accordingly to enumerate on its type (enum),
  not the class itself.
2018-10-18 12:57:32 +02:00
1036cf9612 ENH: avoid raw dictionary lookup in functionObjects (issue #762)
Style changes:
    - use lookupObjectRef instead of using const_cast
    - use tmp::New factory
2018-08-04 00:23:18 +02:00
e53384362c ENH: added surfaceFieldValue uniformity operation 2018-03-22 22:38:34 +01:00
56bfc75949 Rationalize the "pos" function
"pos" now returns 1 if the argument is greater than 0, otherwise it returns 0.
This is consistent with the common mathematical definition of the "pos" function:

https://en.wikipedia.org/wiki/Sign_(mathematics)

However the previous implementation in which 1 was also returned for a 0
argument is useful in many situations so the "pos0" has been added which returns
1 if the argument is greater or equal to 0.  Additionally the "neg0" has been
added which returns 1 if if the argument is less than or equal to 0.
2017-06-22 14:32:18 +01:00
6ec186bada ENH: a weighted operation without a weightField is an error (issue #583)
- affects surfaceFieldValue, volFieldValue.

  Use 'none' (if desired) to explicitly suppress the weightField, but
  generally better to use a different operation.
2017-09-11 18:10:41 +02:00
4588182352 ENH: add absolute weighting for surfaceFieldValue (issue #567)
- can be useful either for flow-rate weighting where backflow
  is to be ignored in the average, or for flow-rate weighting
  on surfaces with inconsistent orientation.

  Reworked to code to make better use of Enum (the NamedEnum
  replacement). Enum doesn't require contiguous enumeration values,
  which lets us use bitmasking of similar operations to reduce
  duplicate code.
2017-08-11 14:53:24 +02:00
f55c568f13 ENH: upgrade from NamedEnum to Enum (issue #515) 2017-07-03 21:43:33 +02:00
fb4971644f ENH: cleanup of NamedEnum
- Remove the unused enums() method since it delivers wholly unreliable
  results. It is not guaranteed to cover the full enumeration range,
  but only the listed names.

- Remove the unused strings() method.
  Duplicated functionality of the words(), but was never used.

- Change access of words() method from static to object.
  Better code isolation. Permits the constructor to take over
  as the single point of failure for bad input.

- Add values() method

- do not expose internal (HashTable) lookup since it makes it more
  difficult to enforce constness and the implementation detail should
  not be exposed. However leave toc() and sortedToc() for the interface.

STYLE: relocated NamedEnum under primitives (was containers)

- internal typedef as 'value_type' for some consistency with STL conventions
2017-05-29 10:30:55 +02:00
9a864bdd85 GIT: Resolved merge conflict when merging develop branch 2017-05-24 12:30:09 +01:00
f71e4ff5cb ENH: surfaceFieldValue - simplified by making use of new field.oriented() functionality 2017-04-24 11:43:13 +01:00
b708c23cfc ENH: Clean-up after latest Foundation integrations 2017-03-27 14:34:01 +01:00
65a4a357b5 COMP: Corrected ambiguous construction from tmp errors 2017-03-24 15:50:27 +00:00
dcb1a95e35 MRG: Integrated Foundation code to commit 7d6845d 2017-03-23 14:33:33 +00:00
2853678a60 ENH: support operations on surfFields in surfaceFieldValue
- this makes it possible to perform additional operations
  on surface values that have been previously sampled.

- support vectorField for weighting operations.

- reduce overhead by avoiding creation of weight fields, Sf fields
  and combined surface geometries unless they are actually required.

- extend some similar concepts and operations to volFieldValue
2017-03-02 14:50:36 +01:00
e9355df198 ENH: [surface|vol]FieldValue - added name of weight field to output file header if used 2017-03-21 09:38:36 +00:00
ddf1268e73 functionObjects:surfaceFieldValue, volFieldValue: Added weightedSum and weighted[Area|Vol]Integrate
Patch contributed by Timo Niemi, VTT.
Resolves patch request https://bugs.openfoam.org/view.php?id=2452
2017-02-06 15:48:11 +00:00
b073c0a104 ENH: postOperation for surfaceFieldValue
- currently only 'none' or 'sqrt', which can be useful in combination
  with integrate or averaging functions.
2016-12-15 09:46:00 +01:00
422993f9a5 ENH: add weightedAreaIntegrate operation for surfaceFieldValue 2016-12-08 11:00:18 +00:00
c0f44ac4f3 MRG: Integrated foundation code 2016-12-12 12:10:29 +00:00
8b219feda2 Updated member type comments
See http://bugs.openfoam.org/view.php?id=2356
2016-11-28 09:22:56 +00:00
c4c57690c6 ENH: function objects - use Info on construction/read, and Log for all other messages 2016-11-03 12:11:20 +00:00
b9940cbbb1 COMP: Multiple changes - first clean build after latest merge - UNTESTED 2016-09-23 15:36:53 +01:00
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
e476f80e7a functionObjects: Improved handling of multi-file indexing and code style
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2216
2016-08-24 19:34:00 +01:00
7b788f0922 functionObjects::volRegion: General base-class to handle vol (cell) region processing
Renamed the original volRegion -> volFieldValue to clarify the purpose
of this class to process vol fields on a volRegion.
2016-08-11 15:11:19 +01:00