Commit Graph

20671 Commits

Author SHA1 Message Date
bcabe827f6 ENH: dedicated HashSetOps, HashTableOps namespaces
- relocated HashSetPlusEqOp and HashTablePlusEqOp to
  HashSetOps::plusEqOp and HashTableOps::plusEqOp, respectively

- additional functions for converting between a labelHashSet
  and a PackedBoolList or List<bool>:

  From lists selections to labelHashSet indices:

      HashSetOps::used(const PackedBoolList&);
      HashSetOps::used(const UList<bool>&);

  From labelHashSet to list forms:

      PackedBoolList bitset(const labelHashSet&);
      List<bool> bools(const labelHashSet&);
2018-03-06 11:41:34 +01:00
15f7260884 ENH: cleanup of ListOps, ListListOps. Adjustments to List, PackedList.
- relocated ListAppendEqOp and ListUniqueEqOp to ListOps::appendEqOp
  and ListOps::UniqueEqOp, respectively for better code isolation and
  documentation of purpose.

- relocated setValues to ListOps::setValue() with many more
  alternative selectors possible

- relocated createWithValues to ListOps::createWithValue
  for better code isolation. The default initialization value is itself
  now a default parameter, which allow for less typing.

  Negative indices in the locations to set are now silently ignored,
  which makes it possible to use an oldToNew mapping that includes
  negative indices.

- additional ListOps::createWithValue taking a single position to set,
  available both in copy assign and move assign versions.
  Since a negative index is ignored, it is possible to combine with
  the output of List::find() etc.

STYLE: changes for PackedList

- code simplication in the PackedList iterators, including dropping
  the unused operator() on iterators, which is not available in plain
  list versions either.

- improved sizing for PackedBoolList creation from a labelUList.

ENH: additional List constructors, for handling single element list.

- can assist in reducing constructor ambiguity, but can also helps
  memory optimization when creating a single element list.
  For example,

    labelListList labels(one(), identity(mesh.nFaces()));
2018-03-01 14:12:51 +01:00
ffd7b00ad5 ENH: fvMatrix::setReferences() single value variant 2018-03-02 13:27:34 +01:00
330b113abc BUG: incorrect cellId check in fvMatrix::setReferences() 2018-03-02 13:17:54 +01:00
53ab527b45 ENH: added constexpr, noexcept for bool, Switch
- rationalized some method naming.
  Eg, c_str() instead of asText()
2018-03-03 20:32:49 +01:00
13ea73c31c ENH: cleanup, extend zero/one classes
- constexpr, noexcept on various bits

- addition of a 'one::minus' class that returns '-1' instead of '1'.
  There are no additional operations defined for this class,
  but it can be used in various places to signal alternative behaviour
  such as "initialize to a negative or other invalid value"
2018-03-02 10:04:56 +01:00
b4703f4a08 ENH: pre-cleanup of Xfer class (issue #639)
- This class is largely a pre-C++11 holdover, prior to having movable
  references.

- align internals with autoPtr instead of always unconditionally
  allocating memory. The valid() method can be used to check for a null
  pointer.

- Consolidate into a single file, in anticipation of future removal.
2018-03-04 21:38:33 +01:00
081783db6c ENH: add Xfer rvalue(), valid() methods
- rvalue() is a (transitional) means of converting Xfer content to a
  reference for move construct, move assign semantics.

- valid() method for consistency with autoPtr and tmp classes
2018-02-28 09:30:31 +01:00
7e84380783 GIT: corrected incorrect merge artifacts
STYLE: simplified output logic, reduced duplicate code in CompactIOList
2018-02-27 11:48:34 +01:00
9cd9e812d2 COMP: avoid compiler warning 'assuming signed overflow does not occur' 2018-02-22 14:21:16 +01:00
a843054b7a ENH: more generous range check for UList<bool>::operator[] specialization
- now also handles negative indices without issue.
  This increases its robustness for predicate type of use.
2018-02-28 09:07:13 +01:00
799924e79a BUG: inverted logic in UList::operator== (introduced by a0148ac095) 2018-02-28 08:48:13 +01:00
46e73fe4dc Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2018-02-23 08:18:09 -08:00
fe2e75c7dc ENH: Adding swirlFanVelocity to files in finiteVolume and change fanFvPatch operation 2018-02-23 08:16:55 -08:00
3371ed8fac Merge branch 'feature-linked-lists' into 'develop'
several improvements for linked-lists

See merge request Development/OpenFOAM-plus!177
2018-02-23 10:34:42 +00:00
3a4b92c4b2 STYLE: remove deprecated and unused ListOps
- deprecated MAR-2017

    subset(const UList<T>& select, const T& value, const ListType&);
    inplaceSubset(const UList<T>& select, const T& value, ListType&);

  The subsetList/inplaceSubsetList variants with a unary predicate
  provide more flexible and robuster solutions.

- deprecated MAR-2017

    initList(const T[mRows]);
    initListList(const T[mRows][nColumns]);

  Required prior to the addition of constructors with
  std::initializer_list
2018-02-22 12:24:48 +01:00
37e248c74b STYLE: consistent use of wordHashSet instead of HashSet<word>
- the wordHashSet typedef is always available when HashSet has been
  included.

- use default HashTable key (word) instead of explicitly mentioning it
2018-02-22 11:19:47 +01:00
f95f8bf512 COMP: wmake/wmakePrintBuild -api failed to extract API number 2018-02-22 10:54:16 +01:00
35b3d1c6ff STYLE: provide coordinateSystems names() method for consistency 2018-02-22 10:44:25 +01:00
bdb616de24 SUBMODULE: cfmesh update - using findIndices instead of findStrings 2018-02-22 09:43:56 +01:00
ec38e7a408 ENH: prevent conversion of string to regExp in stringListOps (closes #739)
* For most cases, this conversion would be largely unintentional
  and also less efficient. If the regex is desirable, the caller
  should invoke it explicitly.
  For example,

      findStrings(regExp(str), listOfStrings);

  Or use one of the keyType, wordRe, wordRes variants instead.
  If string is to be used as a plain (non-regex) matcher,
  this can be directly invoked

      findMatchingStrings(str, listOfStrings);

  or using the ListOps instead:

      findIndices(listOfStrings, str);

* provide function interfaces for keyType.
2018-02-22 09:28:03 +01:00
f959927910 ENH: improve consistency of ListOps and stringListOps
- subsetList, inplaceSubsetList with optional inverted logic.

- use moveable elements where possible.

- allow optional starting offset for the identity global function.
  Eg,  'identity(10, start)' vs 'identity(10) + start'
2018-02-21 12:58:00 +01:00
3ee2f3293e STYLE: avoid global findIndex() in favour of UList::find() 2018-02-21 11:50:34 +01:00
c126464d1c ENH: change wordRes to be a List of wordRe instead of a wrapper (issue #259)
- this permits direct storage of a list with additional matcher
  capabilities

- provide wordRes::matcher class for similar behaviour as previously
2018-02-21 10:05:30 +01:00
03b287ed24 COMP: adjust tests to compile with current code base 2018-02-20 17:24:08 +01:00
87b1bbacd8 ENH: support writeLagrangianPositions in redistributePar (issue #702) 2018-02-20 15:22:47 +01:00
0d3d895d4d STYLE: use slash-scoping for foamDictionary usage
Eg, -entry boundaryField/wall2/q  vs. boundaryField.wall2.q

- remove unneeded quoting when calling foamDictionary
2018-02-20 13:13:34 +01:00
fe140cd6c5 TUT: test mode not respected (closes #710)
- now replaced 'if ! isTest' with 'if notTest' for most cases.
2018-02-20 12:54:44 +01:00
63edb6024b STYLE: improve robustness of wall interactions code (issue #737) 2018-02-20 12:19:38 +01:00
ad871a16fc BUG: spray/wall interactions failing in parallel (closes #737)
- should have been limited to non-processor patches only
2018-02-20 11:51:08 +01:00
80fad8483b ENH: add polyBoundaryMesh::nNonProcessor() method
- returns the number of non-processorPolyPatch patches, which is invariant
  across all processors.
2018-02-20 11:41:13 +01:00
8716061a4a ENH: support local InfoSwitch for writeLagrangianPositions (issue #721)
- remove writeLagrangianCoordinates as InfoSwitch, since this is
  something that a regular user should not be able to disable.
2018-02-19 15:03:22 +01:00
d69c26311f STYLE: relocate geometryType enum to cloud class (issue #721) 2018-02-19 12:40:06 +01:00
cbbb9753eb STYLE: consolidate positionsCompat1706 structure (issue #721) 2018-02-19 11:57:57 +01:00
3c35c3535e BUG: Fixing bug in dimensioning variables for parallel case 2018-02-21 15:36:30 -08:00
240e304ba2 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2018-02-21 10:32:44 -08:00
543ac07774 BUG: Fixing constructors from dictionary to avoid hanging in parallel when patch size is zero 2018-02-21 10:31:49 -08:00
32a854d2e2 ENH: meshStructure: make sense in parallel. Fixes #732. 2018-02-15 09:08:40 +00:00
8033592eb1 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2018-02-14 10:17:32 +00:00
ad3d5020f7 ENH: foamDictionary. Added comment. Fixes #316. 2018-02-14 10:17:13 +00:00
88f4b6ca8d ENH: optionally limit systemCall function-object to master only (closes #729) 2018-02-09 19:24:31 +01:00
3e3c97397e STYLE: simplify hashing to use struct instead of class
- more consistent with STL practices for function classes.

- string::hash function class now operates on std::string rather
  than Foam::string since we have now avoided inadvertent use of
  string conversion from int in more places.
2018-02-09 15:34:59 +01:00
09a6e94073 BUG: incorrect HashTable / HashSet instances
- Eg instead of using labelHashSet, used HashSet<label> which uses
  the string::hash for hashing. Other places inadvertently using the
  string::hash instead of Hash<label> for hashing.

STYLE: use Map<..> instead of HashTable<.., label, Hash<label>>

- reduces clutter
2018-02-09 09:30:02 +01:00
806b668418 STYLE: two-parameter Foam::name replaced by word::printf (issue #724)
- reduces some ambiguity and clarifies the expected output and
  behaviour.

STYLE: reduce some automatic conversions of char to string
2018-02-08 12:00:54 +01:00
fa8d972796 STYLE: replace HashSet/HashTable xfer with equivalent movable (issue #726)
- avoid confusion by using HashTable::lookup(key, deflt) explicitly
  instead of allowing an operator() version.
2018-02-08 10:52:29 +01:00
e42c228155 ENH: cleanup List constructors (issue #725)
- add copy construct from UList

- remove copy construct from dissimilar types.

  This templated constructor was too generous in what it accepted.
  For the special cases where a copy constructor is required with
  a change in the data type, now use the createList factory method,
  which accepts a unary operator. Eg,

      auto scalars = scalarList::createList
      (
          labels,
          [](const label& val){ return 1.5*val; }
      );
2018-02-08 08:53:14 +01:00
e27e566345 ENH: blockMesh: stabilise multi-surface intersection. Fixes #730. 2018-02-07 17:57:50 +00:00
4432ca2ef1 Merge branch 'feature-primitiveMesh' into 'develop'
BUG: primitiveMesh: cellPoints, cellEdges inconsistent API. Fixes #703.

See merge request Development/OpenFOAM-plus!189
2018-02-07 13:56:34 +00:00
9ede061dfe STYLE: snappyHexMesh: use iterator 2018-02-07 13:53:28 +00:00
7363a01aa3 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2018-02-01 16:00:37 -08:00