Commit Graph

19619 Commits

Author SHA1 Message Date
Mark Olesen
3814762785 ENH: relocate triSurface classes into surfMesh library (issue #294)
- simplifies organization, includes, linkage etc.
2017-05-18 10:42:05 +02:00
Mark Olesen
abe6121311 GIT: remove remnant edgeMesh Make/{files,options}
- missed by commit c085c5df25
2017-05-18 11:01:27 +02:00
Andrew Heather
2e9bead519 MRG: merged develop line back into integration branch 2017-05-18 11:11:12 +01:00
Andrew Heather
8ff163713d BUG: Lagrangian - corrected particle LocalInteraction behaviour on coupled patches. See reactingParcelFoam/filter tutorial example 2017-05-17 20:48:00 +01:00
Andrew Heather
f68896605e ENH: Clean-up after latest Foundation integrations 2017-05-17 17:33:47 +01:00
Andrew Heather
91b90da4f3 Integrated Foundation code to commit 104aac5 2017-05-17 16:35:18 +01:00
Andrew Heather
c9df5f9249 Merge branch 'dict-lookup' into 'develop'
Dict lookup

See merge request !105
2017-05-02 16:37:57 +01:00
Andrew Heather
a8e3482591 Merge branch 'edge-labelPair-containers' into 'develop'
Use updated edge and labelPair containers

See merge request !106
2017-05-02 16:35:54 +01:00
Mark Olesen
45c29be341 COMP: avoid clang compiler warnings 2017-05-02 13:33:40 +02:00
Mark Olesen
1dc3236825 BUG: fixed odd sizing for hash tables (fixes #460) 2017-05-02 12:31:52 +02:00
Mark Olesen
f8c58bdd5c ENH: HashSet iterators operator* now return Key.
- much more useful than returning nil. Can now use with a for range:

    for (auto i : myLabelHashSet)
    {
        ...
    }
2017-05-02 01:58:38 +02:00
Mark Olesen
8f75bfbed5 ENH: add HashTable::writeKeys and HashSet::writeList
- can use the hash-set writeList in combination with FlatOutput:

  Eg, flatOutput(myHashSet);
2017-05-02 00:51:04 +02:00
Mark Olesen
c0a50dc621 ENH: improve overall consistency of the HashTable and its iterators
- previously had a mismash of const/non-const attributes on iterators
  that were confused with the attributes of the object being accessed.

- use the iterator keys() and object() methods consistently for all
  internal access of the HashTable iterators. This makes the intention
  clearer, the code easier to maintain, and protects against any
  possible changes in the definition of the operators.

- 'operator*': The standard form expected by STL libraries.
  However, for the std::map, this dereferences to a <key,value> pair,
  whereas OpenFOAM dereferences simply to <value>.

- 'operator()': OpenFOAM treats this like the 'operator*'

- adjusted the values of end() and cend() to reinterpret from nullObject
  instead of returning a static iteratorEnd() object.
  This means that C++ templates can now correctly deduce and match
  the return types from begin() and end() consistently.
  So that range-based now works.

  Eg,
      HashTable<label> table1 = ...;
      for (auto i : table1)
      {
          Info<< i << endl;
      }

  Since the 'operator*' returns hash table values, this prints all the
  values in the table.
2017-05-02 00:15:12 +02:00
Mark Olesen
0298c02b2d ENH: ensure nullObject is large enough for reinterpret
- previously occupied 1 byte. Now occupies enough to hold a pointer,
  which helps if using reinterpret_cast to something that has some
  member content.
2017-05-01 22:39:36 +02:00
Mark Olesen
7cceda620d BUG: comparison to static end() for hashtable lookup.
- just use the iterator method found() as an alternative and
  convenient way to avoid the issue with less typing.
2017-05-01 21:28:41 +02:00
Mark Olesen
dc57c016ae BUG: comparison with incorrect construction tables
- previously hidden when hashtable used a static method and a
  different class for end()
2017-05-01 21:27:42 +02:00
Mark Olesen
805b76d4b9 ENH: support UList[labelRange] and SubList construction with labelRange
This uses a concept similar to what std::valarray and std::slice do.
A labelRange provides a convenient container for holding start/size
and lends itself to addressing 'sliced' views of lists.
For safety, the operations and constructors restricts the given input range
to a valid addressible region of the underlying list, while the labelRange
itself precludes negative sizes.

The SubList version is useful for patches or other things that have a
SubList as its parameter. Otherwise the UList [] operator will be the
more natural solution. The slices can be done with a labelRange, or
a {start,size} pair.

Examples,
     labelList list1 = identity(20);

     list1[labelRange(18,10)]  = -1;
     list1[{-20,25}] = -2;
     list1[{1000,5}] = -3;

     const labelList list2 = identity(20);
     list2[{5,10}] = -3;  // ERROR: cannot assign to const!
2017-05-01 14:01:09 +02:00
Mark Olesen
75ef6f4e50 ENH: add labelRange comparison operators and subset methods
- improve interface consistency.
2017-04-30 21:29:24 +02:00
Mark Olesen
7b427c382e ENH: add Tuple2 comparison operators, typedefs 2017-04-30 13:05:49 +02:00
Mark Olesen
5d6bf3e43d ENH: HashTable improvements
- optimize erasure using different HashTable based on its size.
  Eg, hashtable.erase(other);

  If 'other' is smaller than the hashtable, it is more efficient to
  use the keys from other to remove from the hashtable.

  Otherwise simply iterate over the hashtable and remove it if
  that key was found in other.
2017-04-30 10:21:10 +02:00
Mark Olesen
c65e2e580d ENH: add some standard templates and macros into stdFoam.H
- some functionality similar to what the standary library <iterator>
  provides.

  * stdFoam::begin() and stdFoam::end() do type deduction,
    which means that many cases it is possible to manage these types
    of changes.

    For example, when managing a number of indices:
       Map<labelHashSet> lookup;

    1) Longhand:

        for
        (
            Map<labelHashSet>::const_iterator iter = lookup.begin();
            iter != lookup.end();
            ++iter
        )
        { .... }

    1b) The same, but wrapped via a macro:

        forAllConstIter(Map<labelHashSet>, lookup, iter)
        { .... }

    2) Using stdFoam begin/end templates directly

        for
        (
            auto iter = stdFoam::begin(lookup);
            iter != stdFoam::end(lookup);
            ++iter
        )
        { .... }

    2b) The same, but wrapped via a macro:

        forAllConstIters(lookup, iter)
        { .... }

Note that in many cases it is possible to simply use a range-based for.
Eg,
     labelList myList;

     for (auto val : myList)
     { ... }

     for (const auto& val : myList)
     { ... }

These however will not work with any of the OpenFOAM hash-tables,
since the standard C++ concept of an iterator would return a key,value
pair when deferencing the *iter.

The deduction methods also exhibits some slightly odd behaviour with
some PtrLists (needs some more investigation).
2017-04-29 22:28:16 +02:00
Mark Olesen
6a5ea9a2bf ENH: improve HashSet construction and assignment
- make construct from UList explicit and provide corresponding
  assignment operator.

- add construct,insert,set,assignment from FixedList.
  This is convenient when dealing with things like edges or triFaces.
2017-04-29 15:19:47 +02:00
Mark Olesen
a2ddf7dd48 ENH: support HashTable erasure via a FixedList
- propagate common erasure methods as HashSet::unset() method,
  for symmetry with HashSet::set()
2017-04-29 14:50:46 +02:00
Mark Olesen
ded105c539 STYLE: HashTable documentation
- explicitly mention the value-initialized status for the operator().
  This means that the following code will properly use an initialized
  zero.

      HashTable<label> regionCount;

      if (...)
         regionCount("region1")++;

      ... and also this;

      if (regionCount("something") > 0)
      {
          ...
      }

  Note that the OpenFOAM HashTable uses operator[] to provide read and
  write access to *existing* entries and will provoke a FatalError if
  the entry does not exist.

  The operator() provides write access to *existing* entries or will
  create the new entry as required.
  The STL hashes use operator[] for this purpose.
2017-04-29 12:27:11 +02:00
Mark Olesen
1d9b311b82 ENH: further refinement to edge methods
- more hash-like methods.
  Eg, insert/erase via lists, clear(), empty(),...

- minVertex(), maxVertex() to return the smallest/largest label used

- improved documentation, more clarification about where/how negative
  point labels are treated.
2017-04-29 12:14:46 +02:00
Andrew Heather
1a24be6e54 Merge branch 'feature-random-numbers' into 'develop'
Updated random numbers

See merge request !107
2017-04-28 10:11:18 +01:00
Andrew Heather
0b42024c98 ENH: turbulentDFSEMInlet - ensure different procs initialise the random number generator with a different seed 2017-04-28 10:01:43 +01:00
Andrew Heather
7f0cc0045d ENH: Random numbers - updated dependent code from change cachedRandom->Random class 2017-04-28 09:15:52 +01:00
Andrew Heather
b07bc1f0b8 ENH: Random numbers - consolidated Random classes
- old Random class deprecated
- cachedRandom renamed Random
2017-04-28 09:07:42 +01:00
Andrew Heather
88a03de238 ENH: Random numbers - updated dependent code from change to cachedRandom class 2017-04-27 15:24:52 +01:00
Andrew Heather
02205ef167 ENH: Random numbers - cachedRandom - updated to use the re-entrant random interface 2017-04-27 15:24:20 +01:00
Andrew Heather
9df578f412 ENH: Random numbers - added re-entrant random interface 2017-04-27 15:23:45 +01:00
Andrew Heather
72d39f1707 STYLE: Minor code formatting 2017-04-27 14:50:20 +01:00
Andrew Heather
b9379426c9 ENH: Oriented fields - updated dependent code 2017-04-27 14:47:48 +01:00
Mark Olesen
799490a3cf ENH: add edgeHashes.H with some useful hash types for edges. 2017-04-27 14:43:16 +02:00
Mark Olesen
357c2c3470 ENH: relocate labelPairLookup into OpenFOAM library (as labelPairHashes.H)
- simplifies organization, allows reuse.
  provide some other useful hash types.
2017-04-27 14:40:37 +02:00
Mark Olesen
29635ee0f4 ENH: provide triSurfaceLoader convenience class
- for loading single or multiple surface files from constant/triSurface
  (or other) directory.

- select based on word, wordRe, wordReList.
2017-04-27 14:15:36 +02:00
Mark Olesen
00800764f3 STYLE: provide forwarder for triadField 2017-04-27 14:08:38 +02:00
Mark Olesen
cda089569c ENH: add short-circuit (break) on various List operator==()
- performance improvement. Noticed while examining issue #458
2017-04-27 13:00:34 +02:00
Mark Olesen
633e4c9c7f ENH: Use edgeHashes.H and labelPairHashes.H
- avoids some duplicate code.
2017-04-27 10:15:56 +02:00
Mark Olesen
5514471c15 BUG: FixedList '<' operator using a template parameter (fixes #458)
- cannot use comparison of list sizes. Okay for UList, but not here.

STYLE:
- don't need two iterators for the '<' comparison, can just access
  internal storage directly
2017-04-27 01:30:50 +02:00
Henry Weller
104aac5fca externalWallHeatFluxTemperature: Added optional support for radiative flux to the outside
By specifying the optional outside surface emissivity radiative heat transfer to
the ambient conditions is enabled.  The far-field is assumed to have an
emissivity of 1 but this could be made an optional input in the future if
needed.

Relaxation of the surface temperature is now provided via the optional
"relaxation" which aids stability of steady-state runs with strong radiative
coupling to the boundary.
2017-04-26 12:32:23 +01:00
Andrew Heather
4ce77f6843 Merge branch 'master' into develop 2017-04-25 12:31:22 +01:00
Andrew Heather
d26ed93389 BUG: writeFile - corrected write of output file at start time 2017-04-25 12:30:35 +01:00
Mark Olesen
ffe3e0e425 ENH: allow '^' as anchor for dictionary scoping (issue #429)
- The existing ':' anchor works for rvalue substitutions
  (Eg, ${:subdict.name}), but fails for lvalues, since it is
  a punctuation token and parse stops there.
2017-04-25 11:57:21 +02:00
Mark Olesen
f1ca89463f ENH: support DimensionedField construction with Xfer
- can be used to reduce copying
2017-04-25 09:28:34 +02:00
Mark Olesen
32a6c1d988 ENH: relocate randomPointInPlane as plane::somePointInPlane
- makes more sense to bundle it with plane.
2017-04-24 20:23:31 +02:00
Mark Olesen
b1be223a82 ENH: meshTools output for treeBoundBox, points.
ENH: OBJstream output for treeBoundBox
2017-04-24 16:04:05 +02:00
Andrew Heather
cc16d9dabe BUG: runTimePostProcessing - corrected clipBox behaviour (see #456) 2017-04-24 14:33:37 +01:00
Andrew Heather
8886e90870 ENH: Progagted oriented() flag through field mapping 2017-04-24 13:05:19 +01:00