Commit Graph

21162 Commits

Author SHA1 Message Date
11027b8df6 COMP: Correction for clang 2018-03-16 11:12:47 +00:00
63f60cef59 BUG: Reinstated regex functionality for particle local interaction 2018-03-16 11:01:04 +00:00
bac943e6fc ENH: new bitSet class and improved PackedList class (closes #751)
- The bitSet class replaces the old PackedBoolList class.
  The redesign provides better block-wise access and reduced method
  calls. This helps both in cases where the bitSet may be relatively
  sparse, and in cases where advantage of contiguous operations can be
  made. This makes it easier to work with a bitSet as top-level object.

  In addition to the previously available count() method to determine
  if a bitSet is being used, now have simpler queries:

    - all()  - true if all bits in the addressable range are empty
    - any()  - true if any bits are set at all.
    - none() - true if no bits are set.

  These are faster than count() and allow early termination.

  The new test() method tests the value of a single bit position and
  returns a bool without any ambiguity caused by the return type
  (like the get() method), nor the const/non-const access (like
  operator[] has). The name corresponds to what std::bitset uses.

  The new find_first(), find_last(), find_next() methods provide a faster
  means of searching for bits that are set.

  This can be especially useful when using a bitSet to control an
  conditional:

  OLD (with macro):

      forAll(selected, celli)
      {
          if (selected[celli])
          {
              sumVol += mesh_.cellVolumes()[celli];
          }
      }

  NEW (with const_iterator):

      for (const label celli : selected)
      {
          sumVol += mesh_.cellVolumes()[celli];
      }

      or manually

      for
      (
          label celli = selected.find_first();
          celli != -1;
          celli = selected.find_next()
      )
      {
          sumVol += mesh_.cellVolumes()[celli];
      }

- When marking up contiguous parts of a bitset, an interval can be
  represented more efficiently as a labelRange of start/size.
  For example,

  OLD:

      if (isA<processorPolyPatch>(pp))
      {
          forAll(pp, i)
          {
              ignoreFaces.set(i);
          }
      }

  NEW:

      if (isA<processorPolyPatch>(pp))
      {
          ignoreFaces.set(pp.range());
      }
2018-03-07 11:21:48 +01:00
e78548352e TUT: Removed misleading comment in tutorial - see #746 2018-03-06 11:12:39 +00:00
7f7f9336c8 COMP: add -fpermissive to c++LESSWARN flags (closes #744)
- downgrades some diagnostics about nonconformant code from errors to
  warnings. Oddly enough, the errors actually arise from STL library
  elements shipped with gcc itself. Affects kahip compilation with
  gcc-6, gcc-7
2018-02-28 14:31:48 +01:00
628f0860c3 BUG: faceOnlySet sampling does not stop at 'end' (closes #745) 2018-02-28 11:23:59 +01:00
9f03511ffb GIT: merge artifact duplicate call to update mesh moving 2018-02-28 10:59:53 +01:00
08079c4be9 ENH: cellLimitedGrad gradientLimiters: Added support for run-time selectable gradient limiter function
Minmod is the default limiter function and specified with an explicit name e.g.:

    gradSchemes
    {
        default Gauss linear;
        limited cellLimited Gauss linear 1;
    }

Venkatakrishnan and cubic limiter functions are also provided and may be
specified explicitly e.g.:

    gradSchemes
    {
        default Gauss linear;
        limited cellLimited<Venkatakrishnan> Gauss linear 1;
    }

or

    gradSchemes
    {
        default Gauss linear;
        limited cellLimited<cubic> 1.5 Gauss linear 1;
    }

The standard minmod function is recommended for most applications but if
convergence or stability problems arise it may be beneficial to use one of the
alternatives which smooth the gradient limiting.  The Venkatakrishnan is not
well formulated and allows the limiter to exceed 1 whereas the cubic limiter is
designed to obey all the value and gradient constraints on the limiter function,
see

    Michalak, K., & Ollivier-Gooch, C. (2008).
    Limiters for unstructured higher-order accurate solutions
    of the Euler equations.
    In 46th AIAA Aerospace Sciences Meeting and Exhibit (p. 776).

The cubic limiter function requires the transition point at which the limiter
function reaches 1 is an input parameter which should be set to a value between
1 and 2 although values larger than 2 are physical but likely to significantly
reduce the accuracy of the scheme.

VenkatakrishnanGradientLimiter: Updated documentation

cubicGradientLimiter: Documented private data
2018-02-26 23:14:46 +00:00
4f880ba8ea ENH: timeVaryingMappedFixedValue - added option to use an alternate points file name 2018-02-23 14:41:01 +00:00
65fd9b8b4b ENH: turbulenceFields FO - added nuTilda and turbulence length scale 2018-02-23 14:39:51 +00:00
6a024a7b71 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2018-03-15 08:13:56 -07:00
949a047f27 BUG: Correcting dictionary constructor for swirlFanVelocity 2018-03-15 08:09:07 -07:00
bf74bf32fd Merge branch 'feature-shortestPathSet' into 'develop'
Feature shortest path set

See merge request Development/OpenFOAM-plus!151
2018-03-15 10:18:38 +00:00
2386de9bf4 Merge remote-tracking branch 'origin/develop' into feature-shortestPathSet 2018-03-15 10:03:22 +00:00
e10575ee31 COMP: Allwmake: link order. Fixes #765. 2018-03-15 08:51:33 +00:00
e92aa8fce4 ENH: reduced amount seeding in regionSplit
- now only seed boundary faces and an internal face of cell that itself
  has a blocked face.
2018-03-14 16:21:58 +01:00
520c14c136 ENH: add meshTools polyFields
- provides a simple means of writing an internal dimensioned field
  when fvMesh is not available (eg, during mesh creation).
2018-03-14 13:04:22 +01:00
a6fb0436d5 BUG: fvMotionSolvers: fix dimensions. Fixes #765. 2018-03-14 11:07:56 +00:00
ac027daf36 STYLE: pointDisplacement: fix header 2018-03-14 11:05:37 +00:00
5a816c45a7 ENH: fvMotionSolvers: add fvOptions. Fixes #765. 2018-03-12 14:14:48 +00:00
239c96bf28 ENH: checkMesh: minTetVolume field. Fixes #763. 2018-03-12 09:29:17 +00:00
69ebe127a8 ENH: shm: feature angle. See #699. 2018-03-08 15:14:42 +00:00
3269ba0df9 ENH: shm: Parallel consistent extrusion. Fixes #759. 2018-03-08 15:07:24 +00:00
cb03d0bcf4 STYLE: localPointRegion: minor comment 2018-03-08 15:00:45 +00:00
94afd9e9b2 BUG: isoAdvection using 'vof2IsoTol' instead of 'isoFaceTol' (closes #740) 2018-02-23 15:11:24 +01:00
4d4c5910ed ENH: lagrangian injection - exposed minimum number of particles per parcel. See #728
The minimum number of particles per parcel can now be set in the
injection model input, e.g.:

    model1
    {
        type            ...;
        massTotal       ...;
        parcelBasisType ...;
        minParticlesPerParcel 1; <-- new optional entry
        SOI             ...;
        ...

Uses a value of 1 by default if the entry is not present.  The value of
1 is generally recommended and beneficial for coupled cases where small
time steps can lead to the injection of too many parcels and subsequently
greatly over-predict the particle source contributions (momentum, heat,
mass transfer etc)
2018-02-23 12:00:14 +00:00
ac3a8bc3cb BUG: simpleCoalParcelFoam - corrected dimensions of Qdot. Fixes #742 2018-02-23 09:04:16 +00:00
d1b4471141 BUG: snappyHexMesh: make corner-point detection compatible with cutting 2018-02-21 11:15:38 +00:00
da26c3985e SUBMODULE: avalanche update - movable references in polyMesh constructor 2018-03-07 18:08:37 +01:00
451f8e0357 Merge remote-tracking branch 'origin/master' into develop 2018-03-07 18:08:07 +01:00
9670bf8220 Merge branch 'feature-memory-containers' into 'develop'
Feature memory containers

See merge request Development/OpenFOAM-plus!192
2018-03-07 16:58:10 +00:00
664685f7fe CONFIG: bump API version number to 1803 to account for removal of Xfer
- primary points for an external user are the polyMesh constructor

- add config info for gcc-7.3.0

COMP: intel-2017. Ignore unknown pragmas. Disambiguate method resolution.
2018-03-05 20:18:26 +01:00
3d608bf06a ENH: remove reliance on the Xfer class (issue #639)
This class is largely a pre-C++11 holdover. It is now possible to
simply use move construct/assignment directly.

In a few rare cases (eg, polyMesh::resetPrimitives) it has been
replaced by an autoPtr.
2018-03-05 13:28:53 +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
57291e8692 STYLE: use autoPtr::New and tmp::New for simple return types 2018-02-26 14:00:30 +01:00
52b36f84b5 ENH: cleanup tmp class (issue #639)
Improve alignment of its behaviour with std::shared_ptr

  - element_type typedef
  - swap, reset methods

* additional reference access methods:

cref()
    returns a const reference, synonymous with operator().
    This provides a more verbose alternative to using the '()' operator
    when that is desired.

        Mnemonic: a const form of 'ref()'

constCast()
    returns a non-const reference, regardless if the underlying object
    itself is a managed pointer or a const object.
    This is similar to ref(), but more permissive.

        Mnemonic: const_cast<>

    Using the constCast() method greatly reduces the amount of typing
    and reading. And since the data type is already defined via the tmp
    template parameter, the type deduction is automatically known.

    Previously,

        const tmp<volScalarField>& tfld;

        const_cast<volScalarField&>(tfld()).rename("name");
        volScalarField& fld = const_cast<volScalarField&>(tfld());

    Now,

        tfld.constCast().rename("name");
        auto& fld = tfld.constCast();

--

BUG: attempts to move tmp value that may still be shared.

- old code simply checked isTmp() to decide if the contents could be
  transfered. However, this means that the content of a shared tmp
  would be removed, leaving other instances without content.

* movable() method checks that for a non-null temporary that is
  unique (not shared).
2018-02-26 12:05:00 +01:00
660f3e5492 ENH: cleanup autoPtr class (issue #639)
Improve alignment of its behaviour with std::unique_ptr

  - element_type typedef
  - release() method - identical to ptr() method
  - get() method to get the pointer without checking and without releasing it.
  - operator*() for dereferencing

Method name changes

  - renamed rawPtr() to get()
  - renamed rawRef() to ref(), removed unused const version.

Removed methods/operators

  - assignment from a raw pointer was deleted (was rarely used).
    Can be convenient, but uncontrolled and potentially unsafe.
    Do allow assignment from a literal nullptr though, since this
    can never leak (and also corresponds to the unique_ptr API).

Additional methods

  - clone() method: forwards to the clone() method of the underlying
    data object with argument forwarding.

  - reset(autoPtr&&) as an alternative to operator=(autoPtr&&)

STYLE: avoid implicit conversion from autoPtr to object type in many places

- existing implementation has the following:

     operator const T&() const { return operator*(); }

  which means that the following code works:

       autoPtr<mapPolyMesh> map = ...;
       updateMesh(*map);    // OK: explicit dereferencing
       updateMesh(map());   // OK: explicit dereferencing
       updateMesh(map);     // OK: implicit dereferencing

  for clarity it may preferable to avoid the implicit dereferencing

- prefer operator* to operator() when deferenced a return value
  so it is clearer that a pointer is involve and not a function call
  etc    Eg,   return *meshPtr_;  vs.  return meshPtr_();
2018-02-26 12:00:00 +01:00
fc92d30e74 ENH: improvements for labelRange
- constexpr, noexcept.
  Added an 'at()' method for returning an iterator within the range
  and changed operator()(label) to have behaviour as per found().
  This makes the labelRange usable as a unary predicate.

- added templated conversion class 'toLabelRange'

- add range() method to polyPatch and surfZone classes, and corresponding
  templated conversion functors.
  For example,

      auto patchDims = ListOps::create<labelRange>
      (
          mesh.boundaryMesh(),
          toLabelRange<polyPatch>()
      );

  to create a List<labelRange> representing the patch extents.
2018-03-04 20:30:34 +01:00
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
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