Commit Graph

26669 Commits

Author SHA1 Message Date
Mark Olesen
6103303b9a CONFIG: wmakeLnInclude with '-extra' option
- enables symlink for .cpp and .cxx source files
2023-11-08 22:08:16 +01:00
Mark Olesen
7766854a7e BUG: stringOps::split with keepEmpty accidentally ignores non-empty trailing
- fixes #3025
2023-11-08 15:44:36 +01:00
Mattijs Janssens
0e3bb22088 Merge branch 'IOobject-global-paths' into 'develop'
ENH: additional handling for global (non-processor) time paths

See merge request Development/openfoam!638
2023-11-08 10:12:23 +00:00
Mark Olesen
41b6794e2d ENH: add global (serial) path accessor to IOobject (#3007)
- new methods added to IOobject to ease mixed (serial vs parallel)
  file locations. Some redirect to Time, others are defined for
  IOobject only.

    | "normal" (serial/parallel) | "global" (serial locations) |
    | ---------------------------|-----------------------------|
    | caseName()                 | globalCaseName()            |
    | path()                     | globalPath()          *new* |
    | path(...)                  | globalPath(...)       *new* |
    | objectPath()               | globalObjectPath()    *new* |
2023-11-07 11:52:09 +01:00
Mark Olesen
507805c330 ENH: partly align globalIndex and CompactListList methods
- CompactListList::size() corresponds to the number of sub-lists
  whereas globalIndex::size() corresponds to the totalSize().
  This difference can lead to potential coding errors when switching
  between pure addressing (eg globalIndex) and addressing with content
  (eg, CompactListList).

  Within the source tree, there are no longer any occurances of
  globalIndex::size() but it is nonetheless unsafe to change its
  meaning now. Instead provide a commonly named length() method that
  corresponds to the natural length: ie, the number of offsets minus 1
  (with guards).

- add CompactListList::writeMatrix for writing the compact contents
  in an unpacked form (eg, for debugging) without actually needing to
  unpack into storage.

- provide globalIndex::whichProcID() two-parameter version
  with myProcNo as the first argument.
  Symmetric with isLocal etc, useful when using a communicator
  that is not worldComm.
2023-11-07 10:33:47 +01:00
Mark Olesen
269be2f4ea ENH: provide Time::NewGlobalTime factory methods (#3007)
- avoids clutter of argList::envGlobalPath() ...

ENH: allow temporary overwriting of output writeFormat

- allows switching for particular output routines

COMP: explicitly use TimePaths methods with Time

- this simplifies any overloading done at a later stage
2023-11-07 10:33:47 +01:00
Mark Olesen
0338cf9a84 REVERT: unstable MPI_Mprobe/MPI_Mrecv on intelmpi + PMI-2 (#2796)
- remnant was left in the NBX implementation for Map<Type>.

  Still not entirely certain which vendors/versions handle message
  probe/recv properly, but using the "regular" probe and recv is OK
  since everything is without threaded race conditions.

STYLE: adjust file extension of UPstreamWrapping templates

- avoids it being exposed via lnInclude
2023-11-07 10:33:47 +01:00
Mark Olesen
07dcdefa02 ENH: support creation of boundaries/zones from list of entries
- this makes it easier to split creation into a two-stage process
  as required

- extend handling for polyBoundaryMeshEntries, faBoundaryMeshEntries
  with more functionality. Ensure that these are never registered.

ENH: addition writeEntry methods for polyBoundaryMesh

- simplifies streaming and collating into other files

ENH: polyMesh rereading - update owner/neighbour header information

- this avoids accidentally reading the "cells" file if the mesh has
  been created with NO_READ and then updated

STYLE: less vertical space when outputting empty PtrList
2023-11-07 10:33:47 +01:00
Mark Olesen
08a9b03891 ENH: polyBoundaryMesh additional faces() and faceOwner() slice methods
- return a subList view of the mesh faces, owners
2023-11-07 10:33:47 +01:00
Mark Olesen
98246a438e ENH: simplify calling of decomposition, support CompactListList
- combined most of the unweighted and weighted decomposition routines
  such that an empty weight field is treated as uniform weighting.
  This allows default parameters and cuts down on the number of
  decompose methods.

- for topology-driven decomposition, it is now possible to pass in the
  owner/neighbour connectivity as a CompactListList directly instead
  of first creating a labelListList (which was internally repacked into
  a CompactListList in many cases).
  However, multiLevelDecomp still uses unpacking (to avoid a larger
  reworking of code).

- support direct creation of some methods (eg, random, scotch etc)
  without a dictionary

- fix incorrect neighbour face weighting (fixes #3019)

ENH: relocate calcCellCells from decompositionMethod to globalMeshData

- makes it more universally available
2023-11-07 10:33:47 +01:00
Mark Olesen
546b204793 COMP: split endian.H into foamEndianFwd.H and foamEndian.H
- usually only need big/little defines (which are now in the Fwd)
  and rarely need byte-swapping.

  Provide endian.H compatibility include, but foamEndianFwd.H or
  foamEndian.H to avoid potential name clashes.
2023-11-07 10:33:47 +01:00
Mark Olesen
98ccb7df6b ENH: extend VectorSpace traits to include pTraits_cmptType
- The pTraits_cmptType returns the data type of 'cmptType' (for
  arithmetic and VectorSpace types) or is simply a pass-through.

  This can be combined with the pTraits_nComponents for casting.
  For example,

  function
  (
      reinterpret_cast<pTraits_cmptType<Type>::type*>(buf.data()),
      (buf.size()/pTraits_nComponents<Type>::value)
  );

ENH: extend Foam::identityOp so support array indexing (pass-through)
2023-11-07 10:33:47 +01:00
Mark Olesen
df8efcaf62 REGRESSION: registry filtering not using regIOobject name (fixes #3023)
- was using the derived object name (could be something like "region0")
  instead of the actual registered name (ie, the regIOobject name)
2023-11-07 10:33:47 +01:00
DaveD
ad2389a37d BUG: foamMeshToFluent: improve compatibility with tmerge (fixes #2820) 2023-11-03 16:26:57 +00:00
Andrew Heather
8f54827d19 Merge branch 'feature-map-constraint' into 'develop'
ENH: Moving electric sources mapped from external meshes

See merge request Development/openfoam!630
2023-11-03 14:33:10 +00:00
Kutalmis Bercin
4fa1f723eb ENH: MapFieldConstraint: new fvOption constraint 2023-11-03 14:32:49 +00:00
Kutalmis Bercin
ef6fa8007a ENH: cellSetOption: enable dictionary-based updates of selections 2023-11-03 14:32:49 +00:00
Kutalmis Bercin
f54400d5cc ENH: cellSetOption: add new selectionMode for moving points 2023-11-03 14:32:49 +00:00
Kutalmis Bercin
f3d939fa10 ENH: electricPotential: add finite-volume constraint hook 2023-11-03 14:32:49 +00:00
Kutalmis Bercin
a50ee8e2d2 BUG: electricPotential: correct return value of read function 2023-11-03 14:32:49 +00:00
mattijs
6373dfd6ac COMP: linear: duplicate filename in same library 2023-11-02 14:23:31 +00:00
Mark Olesen
dc7d0ffeaa ENH: add face/triFace find(edge) method (#3004)
- returns the edge index within the face, -1 if not found
2023-10-27 13:48:18 +02:00
Mark Olesen
29e2718162 ENH: add face/triFace contains(edge) method (#3004)
STYLE: use contains() and reduce reliance on edgeDirection -1/+1 values
2023-10-26 14:11:28 +02:00
Mark Olesen
b34793c392 ENH: additional globalIndex methods and helpers
- single() method : simply tests if the globalIndex has nProcs == 1,
  which is typically from a gatherNone invocation.
  For example,

     globalIndex gi;
     if (...) gi.reset(localSize);
     else     gi.reset(globalIndex::gatherNone{}, localSize);

     // later...
     const label begin = (gi.single() ? 0 : gi.localStart());
     const label count = (gi.single() ? gi.totalSize() : gi.localSize());

- add front() and back() methods to return the begin/end ranges,
  and begin_value(), end_value() - as per labelRange.

- make more methods noexcept

- calcOffset(), calcRange() helper functions to determine
  the processor-local of a numbering range without the overhead of
  creating a list of offsets.

  For example,

     label myOffset = globalIndex::calcOffset(mesh.nCells());
     labelRange mySlice = globalIndex::calcRange(mesh.nCells());

- add globalIndex localEnd() as per CompactListList method

STYLE: align looping constructs in CompactListList with List

- make more methods noexcept
2023-10-26 14:03:39 +02:00
Mark Olesen
d9f0587416 ENH: promote ListOps::identity to Foam::identity
- becoming more frequently used and there is no ambiguity in calling
  parameters either - identity(label) vs identity(labelUList&).

  Provide both int32 and int64 versions.
2023-10-26 11:24:57 +02:00
Mark Olesen
ef92d31493 ENH: construct labelRange from begin/end value pair 2023-10-26 11:11:48 +02:00
Mark Olesen
1faa143a7c ENH: expose fieldNames() selection for sampledSets/sampledSurfaces
- consistent with probes. Allows reporting/querying
2023-10-26 09:19:18 +02:00
Mark Olesen
d296713af1 CONFIG: increment API level to 2308
- support for SpanStreams etc
2023-10-24 10:57:49 +02:00
Mark Olesen
0343ab00f3 DOC: add application/test/README.md
- extraction of Description from the respective tests.
  Relatively incomplete

  Uses the `application/tests/get-descriptions` extractor
2023-10-24 10:57:49 +02:00
Mark Olesen
870c6a6924 TEST: add standalone test application: Test-surface-sampling 2023-10-24 10:57:22 +02:00
Mark Olesen
1476de89ee ENH: add unary functor for Foam::zero
- acts somewhat like an identity op that 'swallows' its parameter
  and maps back to zero.
2023-10-23 15:28:34 +02:00
Mark Olesen
93f48d88ea STYLE: add scoping limit to Field macros 2023-10-23 15:28:08 +02:00
Mark Olesen
cfa6da5953 COMP: circumvent aggressive compiler branch optimization (clang-17)
- it seems that both sides of the ternary are evaluated despite
  the divide-by-zero protection. Use volatile to force the compiler
  to use in-order evaluation.
2023-10-23 15:27:58 +02:00
Mark Olesen
a7bb8edbad COMP: avoid issues with new compilers and/or new C++ standards
- prevent automatic comparison rewriting (c++20)
- no bitwise operations between different enumerations
- template instantiation

ENH: add DimensionedField Internal typedef (simplifies handling)
2023-10-23 09:45:41 +02:00
Mark Olesen
e4745d09ec STYLE: remove virtual from override-qualified methods (surfaceFeatureExtract) 2023-10-23 09:44:54 +02:00
Mark Olesen
32a8a30b8c CONFIG: bump paraview from 5.11.1 to 5.11.2 2023-10-20 10:29:41 +02:00
Andrew Heather
2b34412591 Merge branch 'ensight-timeFormat' into 'develop'
support user specification of ensight time format/precision (#2999)

See merge request Development/openfoam!634
2023-10-19 10:39:07 +00:00
Mark Olesen
ba2e774aac ENH: increase precision for ensight field cache (#2999)
- attempt to minimize rounding in the cached time values
  since these are also used to re-populate the case files

STYLE: remove ancient handling of "meshes" entry

- was superseded by "geometry" entry in OpenFOAM-1912 and later.
  Now remove the transitional shim, which was in place for
  restart migration from 1906.
2023-10-19 10:28:09 +00:00
Mark Olesen
3618d07134 ENH: support user-defined sampleFreq for noise models (#2999)
CONFIG: downgrade non-uniform time from error to warning

- can be a spurious error when the deltaT is very small

CONFIG: support keywords 'minFreq', 'maxFreq'

- these are the updated naming for 'fl' and 'fu' (still supported)
2023-10-19 10:28:09 +00:00
Mark Olesen
dafae668d1 ENH: support user specification of ensight time format/precision (#2999)
- new format option keywords: timeFormat, timePrecision

CONFIG: default ensight output is now consistently BINARY

- this removes some uncertainty with the ensightWrite functionObject
  which was previously dependent on the simulation writeFormat
  and makes its behaviour consistent with foamToEnsight

  Note: binary Ensight output is consistent with the
  defaults for VTP output (inline binary)

ENH: minor adjustment of ensight writing methods
2023-10-19 10:28:09 +00:00
Andrew Heather
8ec35d0b26 Merge branch 'update-zone-handling' into 'develop'
ENH: zone improvements

See merge request Development/openfoam!633
2023-10-19 10:23:14 +00:00
Mark Olesen
05c66ae62d ENH: reduce overhead for readUpdate of mesh zones 2023-10-17 12:33:03 +02:00
Mark Olesen
6aa8b82744 ENH: zone improvements
- retain group information when copying zones
- support construct empty (add details later)
- improve consistency for zone and boundaryMesh construction

- support front/back/both selection for faceZoneToCell

STYLE: prefer faceZone patch() method instead of operator()

STYLE: use std::unique_ptr instead of manual pointer management

- for zones and core patch types.
  Easier data management, allows default destructors (for example)
2023-10-17 12:33:03 +02:00
Mark Olesen
59c366525e ENH: add release() method to UPstream::communicator
- allows caller to take ownership of the communicator
2023-10-16 16:42:23 +02:00
Mark Olesen
c1e2fd6726 ENH: improve consistency of adding tokens to ITstream
- use add_tokens() instead of the old multi-parameter
  append(.., bool) method which was misleading since it added tokens
  at the current tokenIndex, not at the end.

- stringify ITstream contents with CharStream instead of StringStream.
  Allows string_view for copying out the content.

ENH: set namedDictionary dictionary name from Istream

- provides context for error messages etc (#2990)
2023-10-16 14:21:14 +02:00
Mark Olesen
fb26fcedfc STYLE: use getOrDefault instead of lookupOrDefault
- now mark methods with strict deprecation, to make it easier to find
  their use but without adding extra compilation noise for others

ENH: minor update for Enum methods and iterator

- add warnOnly (failsafe) option for readEntry and getOrDefault

- add good() method to Enum iterator (simliar to HashTable)

- replace unused/fragile Enum find() methods with iterator return
  that can be used more generally
2023-10-16 14:19:19 +02:00
Mark Olesen
3562565995 ENH: minor updates for globalIndex
- explicit use of UPstream::worldComm in globalIndex methods
  for more clarity

- adjust method declaration ordering:
  de-emphasize the processor-local convenience methods

- consistent use of leading tag dispatch,
  remove unused enum-based dispatch tag

- add begin()/cbegin() with offset (as per List containers)

BUG: missing use of communicator in globalIndex gatherNonLocal

- does not affect any existing code (which all use worldComm anyhow)
2023-10-13 14:44:18 +02:00
Mark Olesen
c65fac192e REGRESSION: incorrect fill range for ensight writeString
- introduced by b76595df42, only affects recent develop
2023-10-13 14:42:37 +02:00
Andrew Heather
fc9fb5c150 Merge branch 'update-stringIO-and-containers' into 'develop'
updates for resizing containers, reduced overhead for std::string output etc

See merge request Development/openfoam!632
2023-10-11 18:12:09 +00:00
Mark Olesen
0fb2c8eb1c STYLE: update applications/tests to use SpanStream/CharStream 2023-10-11 18:11:37 +00:00