Commit Graph

25 Commits

Author SHA1 Message Date
b8d01a88ea ENH: setter/getter for octree permutation tolerance
- make template invariant
2022-11-24 12:21:01 +00:00
3d7dc6a870 ENH: reduce some internal overhead when splitting octree nodes (#2609)
- don't need separate scratch arrays (avoids possible reallocations
  when split is imbalanced)

ENH: upgrade dynamicIndexedOctree to use DynamicList directly

- with C++11 move semantics don't need lists of autoPtr
  for efficient transfers
2022-11-24 12:21:01 +00:00
b129446221 ENH: simplify sub-octant bound-box search
- basic support for splitting into two at a given position and face to keep
2022-11-24 12:21:01 +00:00
fc9311ba0d STYLE: octree pushPoint with local constexpr (more readable code) 2022-11-24 12:21:01 +00:00
3384747f9b ENH: split off template-invariant part of indexedOctree node indexing
- code reduction, reinherit for dynamicIndexedOctree

ENH: additional OBJ writing, statistics
2022-11-24 12:21:01 +00:00
27c2cdc040 ENH: vector mag(), magSqr() methods - complementary to dist(), distSqr()
ENH: use direct access to pointHit as point(), use dist(), distSqr()

- if the pointHit has already been checked for hit(), can/should
  simply use point() noexcept access subsequently to avoid redundant
  checks. Using vector distSqr() methods provides a minor optimization
  (no itermediate temporary), but can also make for clearer code.

ENH: copy construct pointIndexHit with different index

- symmetric with constructing from a pointHit with an index

STYLE: prefer pointHit point() instead of rawPoint()
2022-11-24 12:21:01 +00:00
9433898941 ENH: support construction of pointIndexHit from pointHit
STYLE: combine templated/non-templated headers (reduced clutter)

STYLE: use hitPoint(const point&) combined setter

- same as setHit() + setPoint(const point&)

ENH: expose and use labelOctBits::pack method for addressing
2022-10-31 18:36:14 +01:00
b4a482751b ENH: simplify tetrahedron and triangle handling
- combine header definitions, more pass-through methods

- face/triFace: support += operator (vertex offset)
2022-07-08 11:13:00 +02:00
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
60234ab007 STYLE: reduced nesting on return branching 2019-02-13 08:06:36 +01:00
078e34746e ENH: code adjustments for updated NullObject
- can now safely use labelList::null() instead of emptyLabelList for
  return values. No special treatment required for lists.

  Possible replacements:

      if (notNull(list) && list.size())  ->  if (list.size())
      if (isNull(list) || list.empty())  ->  if (list.empty())

  The receiver may still wish to handle differently to distinguish
  between a null list and an empty list, but no additional special
  protection is required when obtaining sizes, traversing, outputting
  etc.
2019-02-07 13:04:24 +01:00
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00: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
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