Commit Graph

939 Commits

Author SHA1 Message Date
0ba4f36c60 ENH: use List containers for Pstream read/write calls
- using the List containers, and not their low-level data_bytes(),
  size_bytes() methods is more convenient and allows future
  adjustments to be centralized

ENH: trivial intptr_t wrapper for MPI_Win

STYLE: minor adjustments to mpirunDebug
2025-02-11 11:09:30 +01:00
e1d40646cc ENH: use unique_ptr instead of raw pointers for demand-driven data
- simplifies construct/destruct and any later code extensions
2025-02-05 09:43:52 +00:00
cf2b305b4f ENH: upgrade to use some C++17 constructs
- 'if constexpr (...)'
   * instead of std::enable_if
   * terminate template recursion
   * compile-time elimination of code

- use C++14 '_t', '_v' versions,
  eg, std::is_integral_v<T> instead of std::is_integral<T>::value

- std::begin, std::end, std::void_t instead of prev stdFoam versions

- provide is_contiguous_v<..> as short form of is_contiguous<..>::value
  with the additional benefit of removing any cv qualifiers.

ENH: include is_rotational_vectorspace trait

- tests for vector-space and nComponents > 1 (ie, not sphericalTensor)

ENH: improve robustness of pTraits_.. tests by removing cv qualifiers
2025-01-31 09:51:44 +01:00
de5d34787c ENH: snappyHexMesh: add buffer layers before snapping 2024-12-12 16:13:32 +00:00
96db337a99 ENH: more unique tags to avoid overlapping comms 2024-11-27 12:33:28 +00:00
cfdc2330eb ENH: polyBoundaryMesh: use patchID() if available. See #3233 2024-11-04 16:16:05 +00:00
c61466b6e5 ENH: polyPatch cached areaFraction setter with uniform fraction
STYLE: polyPatch cached areaFraction as std::unique_ptr

- more consistent with other demand-driven data.
  Getter now returns tmp field instead of const reference.
2024-06-03 11:55:01 +01:00
056bb4f0a0 FaceCellWave: travel through coupled ACMI. See #3139 2024-05-30 15:15:56 +00:00
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
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
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
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
688fd5f3f1 ENH: add separate handling for clearing mesh phi
STYLE: update code style for phi modification (engine motion)

ENH: pass isMeshUpdate param in fvMesh/polyMesh clearOut() methods

- top-level use of isMeshUpdate parameter to clearOut and
  clearAddressing was being inadvertently filtered out
2024-04-16 10:18:08 +02:00
68c5d90ad0 STYLE: rename readContents -> readIOcontents for private/protected method
- leave 'readContents' method name for exposed (public) methods.
  Generally not a problem, but can confuse the compiler when various
  public/private versions are available with the same number of
  parameters.

STYLE: adjust meshObject debug statements
2024-04-10 15:55:29 +02:00
c6ecf3113a COMP: syncTools: move attribute 2024-03-20 09:32:43 +00:00
a431e0fe9a ENH: additional parRun selection/protection on syncTools
- allow more control over using parallel communication or not.
2024-03-18 20:59:21 +01:00
6d69506294 STYLE: adjust comments and iterator de-reference
STYLE: replace PackedListCore.H with in-file definition
2024-03-18 20:59:21 +01:00
bc03a538cf ENH: mapDistribute: improved error message 2024-03-18 10:44:54 +00:00
3973cf7a83 Feature overlapping zones 2024-03-13 14:44:13 +00:00
7006056eae ENH: remove blocking communication for gather patterns
ENH: eliminate unnecessary duplicate communicator

- in globalMeshData previously had a comm_dup hack to avoid clashes
  with deltaCoeffs calculations. However, this was largely due to a
  manual implementation of reduce() that used point-to-point
  communication. This has since been updated to use an MPI_Allreduce
  and now an MPI_Allgather, neither of which need this hack.
2024-03-06 11:10:54 +01:00
8b793f8866 ENH: add global point/face/cell addressing to globalMeshData (#3108)
- permits reuse in other places without subsequent communication
2024-02-24 21:08:01 +01:00
337e672d53 ENH: extend globalMeshData::calcCellCells handling
- add convenience forms for common combinations

- avoid allocation for 1:1 identity agglomerations

- support subsetting forms (avoids an intermediate fvMeshSubset)
  that also return the cellMap

- refactored to eliminate code duplication between weighted and
  unweighted forms
2024-02-24 21:07:58 +01:00
04d880e2ce STYLE: use send/recv serializers for globalIndex and mapDistribute etc 2024-02-24 19:51:24 +01:00
4f43f0302d ENH: additional Map/HashTable constructors and ListOp functions
- construct Map/HashTable from key/value lists.

- invertToMap() : like invert() but returns a Map<label>,
  which is useful for sparse numbering

- inplaceRenumber() : taking a Map<label> for the mapper

ENH: construct/reset CStringList for list of C-strings
2024-02-23 18:10:48 +01:00
21196d8c0b ENH: use tmp field factory methods [1] (#2723)
- src/OpenFOAM, src/meshTools, src/mesh, src/dynamicMesh, src/sampling
  src/topoChanger src/overset src/fvMotionSolver
2024-02-21 14:31:39 +01:00
d6781b91fe Merge remote-tracking branch 'origin/master' into develop 2024-02-01 13:15:51 +00:00
62524b140c BUG: protected division - fixes #3084 2024-01-15 15:10:24 +00:00
bb16c493b7 Code adjustments to avoid gcc-13 warnings about dangling references 2024-01-11 10:08:45 +00:00
0352a224b7 COMP: access transformedElements by reference, not copy
- better code style and seems to avoid triggering a gcc warning about
  possibly uninitialized values

COMP: JSONformatter writeEntry missing a return value

STYLE: accept 'json' for checkMesh write format

- consistent with caseInfo functionObject
2023-12-15 16:17:15 +01:00
05f2d54979 ENH: masterCoarsest: demo case for processorAgglom. See !645 2023-12-11 12:28:08 +00:00
8ae0056edd ENH: GAMG: processor agglomeration extended for all interfaces 2023-12-07 17:33:29 +00:00
ca25929372 ENH: minor simplifications for handling region meshes
- static version of polyMesh::meshDir(), which takes a region name

      polyMesh::meshDir(regionName)
  vs
      polyMesh::regionName(regionName)/polyMesh::meshSubDir

STYLE: use polyMesh::regionName(..) instead of comparing to defaultRegion

STYLE: use getOrDefault when retrieving various -region options

FIX: polyMesh::dbDir() now checks registry name, not full path (#3033)
2023-12-07 17:42:24 +01:00
09fdeaa38a ENH: more consistent use of endEntry (issue #3035)
- enables capturing of end entry as an event
2023-12-07 17:42:24 +01:00
2de1a26c7b STYLE: indentation, comments
ENH: additional faMesh cleanup in CleanFunctions
2023-12-07 17:42:24 +01:00
c7a639d0dd ENH: polyMeshCheck - added mesh quality metrics to meshState dictionary
Quality metrics, e.g. non-orthogonality, skewness etc are calculated/reported
in polyMeshCheck functions. These results are now added to the meshState/mesh
dictionary to enable external access.
2023-12-01 11:54:35 +00:00
79cd147de0 STYLE: Refactoring use of meshState in {fv|faMesh}
{fv|fa}Mesh classes inherited the [old] data class (renamed meshState)
- meshState removed from inheritance list and added as data members
2023-12-01 11:54:35 +00:00
85243dc89d ENH: provide referPatchID() at the coupled patch level (simplifies code)
- the default returns -1 (ie, not found/available). This is overridden
  by processorCyclicPolyPatch to actually perform a search

COMP: explicitly define polyMesh::writeObject in the header

- currently no special treatment, but allows future adjustments
  without affecting the header.
2023-11-15 11:11:35 +01:00
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
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
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
05c66ae62d ENH: reduce overhead for readUpdate of mesh zones 2023-10-17 12:33:03 +02:00
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
d9727fad1c ENH: use updated HashTable methods 2023-10-11 18:11:37 +00:00
524c953af3 STYLE: use List clear() instead of setSize(0), resize(0)
- adds some consistency
2023-10-11 18:11:37 +00:00
539d538d5a ENH: mapDistribute consistency improvements
- nonBlocking: receive before send

- nonBlocking: wait for receive requests, process and then wait for
  other requests. Can be extended to use polling...

- the 'fake' send (to self) now send copies into recv buffers instead
  of send buffers.
  This provides a clear separation of send and receive fields

- avoid unnecessary reallocations with PtrList of send/recv buffers

- remove outer looping for accessAndFlip and pass target field
  as parameter for inner looping instead

ENH: refine mapDistribute send/recv requests handling

- separate send/recv requests for finer control
- receive does not need access to PtrList of sendBuffers, since the
  send-to-self now uses the recvBuffers
2023-08-30 13:39:16 +00:00
b931772369 ENH: mapDistribute subMapTotalSize(), constructMapTotalSize()
- the sum of the respective list sizes

COMP: add noexcept to trivial mapDistribute constructors
2023-08-30 13:39:16 +00:00
698e05eeb3 STYLE: prefer push_uniq() to appendUniq
- more consistency with push_back etc.
2023-08-29 11:24:16 +02:00
2395e493d1 ENH: simplify add/remove patch/zone groups
STYLE: reuse polyBoundaryMesh patchSizes(), patchStarts()
2023-08-29 11:24:16 +02:00
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
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