Commit Graph

26560 Commits

Author SHA1 Message Date
Mark Olesen
97668eab26 STYLE: update noexcept and default construct for signals
- eliminate ClassName in favour of simple debug

- include Apple-specific FPE handling after local definition
  to allow for more redefinitions

COMP: remove stray <csignal> includes
2023-08-18 15:42:18 +02:00
Mark Olesen
b620152191 ENH: add UPstream::msgType() setter method and UPstream::incrMsgType()
- like UPstream::parRun() etc, returns old value
2023-08-18 15:08:42 +02:00
Mark Olesen
03ca52b036 ENH: PtrList, PtrDynList, HashPtrTable try_emplace() method
- naming like std::map::try_emplace(), it behaves like emplace_set()
  if there is no element at the given location otherwise a no-op

ENH: reuse existing HashPtrTable 'slot' when setting pointers

- avoids extra HashTable operations
2023-08-18 13:55:32 +02:00
Mattijs Janssens
11a1f78338 Merge branch 'feature-delayed-compound-reading' into 'develop'
Extend ITstream handling and provision for delayed reading of compound tokens

See merge request Development/openfoam!621
2023-08-17 08:16:56 +00:00
Mark Olesen
268de43afc ENH: provision for delayed reading of compound tokens (#2953)
- the construction of compound tokens is now split into two stages:
    - default construct
    - read contents
  This permits a larger variety of handling.

- the new token::readCompoundToken(..) method allows for simpler
  more failsafe invocations.

- forward resize(), read() methods for compound tokens to support
  separate read and population.
  Top-level refCompoundToken() method for modify access.

ENH: split off a private readCompoundToken() method within ISstream

- this allows overloading and alternative tokenisation handling for
  derived classes
2023-08-16 16:22:17 +02:00
Mark Olesen
43f8b477b7 ENH: additional ITstream access/manipulate methods
- simplifies iteration of ITstream using nRemainingTokens() and skip()
  methods or directly as a list of tokens.

  The currentToken() method returns const or non-const access to
  the token at the current tokenIndex.

  The peekToken(label) method provides failsafe read access to tokens
  at given locations.

ENH: add primitiveEntry construct with moving a single token
2023-08-16 16:22:17 +02:00
Andrew Heather
bbbab8a9c2 Merge branch 'feature-container-algorithms' into 'develop'
Increase usage of std algoritms within the OpenFOAM List classes. Remove reliance on linked-list during reading

See merge request Development/openfoam!620
2023-08-16 12:58:09 +00:00
Mark Olesen
2422e6f061 ENH: use std algorithms for copy/move/compare within List containers
ENH: add List resize_fill variant. Fuses resize_nocopy + uniform fill

COMP: avoid cast ambiguity when assigning Foam::zero to UList<char>
2023-08-16 12:28:12 +02:00
Mark Olesen
eeb9d144e3 STYLE: qualify Swap with Foam:: prefix (visibility)
- drop unnecessary Foam::Swap specializations when MoveConstructible
  and MoveAssignable already apply. The explicit redirect to swap
  member functions was needed before proper move semantics where
  added.

  Removed specializations: autoPtr, refPtr, tmp, UList.
  Retained specialization: DynamicList, FixedList.

     Special handling for DynamicList is only to accommodate dissimilar
     sizing template parameters (which probably doesn't occur in
     practice).
     Special handling for FixedList to apply element-wise swapping.

- use std::swap for primitives. No need to mask with Foam::Swap wrapper
2023-08-16 12:28:09 +02:00
Mark Olesen
fabd3f4e0c ENH: eliminate reliance on SLList during reading
- fully implement DynamicList::readList() instead of simply
  redirecting to List::readList(). This also benefits DynamicField.
  Leverage DynamicList reading to simplify and improve CircularBuffer
  reading.

- bracket lists are now read chunk-wise instead of using a
  singly-linked list. For integral and vector-space types
  (eg, scalar, vector, etc) this avoids intermediate allocations
  for each element.

ENH: add CircularBuffer emplace_front/emplace_back

STYLE: isolate to-be-deprecated construct/assign forms

- still have construct/assign FixedList from a C-array.
  This is not really needed, can use std::initializer_list

- still have construct/assign List from SLList.
  Prefer to avoid these in the future.

DEFEATURE: remove construct/assign FixedList from SLList

- never used

DEFEATURE: remove move construct/assign List from SLList

- now unused. Retain copy construct/assign from SLList for transition
  purposes.
2023-08-16 12:27:04 +02:00
mattijs
7828067ef6 BUG: snappyHexMesh: support dryRun. Fixes #2959 2023-08-14 13:01:42 +01:00
Andrew Heather
53b3fff7d5 Merge branch 'feature-pTraits-vectorspace' into 'develop'
Extend traits to include VectorSpace tests and wrapped access to pTraits static members

See merge request Development/openfoam!619
2023-08-11 12:40:00 +00:00
Mark Olesen
066a5a997a CONFIG: update compiler minimums (gcc-7.5.0) and standard (c++14) 2023-08-11 10:50:13 +02:00
Mark Olesen
4daaf6dd2a ENH: support move sematics for get/set putback token 2023-08-10 16:39:31 +02:00
Mark Olesen
944840f8d6 ENH: polyMesh/faMesh hasGlobalData() query
- test for existing globalData() or perhaps use DIY globalIndex instead

STYLE: check for non-ASCII instead of BINARY with compression

- allows for other non-ASCII formats
2023-08-10 16:39:25 +02:00
Mark Olesen
1340bc50bd STYLE: qualify zero/one dispatch tags with Foam:: prefix
- use Foam::zero{} instead of Zero with tagged re-dispatch
2023-08-10 11:51:04 +02:00
Mark Olesen
97a42df7ba ENH: add VectorSpace trait tests and evaluations
- is_vectorspace :
  test existence and non-zero value of the Type 'rank' static variable

- pTraits_rank :
  value of 'rank' static variable (if it exists), 0 otherwise

- pTraits_nComponents :
  value of 'nComponents' static variable (if it exists), 1 otherwise

- pTraits_has_zero :
  test for pTraits<T>::zero member, which probably means that it also
  has one, min, max members as well

Note that these traits are usable with any classes. For example,

  - is_vectorspace<std::string>::value  ==> false
  - pTraits_nComponents<std::string>::value  ==> 1
  - pTraits<std::string>::nComponents  ==> fails to compile

  Thus also allows testing pTraits_rank<...>::value with items
  for which pTraits<...>::rank fails to compile.

  Eg, cyclicAMIPolyPatch::interpolate called by FaceCellWave with a
  wallPoint.

     pTraits<wallPoint>::rank ==> fails to compile
     is_vectorspace<wallPoint>::value ==> false

GIT: relocate ListLoopM.H to src/OpenFOAM/fields/Fields (future isolation)
2023-08-10 10:38:39 +02:00
Andrew Heather
5eacd8257b Merge branch 'feature-subsetMesh-exclude-patches' into 'develop'
Support select/ignore patches for subsetMesh, extend select/ignore to general selection (#2947)

See merge request Development/openfoam!618
2023-08-02 15:06:45 +00:00
Mark Olesen
aad4c2222e ENH: subsetMesh -exclude-patches (#2947)
STYLE: use -exclude-patches instead of -excludePatch for other utilities

- avoids inconsistencies with utilities like foamToVTK etc.
2023-08-02 12:35:10 +02:00
Mark Olesen
14f7d44ca0 ENH: patch/zone indices with select/ignore combination
STYLE: prefer indices() to patchSet() with warn=false
2023-08-02 12:34:41 +02:00
Andrew Heather
db39f196cc Merge branch 'update-selection-ordering' into 'develop'
Updates to function objects handling of patches / selection names for parallel consistent order

See merge request Development/openfoam!617
2023-08-01 15:26:42 +00:00
Mark Olesen
2fc2d1f95f TUT: missing ';' for solverInfo 2023-07-31 20:11:32 +02:00
Mark Olesen
db16d80840 ENH: use objectRegistry/IOobjectList sorted instead of lookupClass
- in most cases a parallel-consistent order is required.
  Even when the order is not important, it will generally require
  fewer allocations to create a UPtrList of entries instead of a
  HashTable or even a wordList.
2023-07-31 20:11:32 +02:00
Mark Olesen
d65e2d89b5 ENH: use MinMax for bounds management in binModels (code simplication) 2023-07-31 20:11:32 +02:00
Mark Olesen
dc95242cd2 ENH: use sorted order for fieldSelection::selectionNames() (#2819)
- return a sorted wordList instead of a wordHashSet to ensure that
  fields will be processed in consistent order in parallel
2023-07-31 20:11:32 +02:00
Mark Olesen
ed314b2740 ENH: use sorted order for patch IDs in fieldFunctionObjects (#2819)
- replaces labelHashSet with a sorted labelList to ensure that patches
  will be processed in consistent order in parallel
2023-07-31 20:11:32 +02:00
Mark Olesen
5397c9ac04 COMP: use csorted() instead of sorted() 2023-07-31 20:11:32 +02:00
Mark Olesen
129b738136 ENH: define IOobjectList::csorted(), deprecate some sorted() const methods
- prefer csorted() method for const access since it ensures that the
  return values are also const pointers (for example) even if
  the object itself can be accessed as a non-const.

- the csorted() method already existed for HashTable and
  objectRegistry, but now added to IOobjectList for method name
  consistency (even although the IOobjectList only has a const-access
  version)

ENH: objectRegistry with templated strict lookup

- for lookupClass and csorted/sorted. Allows isType restriction as a
  compile-time specification.
2023-07-31 20:11:32 +02:00
Mark Olesen
0eb4354ee0 ENH: use DynamicList for handling stored objects (ReadFields)
- DynamicList can be used as a LIFO with fewer allocations than a
  linked-list would have.

- support generic name matcher for readFields()
2023-07-31 20:11:32 +02:00
Mark Olesen
f18a29a742 ENH: subsetMesh suppress wildcard selection of processor patches (#2947) 2023-07-31 14:07:17 +02:00
Mark Olesen
36161e682a STYLE: FOAM_DEPRECATED_FOR instead of FOAM_DEPRECATED
- explains what the preferred replacement should be
2023-07-31 14:07:10 +02:00
Andrew Heather
a3ec19c344 Merge branch 'update-emplace' into 'develop'
refine PtrList and other emplace methods

See merge request Development/openfoam!616
2023-07-28 14:41:15 +00:00
Mark Olesen
4dfafc3c36 ENH: store sorted mesh pointers for vtkWrite, areaWrite
- replaces HashTable of pointers
2023-07-27 16:52:03 +02:00
Mark Olesen
945e3e41b1 ENH: more consistent use of good() or direct testing instead valid() 2023-07-27 16:52:03 +02:00
Mark Olesen
76efcba4c7 ENH: simpler handling of dictionary start/end line numbers
STYLE: use front(), back(), push_front(), push_back() methods
2023-07-27 16:52:03 +02:00
Mark Olesen
7cae3b9660 ENH: add HashTable zero-size construct, move construct is noexcept
BUG: HashTable::operator+= self-assignment check was being ignored

STYLE: minor code cleanup for templated Dictionary types
2023-07-27 16:52:03 +02:00
Mark Olesen
8117cde596 ENH: use emplace_set, emplace_back to simplify code
- eg, for cloud fields, tmp emplace when reading fields etc.
2023-07-27 16:52:03 +02:00
Mark Olesen
63258d0b33 ENH: refine PtrList emplace method, add emplace for autoPtr/refPtr...
* resize_null() methods for PtrList variants
  - for cases where an existing PtrList needs a specific size and
    but not retain any existing entries.

    Eg,
        ptrs.resize_null(100);

    vs.   ptrs.free();     ptr.resize(100);
    or    ptr.resize(100); ptrs.free();

* remove stored pointer before emplacing PtrList elements
  - may reduce memory peaks

* STYLE: static_cast of (nullptr) instead of reinterpret_cast of (0)

* COMP: implement emplace_set() for PtrDynList
  - previously missing, which meant it would have leaked through to the
    underlying PtrList definition

* emplace methods for autoPtr, refPtr, tmp
  - applies reset() with forwarding arguments.
    For example,

        tmp<GeoField> tfld = ...;

    later...

        tfld.emplace(io, mesh);

    vs.
        tfld.reset(new GeoField(io, mesh));
    or
        tfld.reset(tmp<GeoField>::New(io, mesh));

    The emplace() obviously has reduced typing, but also allows the
    existing stored pointer to be deleted *before* creating its
    replacement (reduces memory peaks).
2023-07-27 16:52:03 +02:00
Mark Olesen
5e334c0686 ENH: more consistent use of AMIInterpolation distributed() query 2023-07-27 16:52:03 +02:00
Mark Olesen
32903d337e ENH: add slice/range support to UPstream::waitSomeRequests()
- this simplifies polling receives and allows separation from
  the sends

ENH: add UPstream::removeRequests(pos, len)

- cancel/free of outstanding requests and remove segment from the
  internal list of outstanding requests
2023-07-27 16:52:03 +02:00
Mark Olesen
f717f79833 ENH: simplify copy/filling of List containers. Make swap noexcept
- internal use of std::fill instead of legacy manual code

- use UList<T>::deepCopy() to reduce code duplication
2023-07-27 16:41:13 +02:00
Mark Olesen
3430ab3aa8 STYLE: add reset() method for labelRange for symmetry with MinMax 2023-07-26 18:48:45 +02:00
Mark Olesen
779c3fe11e STYLE: use 'is_sorted()' instead of 'sorted()' for readers, Pair, ...
- avoids naming ambiguity between querying sorted state vs returning a
  sorted list (for example)

ENH: add 'good()' method to a few more classes
2023-07-19 14:10:31 +02:00
Mark Olesen
8562f4d7a4 STYLE: use UPtrList::test() instead of separate bounds checking 2023-07-19 14:10:31 +02:00
Mark Olesen
65cddb6120 ENH: specialise bitOr<unsigned char> reduction
STYLE: remove extraneous parRun check before Pstream::combineReduce

- already handled by Pstream::combineReduce itself

STYLE: remove deprecated globalMeshData::ListPlusEqOp

- deprecated/superseded by ListOps::appendEqOp (2020-09)

STYLE: qualify stream format with IOstreamOption (easier to find)
2023-07-19 14:06:23 +02:00
Mattijs Janssens
95b820368c Merge branch 'feature-writeLeakFaces' into 'develop'
ENH: snappyHexMesh: write leak-closure faces

See merge request Development/openfoam!615
2023-07-19 11:58:09 +00:00
mattijs
ab0d4d95ff ENH: snappyHexMesh: write leak-closure faces 2023-07-19 12:55:02 +01:00
mattijs
a8df552998 ENH: checkMesh: use built-in merging 2023-07-18 12:03:58 +01:00
Kutalmis Bercin
edb455ca97 TUT: weightedFluxExample: correct plot indices (fixes #2940) 2023-07-13 16:07:49 +01:00
Volker Weißmann
ae6de092d5 ENH: update vscode-settings (fixes #2935) 2023-07-06 16:23:53 +01:00