Commit Graph

27105 Commits

Author SHA1 Message Date
Andrew Heather
74e118dd32 SUBMODULE: relocate community repos into plugins/ directory
- new landing place for general community repositories
2024-05-31 12:13:21 +01:00
Mark Olesen
01f501e8e7 CONFIG: increment API level to 2403 2024-05-30 17:30:25 +01:00
Andrew Heather
60ffaba71d Merge branch 'feature-FaceCellWave-cyclicACMI' into 'develop'
FaceCellWave: travel through coupled ACMI. See #3139

See merge request Development/openfoam!677
2024-05-30 15:15:56 +00:00
Mattijs Janssens
056bb4f0a0 FaceCellWave: travel through coupled ACMI. See #3139 2024-05-30 15:15:56 +00:00
Andrew Heather
30d2e2d3cf Merge branch 'feature-Function1-objectRegistry' into 'develop'
Function1: added 'lookup' Function1

See merge request Development/openfoam!676
2024-05-30 10:25:24 +00:00
Mattijs Janssens
c07997d816 Function1: added 'lookup' Function1 2024-05-30 10:25:24 +00:00
Kutalmış Berçin
495fa6c577 Merge branch 'feature-ensight-single-file' into 'develop'
Add support for reading ensight transient single-file format

See merge request Development/openfoam!682
2024-05-29 14:05:27 +00:00
Mark Olesen
dfc9a8923a ENH: read support for EnSight single-file transient (#3154)
- the ensightReadFile init() now automatically sets up binary/ascii
  (for geometry files) and checks for the transient "BEGIN TIME STEP"
  marker. If found, will also populate the file offsets for each of
  the timesteps.  If no corresponding footer is found (which would be
  very inefficient), it simply pretends that there is only a single
  time step instead of performing a costly file scan.

- parsing of the ensight case file now also supports the use of

      filename numbers:

  as an alternative to

      filename start number:
      filename increment:

- improved parsing robustness of "time values:" entry.
  Can now also have contents on the same line as the introducer.

ENH: base-level adjustments for writing transient single-file

- beginGeometry() is now separated out from file creation.

- in append mode, ensightFile and ensightGeoFile will attempt to
  parse existing time-step information.
2024-05-29 14:04:52 +00:00
Mark Olesen
ee895577ae ENH: improve OFstream append behaviour (#3160)
- previous support for file appending (largely unused) always
  specified opening with the std::ios_base::app flag.

  Now differentiate between append behaviours:

  APPEND_APP
  ~~~~~~~~~~
  Corresponds to std::ios_base::app behaviour:

  - Existing files will be preserved and a seek-to-end is performed at
    every write. With this mode seeks/repositioning within the file
    will effectively be ignored on output.

  APPEND_ATE
  ~~~~~~~~~~
  Largely approximates std::ios_base::ate behaviour:

  - Existing files will be preserved and a seek-to-end is performed
    immediately after opening, but not subsequently. Can use seekp()
    to overwrite parts of a file.
2024-05-29 14:04:52 +00:00
Mattijs Janssens
9f032057b4 Merge branch 'feature-blockLevel-rays' into 'develop'
ENH: shm: blockLevel through ray-shooting

See merge request Development/openfoam!642
2024-05-29 10:11:19 +00:00
Mattijs Janssens
10b0c3cfca ENH: shm: blockLevel through ray-shooting 2024-05-29 10:11:18 +00:00
Andrew Heather
773548c283 Merge branch 'update-GeometricBoundaryField-evaluate' into 'develop'
Improve flexiblity of GeometricBoundaryField evaluate

See merge request Development/openfoam!683
2024-05-29 08:18:53 +00:00
Mark Olesen
9335b641f1 ENH: GeometricBoundaryField evaluate with specified communication type
- evaluate()
  the communication type is exposed as a parameter to allow for more
  tuning, but default parameter remains defaultCommsType so there is
  no change in behaviour for existing code

- evaluate_if()
  supports a general selection predicate

- evaluateSelected()
  now does initEvaluate() for all patches, waits and then calls
  evaluate(). This avoids potential deadlocks when multiple patches
  are inter-communicating.

ENH: align DimensionedField reading with GeometricField treatment

- use localIOdictionary to obtain the dictionary contents

ENH: update GeometricField code

- change GeometricField writeData() as primary output method
  (not operator<<) for better clarity of purpose

- use unique_ptr for GeometricField demand-driven data
2024-05-28 17:52:09 +01:00
Mark Olesen
ffc9894033 STYLE: more consistency in writeEntry() signatures
- boundary entries with writeEntry(const word&, ...) instead of
  writeEntry(const keyType&, ...) to match with most other
  writeEntry() signatures. Also, this content will not be used
  to supply regex matched sub-dictionaries.

STYLE: more consistent patch initEvaluate()/evaluate() coding
2024-05-28 17:50:03 +01:00
Mark Olesen
1406f9ec26 ENH: robuster handling of unknown stream/float formats 2024-05-23 21:13:14 +02:00
Mark Olesen
b81fe70830 ENH: extend readContents IO factory methods
- support wantedType for localIOdictionary::readContents()

- add readContents() for GlobalIOList, GlobalIOField
2024-05-23 13:51:53 +02:00
Mark Olesen
bbde236be5 ENH: simpler internal handling of stderr in message streams
- delay construction of message buffer

- OStringStream count() method to test if anything has been streamed

STYLE: explicit use of std::ios_base in IOstreams

- document the return information of set flag methods
2024-05-23 13:51:53 +02:00
Mark Olesen
3b9176665f ENH: add dictionary::findStream() - symmetric with findDict()
- can be used with this type of code:

  ITstream* streamPtr = dict.findStream(name);
  if (streamPtr)
  {
      auto& is = *streamPtr;
      ...
  }

  versus:

  const entry* eptr = dict.findEntry(name);
  if (eptr && eptr->isStream())
  {
      auto& is = eptr->stream();
      ...
  }

ENH: add findStream(), streamPtr(), isStream() to dictionary search

- symmetric with findDict(), dictPtr(), isDict() methods

STYLE: use findDict() instead of found() + subDict() pairing

COMP: define is_globalIOobject trait at top of IOobject header

- more visibility, permits reuse for specializations etc.
2024-05-23 13:51:53 +02:00
Mark Olesen
6a80d4de40 ENH: reduce boundary face queries in streamFunction
BUG: streamFunction used uninitialized values for symmetry patches

- related to 8a8b5db977 changes (#3144)

ENH: improve robustness of surface field flattening

- vtk::surfaceFieldWriter
2024-05-23 13:51:53 +02:00
Mark Olesen
3f1d181b42 COMP: provide GeometricFieldFwd.H for internal/boundary/full field
- simplifies forward declarations
2024-05-23 07:41:01 +02:00
Mark Olesen
8d649d1737 FIX: additional shell quoting for foamInstallationTest (fixes #3163)
- the PATH on WSL will usually contain spaces, so it needs quoting
2024-05-22 21:00:00 +02:00
Mark Olesen
21a84bdf91 Merge remote-tracking branch 'origin/master' into develop 2024-05-22 20:59:28 +02:00
mattijs
1ad1957c41 ENH: GAMG: bit more testing of procAgglom+cyclicAMI 2024-05-22 18:02:28 +01:00
Mark Olesen
4510067e63 CONFIG: bump patch level 2024-05-22 16:26:39 +02:00
mattijs
8cf757daf0 BUG: GAMG: processorAgglomeration not merging proc coeffs. Fixes #3172 2024-05-22 16:26:39 +02:00
mattijs
6581c5792a BUG: STL: cannot handle files > 2Gb. Fixes #3171 2024-05-22 16:25:37 +02:00
mattijs
03fb8f043e ENH: cyclicAMI: restart search with large bounding box. Fixes #3175 2024-05-22 12:37:32 +01:00
mattijs
45ec64e6c8 BUG: STL: cannot handle files > 2Gb. Fixes #3171 2024-05-20 12:17:04 +01:00
mattijs
eb17ff1ea3 DOC: cyclicPeriodicAMI: bit of comment 2024-05-18 12:55:55 +01:00
Kutalmis Bercin
a7538fab57 BUG: interfaceHeight: fix header writing to output files (fixes #3115) 2024-05-08 11:20:34 +01:00
Andrew Heather
4fb85d1f76 Merge branch 'update-Pstream-large-sends' into 'develop'
ENH: improve handling of multi-pass send/recv

See merge request Development/openfoam!680
2024-05-07 14:29:14 +00:00
Mark Olesen
d9c73ae489 ENH: improve handling of multi-pass send/recv (#3152)
- the maxCommsSize variable is used to 'chunk' large data transfers
  (eg, with PstreamBuffers) into a multi-pass send/recv sequence.

  The send/recv windows for chunk-wise transfers:

      iter    data window
      ----    -----------
      0       [0, 1*chunk]
      1       [1*chunk, 2*chunk]
      2       [2*chunk, 3*chunk]
      ...

  Since we mostly send/recv in bytes, the current internal limit
  for MPI counts (INT_MAX) can be hit rather quickly.

  The chunking limit should thus also be INT_MAX, but since it is
  rather tedious to specify such large numbers, can instead use

      maxCommsSize = -1

  to specify (INT_MAX-1) as the limit.
  The default value of maxCommsSize = 0 (ie, no chunking).

Note
~~~~
  In previous versions, the number of chunks was determined by the
  sender sizes. This required an additional MPI_Allreduce to establish
  an overall consistent number of chunks to walk. This additional
  overhead each time meant that maxCommsSize was rarely actually
  enabled.

  We can, however, instead rely on the send/recv buffers having been
  consistently sized and simply walk through the local send/recvs until
  no further chunks need to be exchanged. As an additional enhancement,
  the message tags are connected to chunking iteration, which allows
  the setup of all send/recvs without an intermediate Allwait.

ENH: extend UPstream::probeMessage to use int64 instead of int for sizes
2024-05-07 15:33:02 +02:00
Mark Olesen
e15d696a24 STYLE: use Perr instead of Pout for UPstream::debug and warnComm
- avoids polluting standard output for utilities such as
  foamDictionary etc
2024-05-07 14:45:10 +02:00
Mark Olesen
dbfd1f90b1 ENH: add single-time handling to timeSelector
- the timeSelector is often used to select single or multiple times
  (eg, for post-processing). However, there are a few applications
  where only a *single* time should be selected and set.

  These are now covered by this type of use:

      timeSelector::addOptions_singleTime();  // Single-time options
      ...
      // Allow override of time from specified time options, or no-op
      timeSelector::setTimeIfPresent(runTime, args);

   In some cases, if can be desirable to force starting from the
   initial Time=0 when no time options have been specified:

      // Set time from specified time options, or force start from Time=0
      timeSelector::setTimeIfPresent(runTime, args, true);

   These changes make a number of includes redundant:

     * addTimeOptions.H
     * checkConstantOption.H
     * checkTimeOption.H
     * checkTimeOptions.H
     * checkTimeOptionsNoConstant.H

ENH: add time handling to setFields, setAlphaField (#3143)

    Co-authored-by: Johan Roenby <>

STYLE: replace instant("constant") with instant(0, "constant")

- avoids relying on atof parse behaviour returning zero
2024-05-06 22:22:42 +02:00
Mark Olesen
883196981d ENH: add offset support to stringOps::split functions
- for example,

     string buffer = ...;
     SubStrings<string> split;
     {
         auto colon = buffer.find(':');

         if (colon != std::string::npos)
         {
             split = stringOps::splitSpace(buffer, colon+1);
         }
     }

    Not really possible with a substr() since that would create a new
    temporary which then disappears.  Similarly awkward to split and
    then scan for the ':' to decide how many to discard.

ENH: add pop_front() and pop_back() methods to SubStrings

- the content is trivial enough (a pair of iterators) and the total
  number of elements is usually reasonable short so that removal of
  elements is inexpensive

  For example,

     string buffer = ...;
     auto split = stringOps::splitSpace(buffer);

     if (!split.empty() && split[0].str() == "face")
     {
         split.pop_front();
     }
2024-05-02 17:53:53 +02:00
Mark Olesen
3fed41547f COMP: remove template-id for constructor/destructor
- not allowed in C++20

COMP: avoid hidden overloaded-virtual (edgeMesh, surfMesh)
2024-05-02 16:47:46 +02:00
Kutalmis Bercin
e22edc5dee STYLE: limitTemperature: consolidate standard output stream 2024-05-02 14:17:48 +01:00
Mark Olesen
0ef7589979 BUG: sampledMeshSurface sampling on "empty" patch fails
- requires a field size check when copying into the flat boundary
2024-05-02 10:24:28 +02:00
Mattijs Janssens
7dc9ccdcaa Merge branch 'update-Pstream-message-count' into 'develop'
Use MPI Get_elements_x() for message sizes

See merge request Development/openfoam!681
2024-04-29 10:25:30 +00:00
Mark Olesen
b2bbc15463 ENH: use MPI Get_elements_x() for message sizes (#3152)
- ensures more accurate values for message sizes than using
  MPI Get_count(), which trucates at INT_MAX

- add more/better error messages when trying to receive messages
  that exceed INT_MAX or the char buffer lengths
2024-04-29 10:22:24 +02:00
Mark Olesen
7b38b148fa STYLE: use PstreamBuffers default construct
- PstreamBuffers are nonBlocking by default, so no need to re-specify
2024-04-29 10:21:25 +02:00
Mark Olesen
7f355ba343 STYLE: communication name "buffered" instead of "blocking"
- "buffered" corresponds to MPI_Bsend (buffered send),
  whereas the old name "blocking" is misleading since the
  regular MPI_Send also blocks until completion
  (ie, buffer can be reused).

ENH: IPstream::read() returns std::streamsize instead of label (#3152)

- previously returned a 'label' but std::streamsize is consistent with
  the input parameter and will help with later adjustments.

- use <label> instead of <int> for internal accounting of the message
  size, for consistency with the underyling List<char> buffers used.

- improve handling for corner case of IPstream receive with
  non-blocking, although this combination is not used anywhere
2024-04-29 10:19:40 +02:00
mattijs
e1d45ec26e ENH: snappyHexMesh: more parallel consistency. See #2331 2024-04-25 15:52:41 +01:00
mattijs
690d02f9e8 ENH: snappyHexMesh: more parallel consistency. See #2331 2024-04-24 17:10:27 +01:00
Mattijs Janssens
31b74cd627 Merge branch 'update-fvsPatchFields-mappers' into 'develop'
Fix fvsPatchFields reading/writing the "value" entry

See merge request Development/openfoam!679
2024-04-24 12:35:11 +00:00
Mark Olesen
f04ccef588 ENH: improve code consistency for {cell,face,point}Mapper (#3147)
- robuster and more reliable determination of inserted objects
  (previous code could produce false positives).

  Now also determine the number of inserted objects within the
  constructor (instead of simply storing a bool). This allows reuse
  in the address calculations to reduce overheads there.

BUG: dodgy short-circuit logic for insertedObjectLabels()

- as a quick short-circuit it previously created as demand-driven
  pointer with a zero elements. However, this meant that if this code
  was called first (before any other addressing), subsequent calls to
  the addressing would fail.

BUG: bad logic and lookup for faAreaMapper (#3147)

- was using labelHashSet but returning a bool and set using the
  addressing using the unfiltered objects!
  This is a latent bug since interpolated/inserted faces not
  currently supported anyhow.

ENH: use std::unique_ptr for demand-driven data
2024-04-24 14:03:11 +02:00
Mark Olesen
8a8b5db977 BUG: fvsPatchFields reading/writing the "value" entry (fixes #3144)
- manual revert for 44d0fbd594.

  Unless required for post-processing the "value" entry should not
  written if it is not mandatory for reading.

  This is especially crucial with an 'empty' patch field where the
  field (size 0) has a different size from the patch.

- the changes made align fvsPatchField behaviour with fvPatchField
2024-04-24 14:03:02 +02:00
Mark Olesen
5fb1181bb2 SUBMODULE: update avalanche tutorials (for new finite-area locations) 2024-04-23 16:57:17 +02:00
Mark Olesen
411ac5fcfa ENH: adjust return type for token compound factory method
- return autoPtr<token::compound> instead of the derived type,
  otherwise cannot easily construct a token from it

ENH: additional typed version of refCompoundToken()

- symmetric with typed version of transferCompoundToken()
  and isCompound()

- add ITstream::findCompound<Type>() method.
  Useful for searching within token streams
2024-04-23 16:51:38 +02:00
Mark Olesen
880215e8e6 STYLE: use intermediate variable in openFoamTableReader 2024-04-23 12:16:52 +02:00