Commit Graph

1075 Commits

Author SHA1 Message Date
Mark Olesen
78ce269a52 ENH: add field operations for complex (#1365) 2019-07-28 21:19:43 +02:00
Mark Olesen
1d86fc4f6b ENH: add single-parameter sortedOrder() function 2019-07-17 11:08:40 +02:00
Mark Olesen
e03c0977f5 ENH: support Foam::mv overwrite of existing files on windows (#1238)
- the behaviour of std::rename with overwriting an existing file is
  implementation dependent:
    - POSIX: it overwrites.
    - Windows: it does not overwrite.

- for Windows need to use the ::MoveFileEx() routine for overwriting.

  More investigation is needed for proper handling of very long names.
2019-07-09 18:52:06 +02:00
Mark Olesen
bbc2d4a8b0 ENH: HashTable and HashSet improvements
- unfriend HashSet, HashTable IO operators

- global min(), max(), minMax() functions taking a labelHashSet and an
  optional limit. For example,

      labelHashSet set = ...;

      Info<< "min is " << min(set) << nl;
      Info<< "max (non-negative) " << max(set, 0) << nl;

- make HashTable iterator '->' dereferencing more consistent by also
  supporting non-pointer types as well.

- read HashTable values in-situ to avoid copying
2019-07-12 18:00:00 +02:00
Mark Olesen
488f8938b2 ENH: add invert (inverse mappings) for bitSet 2019-07-12 12:00:00 +02:00
Mark Olesen
4b8fabaa4b STYLE: relocate Allwmake-scan to src/
- reduced clutter. Mostly only need to scan source tree.

- 00-dummy: use wmake/src/Allmake to get native (not cross-compiled)
  wmake toolchain binaries
2019-06-28 09:55:25 +02:00
Mark Olesen
10a03ceba2 STYLE: relocate Allwmake-scan to src/
- reduced clutter. Mostly only need to scan source tree.

- 00-dummy: use wmake/src/Allmake to get native (not cross-compiled)
  wmake toolchain binaries
2019-06-28 09:55:25 +02:00
Andrew Heather
be44dcaf1f RELEASE: Version clean-up for release 2019-06-25 11:51:19 +01:00
Mark Olesen
fa8ab2d5b4 STYLE: add Test-copyFile 2019-06-24 14:46:38 +02:00
Mark Olesen
f863925112 STYLE: use uintptr_t instead of long 2019-06-13 19:37:27 +02:00
Mark Olesen
03de501310 STYLE: fix file permissions, inconsistent Test files 2019-06-04 17:50:18 +02:00
kuti
e42cc287de BUG: incorrect scalar/complex division (#1331)
ENH: define addition/subtraction operations for scalar and complex

- required since construct complex from scalar is explicit
- additional tests in Test-complex
2019-06-04 09:08:42 +01:00
Mark Olesen
fc11c40841 ENH: add wmake -debug option
- forces c++DBUG='-DFULLDEBUG -g -O0' for the compilation, to allow
  localized debugging during development without file editing and
  while retaining the WM_COMPILE_OPTION (eg, Opt)

  Note that switching between 'wmake' and 'wmake -debug' will not
  cause existing targets to be rebuilt. As before, these are driven by
  the dependencies. An intermediate wclean may thus be required.
2019-06-03 10:16:31 +02:00
kuti
745624c024 ENH: partial overhaul of Matrix type (#1220)
- additional operators:
  + compound assignment
  + inner product: operator&
  + outer product: operator^

- additional functions:
   - MatrixBlock methods: subColumn, subRow, subMatrix
   - L2 norms for matrix or column
   - trace, diag, round, transpose

- MatrixBlock methods: col(), block() are deprecated since their
  access patterns with (size, offset) are unnatural/unwieldy.

- verifications by test/Matrix/Test-Matrix
2019-05-23 11:32:45 +01:00
Mark Olesen
db0678bf0e TUT: incorrect regex escaping in fvSchemes
- error trapped by C++11 regex
2019-05-30 14:26:15 +02:00
Mark Olesen
96d0a8f2af ENH: harmonize matrix constructors (#1220)
- generalize identity matrix constructors for non-scalar types

- add constructors using labelPair for the row/column sizing information.
  For a SquareMatrix, this provides an unambiguous parameter resolution.

- reuse assignment operators

STYLE: adjust matrix comments
2019-05-29 09:50:46 +02:00
mattijs
7945ca739c ENH: correct sumProd return type (#1086)
- previously returned scalar, but now return pTraits cmptType
  which is the same as scalarProduct / outerProduct type.
2019-02-10 14:31:35 +00:00
Mark Olesen
aab644a3fc STYLE: eliminate complex constants that are duplications of pTraits
- eg pTraits<complex>::zero, pTraits<complex>::one instead.
  This is consistent with other primitives such as scalar, label etc.
2019-05-27 18:09:43 +02:00
Mark Olesen
b8dc024444 BUG: incorrect IOobject instance for absolute windows path (#1238)
STYLE: remove unused local variables in edgeMeshFormat
2019-05-23 10:27:06 +01:00
Mark Olesen
061eb53fb5 ENH: improvements, modernization of matrix containers (#1220)
- add iterators, begin/end, empty() methods for STL behaviour.
  Use standard algorithms where possible
     * std::fill, std::copy
     * std::min_element, std::max_element

- access methods consistent with other OpenFOAM containers:
     * data(), cdata(), uniform()

- Use ListPolicy to impose output line breaks

- Can recover matrix storage for re-use elsewhere.
  For example, to populate values with 2D i-j addressing and later
  release it as flat linear storage.

- construct/assign moveable

- added minMax() function for Matrix

- additional inplace +=, -=, *=, /= operations

- add named methods at() and rowData() to Matrix.
  Allows a better distinction between linear and row-based addressing

- low-level matrix solve on List/UList instead of Field
2019-05-22 12:18:31 +01:00
kuti
f8a70115fd ENH: add sign(), csign() methods for complex
- use std::hypot for complex mag() instead of long-hand version

- Detail::conj() function for complex or non-complex
2019-05-21 11:18:12 +01:00
Mark Olesen
32916fa845 ENH: dictionary checking methods with predicates on the input values
- can be used to check the validity of input values.

Example:

    dict.getCheck<label>("nIters", greaterOp1<label>(0));
    dict.getCheck<scalar>("relax", scalarMinMax::zero_one());

- use 'get' prefix for more regular dictionary methods.
  Eg, getOrDefault() as alternative to lookupOrDefault()

- additional ops for convenient construction of predicates

ENH: make dictionary writeOptionalEntries integer

- allow triggering of Fatal if default values are used

ENH: additional scalarRange static methods: ge0, gt0, zero_one

- use GREAT instead of VGREAT for internal placeholders

- additional MinMax static methods: gt, le
2019-05-21 19:10:14 +01:00
Mark Olesen
3a00dd9b9a CONFIG: use C++11 regex instead of POSIX for newer compilers
BUG: The ok_ flag was not being updated in the regExpCxx::set() method
2019-05-21 12:29:52 +01:00
Mark Olesen
6c8f6a2f50 ENH: support all 12 Euler rotation orders (#1292)
- adjust naming of quaternion 'rotationSequence' to be 'eulerOrder'
  to reflect its purpose.

- provide rotation matrices directly for these rotation orders in
  coordinateRotations::euler for case in which the rotation tensor
  is required but not a quaternion.
2019-05-10 11:20:21 +02:00
Mark Olesen
0f1fcb97b5 ENH: additional MinMax span() and zero_one() methods 2019-05-08 12:12:00 +02:00
Mark Olesen
ac317699d8 ENH: additional HashTable emplace/insert/set methods (#1286)
- support move insert/set and emplace insertion.

  These adjustments can be used for improved memory efficiency, and
  allow hash tables of non-copyable objects (eg, std::unique_ptr).

- extend special HashTable output treatment to include pointer-like
  objects such as autoPtr and unique_ptr.

ENH: HashTable::at() method with checking. Fatal if entry does not exist.
2019-05-06 08:34:39 +02:00
Mark Olesen
23e5d43e4e ENH: add colour for x3d surface writer (#1057)
- can be used for outputing sampled surfaces in x3d format for direct
  import in other rendering tools.
2019-05-06 17:13:22 +02:00
Mark Olesen
3089a11647 STYLE: comments and parameter names for coordinateRotations::euler 2019-05-03 13:31:00 +02:00
Mark Olesen
675aa8053a ENH: support pointer cast from autoPtr 2019-05-03 09:59:53 +02:00
mattijs
912009c458 ENH: overset: insert remote interpolation into lduMatrix
All remote contributions to interpolation stencils now
get added as 'processor' type lduInterfaces. This guarantees
a consistent matrix, e.g. initial residual is normalised to 1.

Second change is the normalisation of the interpolation discretisation
which uses the diagonal from the unmodified equation. This helps
GAMG.
2019-05-02 16:49:48 +01:00
Mark Olesen
26a391b1e9 ENH: no string quotes when using OSHA1stream (#1301)
- previously would have different SHA1 depending on whether the
  string was a C-string, a C++-string or if the SHA1 was calculated
  directly or via the OSHA1stream.

    - SHA1("string")
    - OSHA1stream << "string";
    - OSHA1stream << string("string");

  By avoiding string quoting on output, they now all deliver the same
  result. This also means that the following will no longer change the SHA1
  content, since it does not add anything:

    osha<< string() << string() << string() << string();

  This would have previously add a pair of double quotes each time!
2019-04-30 12:43:59 +02:00
Mark Olesen
4a51239820 STYLE: restrict posix and ieee754 random tests (non-portable) to linux 2019-04-30 10:05:53 +02:00
mattijs
25e0182fca COMP: label64: fixes #1297. 2019-04-29 14:23:05 +01:00
Mark Olesen
beefee48d4 COMP: adjust compilation order with updated interdependencies
- Eg, with surface writers now in surfMesh, there are fewer libraries
  depending on conversion and sampling.

COMP: regularize linkage ordering and avoid some implicit linkage (#1238)
2019-04-28 14:44:33 +02:00
Mark Olesen
59da4cf56d STYLE: use uintptr_t cast instead of long when reporting addresses 2019-04-29 08:15:48 +02:00
Andrew Heather
6146667284 Merge branch 'feature-indirect-lists' into 'develop'
Feature indirect lists

See merge request Development/OpenFOAM-plus!253
2019-04-29 10:48:17 +01:00
Mark Olesen
180a284814 ENH: add '==' and '!=' operators for PackedList/bitSet
- also available as equal() member function
2019-04-26 13:01:39 +02:00
Mark Olesen
e1609d16d1 STYLE: use degToRad() instead of pi/180 2019-04-26 11:48:27 +02:00
Mark Olesen
661d1f53df ENH: additional rotation tests (#1292) 2019-04-25 20:22:06 +02:00
Mark Olesen
bf30779b64 ENH: add partial sorting to SortableList 2019-04-24 19:03:00 +02:00
Mark Olesen
b3fa961991 ENH: add Ostream output for std::vector
- convenient when using data structures from other codes
2019-04-16 18:00:20 +02:00
Mark Olesen
d14f181529 ENH: add tracking of label/scalar size when reading IOobject header
- extracts values from the arch "LSB;label=32;scalar=64" header entry
  to provision for managing dissimilar primitive sizes.

  Compensate for the additional IOobject members by narrowing the types
  for the (objectState, readOption, writeOption) enumerations
2019-04-16 12:23:01 +02:00
Mark Olesen
765493b69f ENH: generalize indirect lists and support new types
- use an IndirectListBase class for various indirect list types.

- new SortList type

  In some places the SortList can be used as a lightweight alternative
  to SortableList to have the convenience of bundling data and sort
  indices together, but while operating on existing data lists.
  In other situations, it can be useful as an alternative to
  sortedOrder.  For example,

        pointField points = ...;

        labelList order;
        sortedOrder(points, order);

        forAll(order, i)
        {
            points[order[i]] = ...;
        }

   Can be replaced with the following (with the same memory overhead)

        pointField points = ...;

        SortList<point> sortedPoints(points);

        for (point& pt : sortedPoints)
        {
            pt = ...;
        }

- new SliceList type (#1220), which can be used for stride-based
  addressing into existing lists
2019-04-11 15:24:33 +02:00
Mark Olesen
b56fbc4377 ENH: replace OSspecific clockValue with std::chrono version (#1278)
- aids with portability and maintenance (#1238)
2019-04-11 10:07:54 +02:00
Mark Olesen
d5c01f1aa4 ENH: support external MPI initialize / finalize (#1266) 2019-04-01 18:44:23 +02:00
Mark Olesen
39c91d8440 ENH: support HashTable iterator pointer dereference 2019-04-06 16:00:21 +02:00
Mark Olesen
d4eb17a9ff ENH: new sliceRange class
- this is somewhat like labelRange, but with a stride.
  Can be used to define slices (of lists, fields, ..) or as a range specifier
  for a for-loop. For example,

      for (label i : sliceRange(0, 10, 3))
      {
          ...
      }
2019-04-06 15:07:53 +02:00
Mark Olesen
06e709c26f ENH: added labelRange += and -= operators
- removed unused decrement() and increment() methods, which provided
  identical functionality as the ++, +=, --, -= operators.
2019-04-06 15:07:53 +02:00
Mark Olesen
ae94509f42 ENH: wrap internal POSIX directory reading as an iterator class 2019-04-03 17:34:56 +02:00
Mark Olesen
567fced30b ENH: add pTraits<complex> (#1247) 2019-04-04 19:00:29 +02:00
Mark Olesen
1c4e32fb6a ENH: add iterators to VectorSpace (#1265)
- this adds support for various STL operations including

    * sorting, filling, find min/max element etc.
    * for-range iteration

STYLE: use constexpr for VectorSpace rank
2019-04-04 17:14:27 +02:00
Mark Olesen
f3670521cd STYLE: use std:: qualifier on ::abort, ::exit
- consistent with use of <cstdlib> and makes for a stronger distinct
  from Foam::abort etc.
2019-04-03 20:24:30 +02:00
Mark Olesen
939144233c STYLE: adjusted wording and messages for wmake
- add an additional test for wmake pre-processing
2019-04-03 08:57:01 +02:00
Mark Olesen
89245fa796 ENH: allow space char in fileName is now configurable (#1008)
- having whitespace in fileName can be somewhat fragile since it means
  that the fileName components do not necessarily correspond to a
  'Foam::word'. But in many cases it will work provided that spaces
  are not present in the final portion of the simulation directory
  itself.

    InfoSwitches
    {
        // Allow space character in fileName (use with caution)
        allowSpaceInFileName    0;
    }

- now use doClean=true as default for fileName::validate(). Was false.

  Unlike fileName::clean() this requires no internal string rewrite
  since the characters are being copied.  Also handle any path
  separator transformations (ie, backslash => forward slash) at the
  same time. This makes it resemble the std::filesystem a bit more.
2019-04-01 16:40:22 +02:00
Mark Olesen
37819905c2 ENH: add some function support for complexField (#1247)
- operators are still incomplete, as are dimensioned fields,
  field-fields etc.

- split complexFields into separate complexField, complexVectorField files
2019-03-29 11:57:02 +01:00
Mark Olesen
fcba64913a ENH: conversion and function improvements for complex (#1247)
- add construction from and conversion to std::complex, which allows
  easier wrapping of functions

- add Foam:: functions for complex versions of sin, cos, ...
2019-03-29 11:03:48 +01:00
Mark Olesen
1788bce0a2 ENH: changed definition of complex::one (#1247)
- was historically defined as (1 1), but it is more consistent with
  the concept of one to have a real component only.

  Now defined as (1 0):  1+0i

STYLE: remove obscure '!' operator for complex conjugate

- either use the member function or the '~' operator
2019-03-27 08:24:03 +01:00
Mark Olesen
a1999bc92c ENH: additional construct/assignment methods for complex (#1247)
- construct/assign from Zero
2019-03-25 15:17:58 +01:00
mattijs
a33f1787b7 ENH: globalIndex: helper function to get remote values 2019-03-21 17:55:05 +00:00
Mark Olesen
4995fc5997 ENH: add findCell for PDRblockMesh 2019-03-14 16:24:20 +01:00
Mark Olesen
cdb36e08e9 COMP: provision for non-existence of bessel functions
- These are not defined in the C++ standard for cmath, so allow for
  compilation without them. Will need to provide replacements in the
  future or rework.
2019-03-15 11:19:15 +01:00
Mark Olesen
487877377d ENH: reorganize regular expressions and add C++11 regex support
- new regExpCxx wrapper for C++11 regex support with drop-in
  compatibility with existing code.

- regExpPosix (was regExp), for future phase out in favour of regExpCxx.

- The regExp header will continue to be used for defining an
  appropriate typedef corresponding to the preferred implementation.
2019-03-14 13:24:23 +01:00
Mark Olesen
9149b3579a ENH: PtrList and PtrListOps improvements
- PtrDynList support for move append list:
  can be used to concatenate pointer lists into a single one

- include resize in PtrDynList squeezeNull as being a natural
  combination

- support sorting operations for pointer lists (PtrListOps)
2019-03-13 10:53:28 +01:00
Mark Olesen
773ec00d4b ENH: improved consistency of surface writers (#1232)
- remove writeGeometry() in favour of write() and make it pure virtual
  so that all writers must explicitly deal with it.

- establish proxy extension at construction time and treated as an
  invariant thereafter. This avoids potentially surprising changes in
  behaviour when writing.
2019-03-11 15:09:03 +01:00
Mark Olesen
97be0673dc ENH: additional constructors for IjkField 2019-02-27 08:01:19 +01:00
Mark Olesen
4d499d3c20 ENH: basic i-j-k Field container (#1216)
- this is a simple container for fields with i-j-k addressing.

  It does not support field operations directly, but is primarily
  intended to be used when assembling field information with i-j-k
  logic. After assembly, the field can be transferred to a regular
  field for normal operations.  Eg,

      IjkField<scalar> assemble({15, 16, 200});

      // .. fill in i-j-k fields

      Field<scalar> final(std::move(assemble));
      assemble.clear();   // be pedantic
      ...
2019-02-24 18:16:17 +01:00
Mark Olesen
e9323ecbbb STYLE: use finiteVolume in Make/options placeholder 2019-02-24 17:32:13 +01:00
Mark Olesen
84270ed667 ENH: new PDRblockMesh mesh generation utility (issue #1216)
- While a rectilinear mesh can be created with blockMesh, not every mesh
  created with blockMesh will satisfy the requirements for being a
  rectilinear mesh.

  This alternative to blockMesh uses a single block that is aligned
  with the xy-z directions and specifications of the control points,
  mesh divisions and expansion ratios. For example,

    x
    {
        points  ( -13.28 -0.10 6.0 19.19 );
        nCells  (  10  12 10 );
        ratios  ( 0.2   1  5 );
    }

    y { ... }
    z { ... }

  With only one block, the boundary patch definition is simple and the
  canonical face number is used directly. For example,

    inlet
    {
        type    patch;
        faces   ( 0 );
    }
    outlet
    {
        type    patch;
        faces   ( 1 );
    }

    sides
    {
        type    patch;
        faces   ( 2 3 );
    }

    ...

- After a mesh is defined, it is trivial to retrieve mesh-related
  information such as cell-volume, cell-centres for any i-j-k location
  without an actual polyMesh.

STYLE: remove -noFunctionObjects from blockMesh

- no time loop, so function objects cannot be triggered anyhow.
2019-02-23 15:45:32 +01:00
Mark Olesen
7795adfcb4 ENH: additional PtrList constructor and memory management method
- PtrList::release() method.

  Similar to autoPtr and unique_ptr and clearer in purpose than
  using set(i,nullptr)

- Construct from List of pointers, taking ownership.

  Useful when upgrading code. Eg,

     List<polyPatch*> oldList = ...;
     PtrList<polyPatch> newList(oldList);
     ...

BUG: incorrect resizing method names (PtrDynList) in previously unused code
2019-02-22 15:55:17 +01:00
Mark Olesen
95a33c2f68 ENH: wordRes::uniq() removes all duplicates
- previously just removed duplicate literals, but now remove any
  duplicates.

- Replace previous wordHashSet implementation with a linear search
  instead. The lists are normally fairly small and mostly just have
  unique entries anyhow. This reduces the overall overhead.
2019-02-14 11:03:04 +01:00
Mark Olesen
e3e0d7c8b9 ENH: add possibility to change const reference in tmp.
- previously it was only possible to reset a pointer, but not to
  change a const-reference directly (needed a swap() to do this).
2019-02-11 18:23:06 +01:00
Mark Olesen
eaa3da72c5 ENH: extend size of NullObject for safer reinterpret cast
- previously had a single pointer/value zeros (8 bytes), this meant
  that the reinterpret cast to a List would yield a reference that
  could be unsafe under certain conditions.

  Eg,
     const labelList& myList = labelList::null();

     Info<< myList.size() << nl; // OK since size is the first parameter

     SubList<label>(myList, 0);  // Unsafe

  The SubList usage is unsafe since it passes in pointer and size into
  the underlying UList. However, the pointer from the labelList::null()
  will be whatever happens to be around in memory immediately after the
  NullObject singleton. This is mostly not a problem if the List size
  is always checked, but does mean that the data pointer is rather
  dubious.

- Increase the size of the nullObject singleton to 32 bytes of zeros
  to ensure that most reinterpret casting will not result in objects
  that reference arbitrary memory.

  The 32-byte data size is rather arbitrary, but covers most basic
  containers.
2019-02-07 11:13:13 +01:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
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
Mark Olesen
3316055267 ENH: minor adjustments to Switch
- assignment operators return a value, for consistency with bool.

- partial revert of DEFAULT_TRUE, DEFAULT_FALSE, to reduce complexity.
2019-01-29 09:38:09 +01:00
Mark Olesen
a3f960e36f ENH: add 'default' as possible Switch state, but not as input/output
- in some circumstances we need to pass a bool value upwards to the
  caller and know if the true/false value was set based on real input
  or is a default value.

  Eg, in the object::read() we might normally have

     enabled_(dict.readIfPresent(key, true));

  but would lose information about why the value is true/false.

  We can change that by using

     enabled_(dict.readIfPresent<Switch>(key, Switch::DEFAULT_ON));

  After which we can use this information is testing.

      if
      (
          child.enabled().nonDefault()
        ? child.enabled()
        : parent.enabled()
      )
      { ... }

   And thus enable output if the parent requested it explicitly or by
   default and it has not been explicitly disabled in the child.

  No difference when testing as a bool and the text representation
  of DEFAULT_ON / DEFAULT_OFF will simply be "true" / "false".

ENH: add construction of Switch from dictionary (similar to Enum)
2019-01-28 23:18:21 +01:00
Mark Olesen
87523acad3 ENH: add ListOps find/found accepting a unary predicate (#1182)
- can also be used for other purposes.
  Eg,

      if (ListOps::found(list, matcher))
      {
         ...
      }

  vs.

      if (!findStrings(matcher, list).empty())
      {
         ...
      }
2019-01-25 11:45:03 +01:00
Mark Olesen
5ec44cd51f ENH: add range check on findIndices (#1182)
- add compile-time detection of deprecated findIndex() function

- replace occurrences of findIndex() with the equivalent container
  method
2019-01-25 10:47:34 +01:00
Mark Olesen
856f45a910 Merge remote-tracking branch 'origin/master' into develop 2019-01-23 21:27:03 +01:00
Mark Olesen
a5cc0ffcad STYLE: use const reference for caught exceptions 2019-01-23 09:03:06 +01:00
Mark Olesen
8f8a4dc682 ENH: add foamDictionary -precision option (issue #1177)
- since foamDictionary doesn't use system/controlDict it will use the
  standard default precision. The '-precision' option allows adjusting
  that value.
2019-01-22 15:11:28 +01:00
Mark Olesen
73e89f9332 ENH: add UPtrList method to squeeze out (remove) null pointers
- moves any nullptr to the end of the list where they can be
  eliminated in a second step with resize()
2019-01-21 09:51:02 +01:00
Mark Olesen
ed94a2714d STYLE: use HashTable iterator 'val()' method instead of 'object()' 2019-01-18 16:26:50 +01:00
Mark Olesen
8a391b79b5 ENH: MinMax class for handling value ranges 2019-01-14 10:00:32 +01:00
Mark Olesen
00cbf5564b STYLE: add deprecated message to NamedEnum constructor
- this class really should not be used at all anymore.
  Add a message so people recognize can find any occurrences.
2019-01-10 14:49:18 +01:00
Mark Olesen
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
Andrew Heather
29315f4644 DEP: Deprecated the ensightFoamReader 2019-01-17 09:35:04 +00:00
Mark Olesen
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
Mark Olesen
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
Mark Olesen
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
Mark Olesen
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
Mark Olesen
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
Mark Olesen
907dd6d49f STYLE: consistent indentation and template parameters for FixedList 2019-01-08 21:50:12 +01:00
Mark Olesen
14a404170b ENH: for-range, forAllIters() ... in applications/utilities
- reduced clutter when iterating over containers
2019-01-07 09:20:51 +01:00
Mark Olesen
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
Mark Olesen
0dbd05daa4 STYLE: minor adjustment of test case 2019-01-03 19:16:13 +01:00
Mark Olesen
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
Mark Olesen
af310075a0 ENH: handle dimensions in dimensioned<Type>::lookupOrAddToDict (#1116) 2019-01-03 01:30:27 +01:00
Mark Olesen
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
Mark Olesen
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