Commit Graph

76 Commits

Author SHA1 Message Date
Mark Olesen
018124e3bf STYLE: use 'return nullptr' for empty autoPtr/tmp returns
- both autoPtr and tmp are defined with an implicit construct from
  nullptr (but with explicit construct from a pointer to null).
  Thus is it safe to use 'nullptr' when returning an empty autoPtr or tmp.
2018-03-21 09:31:09 +01:00
Mark Olesen
5d1fb23555 ENH: code reduction in PackedList, PackedBoolList (issue #751)
- eliminate iterators from PackedList since they were unused, had
  lower performance than direct access and added unneeded complexity.

- eliminate auto-vivify for the PackedList '[] operator.
  The set() method provides any required auto-vivification and
  removing this ability from the '[]' operator allows for a lower
  when accessing the values. Replaced the previous cascade of iterators
  with simpler reference class.

PackedBoolList:

- (temporarily) eliminate logic and addition operators since
  these contained partially unclear semantics.

- the new test() method tests the value of a single bit position and
  returns a bool without any ambiguity caused by the return type
  (like the get() method), nor the const/non-const access (like
  operator[] has). The name corresponds to what std::bitset uses.

- more consistent use of PackedBoolList test(), set(), unset() methods
  for fewer operation and clearer code. Eg,

      if (list.test(index)) ...    |  if (list[index]) ...
      if (!list.test(index)) ...   |  if (list[index] == 0u) ...
      list.set(index);             |  list[index] = 1u;
      list.unset(index);           |  list[index] = 0u;

- deleted the operator=(const labelUList&) and replaced with a setMany()
  method for more clarity about the intended operation and to avoid any
  potential inadvertent behaviour.
2018-03-13 08:32:40 +01:00
Mark Olesen
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
Mark Olesen
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
Mark Olesen
345a2a42f1 ENH: simplify method names for reading argList options and arguments
- use succincter method names that more closely resemble dictionary
  and HashTable method names. This improves method name consistency
  between classes and also requires less typing effort:

    args.found(optName)        vs.  args.optionFound(optName)
    args.readIfPresent(..)     vs.  args.optionReadIfPresent(..)
    ...
    args.opt<scalar>(optName)  vs.  args.optionRead<scalar>(optName)
    args.read<scalar>(index)   vs.  args.argRead<scalar>(index)

- the older method names forms have been retained for code compatibility,
  but are now deprecated
2018-01-08 15:35:18 +01:00
Mark Olesen
bc1f2fa97e STYLE: use auto and cfind to simplify selector usage (issue #512) 2017-07-03 10:36:03 +02:00
Andrew Heather
bb67ccd37d ENH: Cleaned up hash table item found checks 2017-05-19 11:15:35 +01:00
mattijs
ae3d2f4d57 ENH: topoSet: clear sets upon writing modified mesh. Fixes #129. 2016-11-16 14:58:46 +00:00
Andrew Heather
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
Henry Weller
58f905ff70 C++11: Replaced the C NULL with the safer C++11 nullptr
Requires gcc version 4.7 or higher
2016-08-05 17:19:38 +01:00
Henry Weller
35dba48db1 createBaffles: filter zero-sized patches
Resolves patch request http://bugs.openfoam.org/view.php?id=2103
Patch contributed by Mattijs Janssens
2016-05-29 22:51:15 +01:00
Henry Weller
450728ea84 Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
Henry Weller
43beb06018 Standardized cell, patch and face loop index names 2016-04-25 10:28:32 +01:00
Henry Weller
2d5ff31649 boundaryField() -> boundaryFieldRef() 2016-04-24 22:07:37 +01:00
Andrew Heather
efb39a8790 ENH: (further) Doxygen documentation updates for module support 2016-06-27 20:34:19 +01:00
Andrew Heather
f0c3e8d599 STYLE: Updated version to 'plus' 2015-12-22 23:14:17 +00:00
Andrew Heather
0e01c44129 GIT: Resolved conflict 2015-12-09 16:19:28 +00:00
Andrew Heather
8837a89237 STYLE: Updated links from openfoam.org to openfoam.com 2015-12-09 15:03:05 +00:00
Andrew Heather
8f1d043364 GIT: Resolved conflict 2015-12-09 09:32:38 +00:00
Andrew Heather
73dac8c7ee ENH: Updating utilities based on internal development line 2015-12-02 10:17:28 +00:00
Henry Weller
e2ef006b91 applications: Update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-10 17:53:31 +00:00
Henry Weller
42fb1b9e8e Updated notImplemented -> NotImplemented
The new NotImplemented macro uses __PRETTY_FUNCTION__ for GNU compatible
compilers otherwise __func__ to provide the function name string.
2015-11-01 10:26:37 +00:00
OpenFOAM-admin
9fb26d59d3 GIT: Repo update 2014-12-11 08:35:10 +00:00
mattijs
c98456cda3 STYLE: faceZoneSelection: corrected comment 2014-07-11 10:59:08 +01:00
mattijs
994dee99df ENH: createBafflesDict: added comment 2014-04-03 12:35:10 +01:00
OpenFOAM-admin
fbb3ddf2c4 Updated for release 2.3.0 2014-02-17 10:21:46 +00:00
mattijs
6f46553895 ENH: createPatchDict: renamed dictionary entry 2013-12-11 17:16:40 +00:00
mattijs
6dca9b0961 BUG: createBaffles: preserve faceZone orientation 2013-12-09 17:20:55 +00:00
Sergio Ferraris
c56d376bae ENH: Adding 'baseGroup' option to createBaffle.C to add a pair patches but in
different groups. This is used in 3D baffle where the generated patches are not
coupled.
     The tutorial circuitBoardCooling has been updated.
2013-12-04 15:30:35 +00:00
mattijs
fe31693e30 ENH: createBafflesDict: more comment 2013-11-18 15:03:46 +00:00
mattijs
8222120fef ENH: mapped: allow coupling specification through coupleGroup 2013-11-12 15:12:56 +00:00
mattijs
975602a937 ENH: createBafflesDict: added comment 2013-05-21 15:31:07 +01:00
mattijs
bbb2077160 ENH: searhcableSurfacetoFaceZone: allow triSurfaceMesh specification 2013-04-11 15:04:39 +01:00
mattijs
1f1188120c BUG: createBaffles: handle cellcentres as positions 2013-04-02 13:53:27 +01:00
andy
951c8436aa ENH: Applying Gijs' patch: Update header documentation for utilities 2013-02-21 10:54:34 +00:00
mattijs
9ccd5809b8 BUG: sampleDict: missing type 2012-12-05 15:21:00 +00:00
mattijs
da9762184f STYLE: remove unused fields 2012-12-04 16:20:31 +00:00
mattijs
3fdc98dccd ENH: createBafflesDict: moved comment 2012-12-04 15:03:17 +00:00
mattijs
2745cd7544 ENH: createBaffles: create patches and patchFields 2012-12-04 12:02:45 +00:00
mattijs
716374286d BUG: createBaffles: duplicate command line option specification 2012-03-26 12:13:31 +01:00
mattijs
e2cc8830d4 ENH: tetrahedron: move slicing with plane. Removed tetPointRef.H 2012-01-16 15:48:15 +00:00
mattijs
6a6986b4ce BUG: createBaffles.C: converting coupled faces into baffles 2012-01-13 11:58:27 +00:00
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
andy
eaef8d482b STYLE: Updated 1991 start copyright year to 2004 2011-01-14 16:08:00 +00:00
andy
099cc39e2e Revert "STYLE: 2011 copyright date."
This reverts commit b18f6cc1ce.
2011-01-05 18:24:29 +00:00
graham
b18f6cc1ce STYLE: 2011 copyright date. 2011-01-05 11:14:26 +00:00
mattijs
b7a4b9a7bf ENH: createBaffles : set added patch faces to value 0 2010-10-13 18:12:51 +01:00
andy
4eef0cc9ce ENH: Changed default behaviour of createBaffles to not update fields 2010-10-12 11:58:50 +01:00
mattijs
f84a91d7ce Merge commit 'origin/master' into splitCyclic
Conflicts:
	applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
	applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C
	src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.C
	src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.C
	src/dynamicMesh/motionSmoother/motionSmoother.C
	src/dynamicMesh/motionSmoother/motionSmoother.H
	src/dynamicMesh/motionSmoother/motionSmootherTemplates.C
2010-05-18 13:28:21 +01:00
mattijs
e1e4098600 ENH: Have different master and slave patch to handle cyclic baffles. 2010-05-17 17:08:40 +01:00