Commit Graph

19577 Commits

Author SHA1 Message Date
009f8df176 TUT: minor update 2017-05-22 13:37:51 +01:00
db5348880e MRG: resolved merge conflicts from merge from develop branch 2017-05-19 16:29:54 +01:00
6e72ceddd0 Merge branch 'enh-iter-cleanup' into 'develop'
Further hash table iter clean-up

See merge request !113
2017-05-19 12:44:05 +01:00
79bfd7d7d9 TUT: Corrected execute permissions on run scripts 2017-05-19 11:46:58 +01:00
bb67ccd37d ENH: Cleaned up hash table item found checks 2017-05-19 11:15:35 +01:00
62ff00f860 COMP: specie - ensure if block is evaluated 2017-05-18 22:12:48 +01:00
0a4733acab ENH: Tutorial updates 2017-05-18 14:47:00 +01:00
28868f8d4d ENH: Updated reading of dimensioned types from transportProperties dictionary to avoid the need to provide the dimension set 2017-05-18 14:44:52 +01:00
9a6f0fdd37 COMP: Updated kOmegaSSTSato model to suppress compiler warning 2017-05-18 14:43:05 +01:00
9efd9ce061 BUG: TDACChemistryModel - corrected construction of tabulationResults_ field 2017-05-18 14:42:37 +01:00
e4d15d874c Merge branch 'HashTable-method-enhancements' into 'develop'
Hash table method enhancements

See merge request !112
2017-05-18 12:54:36 +01:00
776d87836b STYLE: corrected header comment 2017-05-18 12:49:09 +01:00
d71a7857bf Merge remote-tracking branch 'origin/develop' into integration-foundation 2017-05-18 12:43:15 +01:00
c1cbfe7a46 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2017-05-18 12:41:07 +01:00
99f31a75f0 COMP: Removed override directives to remove compiler warnings 2017-05-18 12:40:48 +01:00
15d0a918c5 COMP: use VTK_OVERRIDE on paraview methods
COMP: avoid undefined-var-template warning in runTimePostProcessing
2017-05-18 13:21:48 +02:00
20fd33e37c TUT: Moved laminar case from RAS->laminar directories 2017-05-18 11:44:52 +01:00
b6dec5860b ENH: histogram: output raw count, auto-range. Fixes #467 2017-05-18 10:54:45 +01:00
3814762785 ENH: relocate triSurface classes into surfMesh library (issue #294)
- simplifies organization, includes, linkage etc.
2017-05-18 10:42:05 +02:00
abe6121311 GIT: remove remnant edgeMesh Make/{files,options}
- missed by commit c085c5df25
2017-05-18 11:01:27 +02:00
2e9bead519 MRG: merged develop line back into integration branch 2017-05-18 11:11:12 +01:00
8ff163713d BUG: Lagrangian - corrected particle LocalInteraction behaviour on coupled patches. See reactingParcelFoam/filter tutorial example 2017-05-17 20:48:00 +01:00
8a3915eb67 STYLE: Corrected header text 2017-05-17 17:35:27 +01:00
d6e721a9bd ENH: simplify subsetMesh using new IOobjectList methods 2017-05-17 18:35:08 +02:00
f68896605e ENH: Clean-up after latest Foundation integrations 2017-05-17 17:33:47 +01:00
91b90da4f3 Integrated Foundation code to commit 104aac5 2017-05-17 16:35:18 +01:00
aeae8e70de ENH: simplify sampling grouping using new IOobjectList methods 2017-05-17 16:25:20 +02:00
b2edd73881 ENH: simplify foamToEnsight using new IOobjectList methods
BUG: foamToEnsight fails with missing field at time 0 (fixes #473)
2017-05-17 14:41:21 +02:00
568570d2be Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2017-05-17 12:53:10 +01:00
77865d22dd ENH: histogram: 1) if max is not provided use field max. 2) output count. Fixes #467. 2017-05-17 12:52:13 +01:00
9761e9d81e ENH: added classes() method to objectRegistry/IOobjectList
- provides a summary hash of classes used and their associated object names.

  The HashTable representation allows us to leverage various HashTable
  methods. This hashed summary view can be useful when querying
  particular aspects, but is most useful when reducing the objects in
  consideration to a particular subset. For example,

      const wordHashSet interestingTypes
      {
          volScalarField::typeName,
          volVectorField::typeName
      };

      IOobjectList objects(runTime, runTime.timeName());
      HashTable<wordHashSet> classes = objects.classes();

      classes.retain(interestingTypes);

      // Or do just the opposite:
      classes.erase(unsupportedTypes);

  Can also use the underlying HashTable filter methods

STYLE: use templated internals to avoid findString() when matching subsets
2017-05-17 10:43:24 +02:00
cf889306d0 ENH: added HashTable count, filter and generalized toc methods
- Generalized means over filtering table entries based on their keys,
  values, or both.  Either filter (retain), or optionally prune elements
  that satisfy the specified predicate.

  filterKeys and filterValues:
  - Take a unary predicate with the signature

        bool operator()(const Key& k);

  - filterEntries:
    Takes a binary predicate with the signature

        bool operator()(const Key& k, const T& v);

==

  The predicates can be normal class methods, or provide on-the-fly
  using a C++ lambda. For example,

      wordRes goodFields = ...;
      allFieldNames.filterKeys
      (
          [&goodFields](const word& k){ return goodFields.match(k); }
      );

  Note that all classes that can match a string (eg, regExp, keyType,
  wordRe, wordRes) or that are derived from a Foam::string (eg, fileName,
  word) are provided with a corresponding

      bool operator()(const std::string&)

  that either performs a regular expression or a literal match.
  This allows such objects to be used directly as a unary predicate
  when filtering any string hash keys.

  Note that HashSet and hashedWordList both have the proper
  operator() methods that also allow them to be used as a unary
  predicate.

- Similar predicate selection with the following:
    * tocKeys, tocValues, tocEntries
    * countKeys, countValues, countEntries

  except that instead of pruning, there is a simple logic inversion.
2017-05-17 10:18:14 +02:00
8d018e7950 ENH: added constant predicates
- predicates::always and predicates::never returning true and false,
  respectively. These simple classes make it easier when writing
  templated code.

  As well as unary and binary predicate forms, they also contain a
  match(std::string) method for compatibility with regex-based classes.

STYLE: write bool and direction as primitive 'int' not as 'label'.
2017-05-17 10:18:14 +02:00
a8d2ebf298 ENH: cleanup wordRe interfaces etc.
- ensure that the string-related classes have consistently similar
  matching methods. Use operator()(const std::string) as an entry
  point for the match() method, which makes it easier to use for
  filters and predicates. In some cases this will also permit using
  a HashSet as a match predicate.

regExp
====
- the set method now returns a bool to signal that the requested
  pattern was compiled.

wordRe
====
- have separate constructors with the compilation option (was previously
  a default parameter). This leaves the single parameter constructor
  explicit, but the two parameter version is now non-explicit, which
  makes it easier to use when building lists.

- renamed compile-option from REGEX (to REGEXP) for consistency with
  with the <regex.h>, <regex> header names etc.

wordRes
====
- renamed from wordReListMatcher -> wordRes. For reduced typing and
  since it behaves as an entity only slightly related to its underlying
  list nature.

- Provide old name as typedef and include for code transition.

- pass through some list methods into wordRes

hashedWordList
====
- hashedWordList[const word& name] now returns a -1 if the name is is
  not found in the list of indices. That has been a pending change
  ever since hashedWordList was generalized out of speciesTable
  (Oct-2010).

- add operator()(const word& name) for easy use as a predicate

STYLE: adjust parameter names in stringListOps

- reflect if the parameter is being used as a primary matcher, or the
  matcher will be derived from the parameter.
  For example,
      (const char* re), which first creates a regExp
      versus (const regExp& matcher) which is used directly.
2017-05-16 23:54:43 +02:00
c1c6243c3e ENH: pass through doc/Allwmake arguments, add -config, -dir options
- can run doxygen with an alternative Doxyfile, which is useful
  when verifying generated content for particular classes.
  Eg,
      PATH/doc/Allwmake -dir $PWD
2017-05-16 10:53:07 +02:00
acc048a2ce Merge branch 'consistency-updates' into 'develop'
Consistency updates

See merge request !111
2017-05-15 12:34:02 +01:00
1889ea83e3 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2017-05-15 10:17:57 +01:00
3cf7820160 ENH: surfaceMeshTriangulate: handle time selection; handle moving meshes. Fixes #470. 2017-05-15 10:17:24 +01:00
d4041e7d36 ENH: consistent access to IOobjectList names.
- Previously matched name against the object->name() method
  but saved with iter.key().  Now use iter.key() more consistently.

STYLE: consistent parameter names (doxygen)
2017-05-15 08:47:35 +02:00
6933bc3021 ENH: HashPtrTable remove/erase now include safeguard against end-iterator
- This makes the following safe:

      auto iter = ptrTable.find(unknownKey);
      ptrTable.erase(iter);

- Unmask HashPtrTable::erase(const Key& key) method
2017-05-15 09:57:25 +02:00
4b0d1632b6 BUG: hashtable key_iterator ++ operator returning incorrect type
ENH: ensure std::distance works with hashtable iterators
2017-05-14 16:58:47 +02:00
0c53a815ed ENH: avoid std::distance for std::initializer_list
- std::initializer_list has its own size() method, so no need to use
  std::distance.

STYLE/BUG: use separate iterator de-reference and increment in List

- avoids unnecessary copying of iterators, and avoids any potentially
  odd behaviour with the combination with incrementing.

ENH: support construct from iterator pair for DynamicList, SortableList
2017-05-14 16:28:21 +02:00
83669e284f ENH: improvements to labelRange const_iterator
- inherit from std::iterator to obtain the full STL typedefs, meaning
  that std::distance works and the following is now possible:

      labelRange range(100, 1500);
      scalarList list(range.begin(), range.end());

  --
  Note that this does not work (mismatched data-types):

      scalarList list = identity(12345);

  But this does, since the *iter promotes label to scalar:

      labelList ident = identity(12345);
      scalarList list(ident.begin(), ident.end());

  It is however more than slightly wasteful to create a labelList
  just for initializing a scalarList. An alternative could be a
  a labelRange for the same purpose.

      labelRange ident = labelRange::identity(12345);
      scalarList list(ident.begin(), ident.end());

  Or this
      scalarList list
      (
          labelRange::null.begin(),
          labelRange::identity(12345).end()
      );
2017-05-14 14:39:17 +02:00
0e7b135181 STYLE: adjust const access for linked-list iterators 'operator*'
- provides const/non-const access to the underlying list, but the
  iterator access itself is const.

- provide linked-list iterator 'found()' method for symmetry with
  hash-table iterators. Use nullptr for more clarity.
2017-05-12 12:26:28 +02:00
f73b5b629f ENH: added HashTable 'lookup' and 'retain' methods
- lookup(): with a default value (const access)
  For example,
      Map<label> something;
      value = something.lookup(key, -1);

    being equivalent to the following:

      Map<label> something;
      value = -1;  // bad value
      if (something.found(key))
      {
          value = something[key];
      }

    except that lookup also makes it convenient to handle const references.
    Eg,

      const labelList& ids = someHash.lookup(key, labelList());

- For consistency, provide a two parameter HashTable '()' operator.
  The lookup() method is, however, normally preferable when
  const-only access is to be ensured.

- retain(): the counterpart to erase(), it only retains entries
  corresponding to the listed keys.

  For example,
      HashTable<someType> largeCache;
      wordHashSet preserve = ...;

      largeCache.retain(preserve);

    being roughly equivalent to the following two-stage process,
    but with reduced overhead and typing, and fewer potential mistakes.

      HashTable<someType> largeCache;
      wordHashSet preserve = ...;

      {
          wordHashSet cull(largeCache.toc()); // all keys
          cull.erase(preserve);               // except those to preserve
          largeCache.erase(cull);             //
      }

  The HashSet &= operator and retain() are functionally equivalent,
  but retain() also works with dissimilar value types.
2017-05-11 12:25:35 +02:00
8728e8353f STYLE: avoid explicit use of 'word' as HashTable template parameter
- less clutter and typing to use the default template parameter when
  the key is 'word' anyhow.

- use EdgeMap instead of the longhand HashTable version where
  appropriate
2017-05-10 13:44:27 +02:00
4d126bfe2d ENH: add dictionary optionalSubDict() method as per .org change (20-Apr) 2017-05-10 12:51:21 +02:00
ede3a844e1 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2017-05-08 11:55:12 +01:00
91585fd32e STYLE: checkMesh: formatting help 2017-05-08 11:54:48 +01:00
cd8083eb95 Merge branch 'feature-consistency-face-access' into 'develop'
Feature consistency face access

See merge request !109
2017-05-08 10:58:42 +01:00