Commit Graph

20743 Commits

Author SHA1 Message Date
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
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