Commit Graph

9 Commits

Author SHA1 Message Date
Mark Olesen
e623e6a865 STYLE: favour include word.H instead of string.H
- in many places the string.H include is redundant anyhow.
  May wish to change to foamString.H (or equiv) in the future
2023-02-27 15:41:25 +01:00
Mark Olesen
b4612b4c04 ENH: cleanup ensight surface reader (#2535)
- some central (core) bits under fileFormats,

- general surface reading relocated from sampling to surfMesh since it
  does not use any sampling-specific components and will permit
  re-use in meshTools (for example)

- remove old mask, subDir methods from ensightFile which were
  previously relocated to ensightCase

- improve handling of 'undef' values when generating and reading,
  respect Ensight component ordering when reading.
2022-07-19 11:17:52 +02:00
Mark Olesen
833ee40904 ENH: add pTraits for uint8_t 2020-10-07 09:17:00 +02:00
Andrew Heather
fdf8d10ab4 Merge commit 'e9219558d7' into develop-v1906 2019-12-05 11:47:19 +00:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
ef9bb4ae16 ENH: add low-level readRawLabels, readRawScalars (#1378)
- these use the additional byte-size checks in IOstream to handle
  native vs non-native sizes
2019-07-29 16:01:34 +02:00
Mark Olesen
8f8a4dc682 ENH: add foamDictionary -precision option (issue #1177)
- since foamDictionary doesn't use system/controlDict it will use the
  standard default precision. The '-precision' option allows adjusting
  that value.
2019-01-22 15:11:28 +01:00
Mark Olesen
bac943e6fc ENH: new bitSet class and improved PackedList class (closes #751)
- The bitSet class replaces the old PackedBoolList class.
  The redesign provides better block-wise access and reduced method
  calls. This helps both in cases where the bitSet may be relatively
  sparse, and in cases where advantage of contiguous operations can be
  made. This makes it easier to work with a bitSet as top-level object.

  In addition to the previously available count() method to determine
  if a bitSet is being used, now have simpler queries:

    - all()  - true if all bits in the addressable range are empty
    - any()  - true if any bits are set at all.
    - none() - true if no bits are set.

  These are faster than count() and allow early termination.

  The new test() method tests the value of a single bit position and
  returns a bool without any ambiguity caused by the return type
  (like the get() method), nor the const/non-const access (like
  operator[] has). The name corresponds to what std::bitset uses.

  The new find_first(), find_last(), find_next() methods provide a faster
  means of searching for bits that are set.

  This can be especially useful when using a bitSet to control an
  conditional:

  OLD (with macro):

      forAll(selected, celli)
      {
          if (selected[celli])
          {
              sumVol += mesh_.cellVolumes()[celli];
          }
      }

  NEW (with const_iterator):

      for (const label celli : selected)
      {
          sumVol += mesh_.cellVolumes()[celli];
      }

      or manually

      for
      (
          label celli = selected.find_first();
          celli != -1;
          celli = selected.find_next()
      )
      {
          sumVol += mesh_.cellVolumes()[celli];
      }

- When marking up contiguous parts of a bitset, an interval can be
  represented more efficiently as a labelRange of start/size.
  For example,

  OLD:

      if (isA<processorPolyPatch>(pp))
      {
          forAll(pp, i)
          {
              ignoreFaces.set(i);
          }
      }

  NEW:

      if (isA<processorPolyPatch>(pp))
      {
          ignoreFaces.set(pp.range());
      }
2018-03-07 11:21:48 +01:00
Mark Olesen
672f0574e2 COMP: resolve signed/unsigned long ambiguity on Darwin 2018-04-24 13:17:22 +02:00