Commit Graph

14446 Commits

Author SHA1 Message Date
8071020518 ENH: make List output compile-time configurable (#1160)
- introduced a ListPolicy details to make the transition between
  a short list (space separated) and a long list (newline separated)
  more configurable.

  We suppress line breaks for commonly used types that often have
  short content: (word, wordRes, keyType).
2019-01-10 14:24:11 +01:00
8609a0bb93 Merge remote-tracking branch 'origin/develop' into develop 2019-01-10 11:59:03 +01:00
a8f08b31c1 BUG: snappyHexMesh: extrude non-local baffle. Fixes #1175. 2019-01-21 15:27:51 +00:00
956b41ae28 BUG: vtk::internalWriter::writeProcIDs could block in parallel
- could be triggered if running in parallel, but requesting procIDs
  to be written with a non-parallel version of the writer.
2019-01-14 16:43:30 +01:00
5c226864a8 ENH: add clip() method to GeometricField 2019-01-10 09:56:12 +01:00
9a7029004c ENH: minMax, minMaxMag as functions and field functions
- Global functions are unary or combining binary functions, which are
  defined in MinMax.H (MinMaxOps.H).

  There are also global reduction functions (gMinMax, gMinMaxMag)
  as well as supporting 'Op' classes:

  - minMaxOp, minMaxEqOp, minMaxMagOp, minMaxMagEqOp

  Since the result of the functions represents a content reduction
  into a single MinMax<T> value (a min/max pair), field operations
  returning a field simply do not make sense.

- Implemented for lists, fields, field-fields, DimensionedField,
  GeometricField (parallel reducing, with boundaries).

- Since the minMax evaluates during its operation, this makes it more
  efficient for cases where both min/max values are required since it
  avoids looping twice through the data.

  * Changed GeometricField writeMinMax accordingly.

ENH: clip as field function

- clipping provides a more efficient, single-pass operation to apply
  lower/upper limits on single or multiple values.

  Examples,

    scalarMinMax limiter(0, 1);

    limiter.clip(value)

       -> returns a const-ref to the value if within the range, or else
          returns the appropriate lower/upper limit

    limiter.inplaceClip(value)

       -> Modifies the value if necessary to be within lower/upper limit

  Function calls

    clip(value, limiter)

       -> returns a copy after applying lower/upper limit

    clip(values, limiter)

       -> returns a tmp<Field> of clipped values
2019-01-10 09:43:23 +01:00
000f704e08 ENH: FixedList empty(), size(), max_size() now constexpr static (#1160)
- this allows their use as templates parameters
2019-01-10 09:35:41 +01:00
c52d70cce3 STYLE: consistent ordering of is_same parameters 2019-01-10 07:55:53 +01:00
7720b59066 ENH: add dimensionSet provisioning for a dimensioned clip() method
- use file-local function to reduce some code clutter
2019-01-09 23:44:17 +01:00
d0bb3670a7 BUG: incorrect return type for dimensioned unary reduction 2019-01-09 21:01:09 +01:00
b3b404b206 BUG: snappyHexMesh: clear out old data. Fixes #1165. 2019-01-09 14:26:59 +00:00
e6f8dfecec Feature merge OpenFOAM.org 2019-01-10 10:10:06 +00:00
0027ba3226 STYLE: remove unused GeometricField method declarations 2019-01-09 13:43:19 +01:00
cf8d500f8c ENH: export FOAM_API in dictionary (issue #1158)
- uses the value of foamVersion::api, which should be reliable.
2019-01-07 19:04:50 +01:00
0748a11fd6 COMP: no vtkDataArray::Fill() method prior to VTK-8 (fixes #1156) 2019-01-07 11:58:33 +01:00
07a6e9d83d STYLE: use cbrt() instead of pow(..,1.0/3.0) in a few more places 2019-01-09 12:22:07 +01:00
c350a127cd STYLE: add compile-time deprecated message for face/triangle normal()
- in 1812 propagated through the distinction between areaNormal and
  unitNormal (issue #885).

  In older versions, the normal() always meant the area-normal for
  certain of these primitive.

  However, the .org version changed this to now return the unit-normal
  instead, but with the same method name. Thus add the deprecated
  message to avoid future inadvertent uses of normal() without being
  certain which one is being meant.
2019-01-09 10:32:25 +01:00
2067014079 ENH: minor consistency improvements for bounding box
- a valid() method (same as !empty() call) for consistency with other
  containers and data types

- a centre() method (same as midpoint() method) for consistency with
  other OpenFOAM geometric entities
2019-01-09 09:32:23 +01:00
a0a7da2edd ENH: Pair, Tuple2 improvements (#1160)
- move constructors, construct from std::pair
- input/output of std::pair

Makes it easier when using data structures for other codes.
2019-01-08 22:16:41 +01:00
08dc8d0e39 BUG: Tuple2 construct null with uninitialized value
Had this:

    Tuple2() {}

Instead of:

    Tuple2() : f_(), s_() {}

which is the same as

    Tuple2() = default;

This meant that Tuple2<scalar, scalar>() was not being zero-initialized
2019-01-08 21:58:08 +01:00
26d0d48fb5 STYLE: doxygen comments for min/max functions 2019-01-09 09:08:20 +01:00
907dd6d49f STYLE: consistent indentation and template parameters for FixedList 2019-01-08 21:50:12 +01:00
1458b4f689 ENH: remove uniform compact output for FixedList (#1160)
- a FixedList is generally small so there is little advantage
  in a compact output form for uniform content.  Eg, "2{-1}"

  By avoiding this compact form we obtain output that is also
  consistent with Tuple2, for example.

- make FixedList construct from Istream explicit
2019-01-08 13:03:24 +01:00
8eefc7b347 ENH: partial reorganization of HashTable internals (#1160)
- relocate the pair_entry (HashTable) and unary_entry (HashSet) into
  the Detail namespace and add output handling.

  The output handling at this level removes the reliance on zero::null
  output (HashSet) and allows direct support of pointers.
  This means that the following now works

      HashTable<T*> tbl;
      os << tbl;

  It also means that we don't need to overload operator<< for
  HashPtrTable anymore.

- avoid delete/new when calling HashSet::set(). If the entry already
  exists there is no reason to remove it and add another one with the
  same content.

STYLE: HashTable iterators now have a val() method

- identical to the object() iterator method, but shorter to type.
2019-01-08 12:25:30 +01:00
9c74abb7d2 ENH: zero::null::dummy, when dereferencing and dummy assignment are needed 2019-01-08 10:51:24 +01:00
72eb55033a BUG: had readOpt() instead of writeOpt() in polyTopoChange.C (#1147) 2019-01-08 09:28:54 +01:00
74d9dc3f50 BUG: polyMesh constructor AUTO_WRITE flag, ignored readOpt (#1147)
- fixed some more places with an explicit AUTO_WRITE.

BUG: revert handling of the readOption. It should not be NO_READ.

  In cases where the user a IOobject without specifying read/write, it
  defaults to NO_READ anyhow. However, the move constructor can also
  be called with empty lists and a read option. This has the same
  signature, but obviously will not work with NO_READ.
2019-01-07 22:23:19 +01:00
620f5274d0 Merge remote-tracking branch 'origin/develop' into develop 2019-01-07 19:13:18 +01:00
c7350f3dd7 Merge remote-tracking branch 'origin/master' into develop 2019-01-07 19:13:11 +01:00
22b659d7c0 ENH: export FOAM_API in dictionary (issue #1158)
- uses the value of foamVersion::api, which should be reliable.
2019-01-07 19:04:50 +01:00
7339d6427e ENH: setToFaceZone: improved messages 2019-01-07 17:53:26 +00:00
e7fde1dbe0 STYLE: use std::initializer_list instead of const char*[] 2019-01-07 12:49:37 +01:00
3a374bf315 ENH: polyMesh: do not switch on auto-write. Fixes #1147. 2019-01-07 11:08:58 +00:00
573a313f46 STYLE: deprecate hashedWordList contains() method
- identical to found(), which should be used for more consistency.
  The contains() is a remnant from when hashedWordList was generalized
  from a speciesTable (OCT 2010)
2019-01-07 09:51:45 +01:00
86e1933057 ENH: iterator method good() as a synonym for testing validity
- applies to HashTable and Linked-Lists

- deprecate the Linked-List iterator found() method, since this makes
  less sense (linguistically)
2019-01-04 14:07:01 +01:00
e596377179 STYLE: avoid flush when dictionary {} closing (issue #1145)
- a holdover from introducing the endBlock() method
2019-01-03 19:12:12 +01:00
c143c3a32c STYLE: columnFvMesh: typo 2019-01-03 14:37:37 +00:00
6a448016aa ENH: additional read guards for dimensionedType. input consistency (#762, #1148)
- provide a lookupOrDefault constructor form, since this is a fairly
  commonly used requirement and simplifies the calling sequence.

  Before

      dimensionedScalar rhoMax
      (
          dimensionedScalar::lookupOrDefault
          (
              "rhoMax",
              pimple.dict(),
              dimDensity,
              GREAT
          )
     );

  After

      dimensionedScalar rhoMax("rhoMax", dimDensity, GREAT, pimple.dict());

- read, readIfPresent methods with alternative lookup names.

- Mark the Istream related constructors with compile-time deprecated
  warnings.

BUG: read, readIfPresent methods not handling optional dimensions (#1148)
2019-01-03 13:34:11 +01:00
af310075a0 ENH: handle dimensions in dimensioned<Type>::lookupOrAddToDict (#1116) 2019-01-03 01:30:27 +01:00
488150cfb2 ENH: add FOAM_DEPRECATED macros 2019-01-03 00:36:30 +01:00
505b4b9c1c ENH: add guarded lookup for dimensionedSet
STYLE: use standard dimensionedSets
2019-01-02 16:53:41 +01:00
2ce944a748 STYLE: documentation/comment typo 2019-01-02 16:16:45 +01:00
e2bc0b55b9 COMP: use std::move() explicitly to avoid copying 2019-01-02 15:56:54 +01:00
f67f36c63a COMP: avoid some static analysis warnings 2019-01-02 13:49:39 +01:00
c13199d3ce STYLE: make chemistryReader private inheritance (issue #1144)
- The chemistryReader is only used during construction of reactingMixture
  and thus does not require public visibility.
2019-01-02 14:44:21 +01:00
10da897275 ENH: snappyHexMesh: limit printing in dry-run. See #972. 2018-12-24 08:55:42 +00:00
3560884abe ENH: allow direct testing of HashTable iterator as a bool
- can be used as a more natural test on the iterator.
  For example, with

     HashTable<..> table;
     auto iter = table.find(...);

  Following are now all equivalent:

    1.  if (iter != table.end()) ...
    2.  if (iter.found()) ...
    3.  if (iter) ...
2018-12-20 18:03:16 +01:00
08335beb6f ENH: add get() accessor to tmp classes
- similar to autoPtr and unique_ptr. Returns the pointer value without
  any checks. This provides a simple way for use to use either
  an autoPtr or a tmp for local memory management without accidentally
  stealing the pointer.

  Eg,

     volVectorField* ptr;
     tmp<volVectorField> tempField;

     if (someField.valid())
     {
         ptr = someField.get();
     }
     else
     {
         tempField.reset(new volVectorField(....));
         ptr = tmpField.get();
     }

     const volVectorField& withField = *ptr;

STYLE: make more tmp methods noexcept
2018-12-20 17:29:51 +01:00
17419209a7 STYLE: return a pointer instead of bool for isA<>
- in some cases this means you could avoid an isA<> followed by
  second dynamicCast<>
2018-12-20 18:02:16 +01:00
2444e0f964 Merge branch 'release-v1812' 2018-12-20 16:12:59 +00:00