Commit Graph

13 Commits

Author SHA1 Message Date
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
d8c0167ea8 STYLE: ensure that emptyLabelList is known from List.H
- treat as a List constant without requiring inclusion of ListOps.H

- replace use of emptyList<label>() with emptyLabelList directly.
  The emptyList<T>() casting is disallowed with many modern compilers
  and now marked as deprecated (expect early removal).

- relocate labelList typedef to List.H for more general access.
  Similar reasoning to having labelUList defined in UList.H
2018-08-01 21:27:46 +02:00
12157acf07 STYLE: suppress fatal errors for indexedOctree debug=1
- these errors are mostly rounding related (when a point is located on
  the edge of a bounding box instead of being fully inside it).

  For debug > 1, continue to treat as fatal.
2018-04-04 18:14:34 +02: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
683cfb9d97 vector::zero -> Zero 2016-04-15 11:32:42 +01:00
3963149c05 src/OpenFOAM: Moved function documentation comments into .H files and removed duplicates 2016-02-29 21:21:41 +00:00
56fa7c0906 Update code to use the simpler C++11 template syntax removing spaces between closing ">"s 2016-01-10 22:41:16 +00:00
a4ab3f61db src/OpenFOAM: Update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-08 12:23:52 +00:00
c2d3bab08e ENH: Merge searchableSurface and indexedOctree volumeType 2013-04-11 19:52:03 +01:00
74e16d7729 Reformat "template <..." to template<"
Add support for constructing VectorSpaces from forms with lower component type,
e.g. Vector<scalar> from Vector<label>
2013-02-21 15:07:50 +00:00
944b8d438b Reformat "template <..." to template<"
Add support for constructing VectorSpaces from forms with lower component type,
e.g. Vector<scalar> from Vector<label>
2013-02-21 15:07:09 +00:00
7a8a39c86c Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev 2012-02-03 14:36:04 +00:00
10b019f618 ENH: Initial commit of dynamicIndexedOctree.
Add point removal.
    Speed up point removal
    Add maximum number of levels allowed in the tree
    Add recursive subdivision upon point insertion.
2012-02-03 14:20:45 +00:00