Commit Graph

652 Commits

Author SHA1 Message Date
d5ffabcd47 HashTbl - extra safety
- don't let automatic resize into integer overflow
- avoid possible overflow in increment()

StaticHashTable - fix erase()/++ as per HashTbl

- might still be worth dropping it, but at least it'll be in better
  condition when it gets chucked!
2009-11-03 17:17:45 +01:00
39159a9231 HashTbl: change allocation of end iterators
- the end iterators and canonicalSize are independent of the templated
  parameters, so move them to HashTblCore

- this avoid allocating separate end iterator at all.

  end(), cend() return a iteratorEnd.
  iterator == iteratorEnd just checks for non-NULL pointer on iterator.
  The compiler should optimize most of it away.
2009-11-03 01:01:59 +01:00
a237b7ce6e HashTbl - iterator/const_iterator implemented in terms of an iteratorBase 2009-11-01 00:54:56 +01:00
3a0c427c7b HashTbl - preparation for using interatorBase 2009-10-31 21:27:52 +01:00
a61c03a6a4 HashTbl: improve efficiency when deleting many keys and in operator==
- fix off by one error in erase/increment code
2009-10-31 00:03:02 +01:00
946aac500a HashTbl changes
- iterators store pointers instead of references to the HashTbl.
  This lets us use the default bitwise copy/assignment

- add empty constructor for iterators. It returns the equivalent to end().
  This lets us do this:
      HashTbl<label>::iterator iter;
      // some time later
      iter = find(Value);

- erase(const HashTbl<AnyType, Key, AnyHash>&) is now more generous.
  Only the Key type matters, not the hashing function.
2009-10-30 22:37:35 +01:00
1fbcb6e2c0 Added HashTbl::shrink() - but it only be useful in particular situations
- for the hashTableTest3, it seemed to slow things down a bit

loop 0 - Erased 100000 elements (size 2900000 capacity 4194304) 0.31 s
loop 1 - Erased 100000 elements (size 2800000 capacity 4194304) 0.01 s
loop 2 - Erased 100000 elements (size 2700000 capacity 4194304) 0 s
loop 3 - Erased 100000 elements (size 2600000 capacity 4194304) 0 s
loop 4 - Erased 100000 elements (size 2500000 capacity 4194304) 0.01 s
loop 5 - Erased 100000 elements (size 2400000 capacity 4194304) 0 s
loop 6 - Erased 100000 elements (size 2300000 capacity 4194304) 0 s
loop 7 - Erased 100000 elements (size 2200000 capacity 4194304) 0 s
loop 8 - Erased 100000 elements (size 2100000 capacity 4194304) 0.01 s
loop 9 - Erased 100000 elements (size 2000000 capacity 4194304) 0.44 s
loop 10 - Erased 100000 elements (size 1900000 capacity 4194304) 0.44 s
loop 11 - Erased 100000 elements (size 1800000 capacity 4194304) 0.39 s
loop 12 - Erased 100000 elements (size 1700000 capacity 4194304) 0.4 s
loop 13 - Erased 100000 elements (size 1600000 capacity 2097152) 0.15 s
loop 14 - Erased 100000 elements (size 1500000 capacity 2097152) 0.01 s
loop 15 - Erased 100000 elements (size 1400000 capacity 2097152) 0 s
loop 16 - Erased 100000 elements (size 1300000 capacity 2097152) 0 s
loop 17 - Erased 100000 elements (size 1200000 capacity 2097152) 0.01 s
loop 18 - Erased 100000 elements (size 1100000 capacity 2097152) 0 s
loop 19 - Erased 100000 elements (size 1000000 capacity 2097152) 0.27 s
loop 20 - Erased 100000 elements (size 900000 capacity 2097152) 0.2 s
loop 21 - Erased 100000 elements (size 800000 capacity 1048576) 0.1 s
loop 22 - Erased 100000 elements (size 700000 capacity 1048576) 0 s
loop 23 - Erased 100000 elements (size 600000 capacity 1048576) 0 s
loop 24 - Erased 100000 elements (size 500000 capacity 1048576) 0.12 s
loop 25 - Erased 100000 elements (size 400000 capacity 524288) 0.04 s
loop 26 - Erased 100000 elements (size 300000 capacity 524288) 0.01 s
loop 27 - Erased 100000 elements (size 200000 capacity 262144) 0.02 s
loop 28 - Erased 100000 elements (size 100000 capacity 131072) 0.02 s
loop 29 - Erased 100000 elements (size 0 capacity 2) 0 s
2009-10-30 19:28:39 +01:00
2c73afb6ec HashTbl avoid backward search in erase()
- The ideas as discussed in email

- The speedup is really there.

Before
loop 0 - Erased 100000 elements:   3.82 s
loop 1 - Erased 100000 elements:   11.45 s
loop 2 - Erased 100000 elements:   19.46 s
loop 3 - Erased 100000 elements:   27.73 s
loop 4 - Erased 100000 elements:   38.74 s
^C

After
loop 0 - Erased 100000 elements (size 2900000 capacity 8388608) 0.01 s
loop 1 - Erased 100000 elements (size 2800000 capacity 8388608) 0 s
loop 2 - Erased 100000 elements (size 2700000 capacity 8388608) 0.01 s
loop 3 - Erased 100000 elements (size 2600000 capacity 8388608) 0 s
loop 4 - Erased 100000 elements (size 2500000 capacity 8388608) 0 s
loop 5 - Erased 100000 elements (size 2400000 capacity 8388608) 0 s
loop 6 - Erased 100000 elements (size 2300000 capacity 8388608) 0 s
loop 7 - Erased 100000 elements (size 2200000 capacity 8388608) 0 s
...
2009-10-30 18:54:51 +01:00
55a89e9db3 added HashTbl as development replacement for HashTable
- rename to HashTable later when it is considered stable
2009-10-30 18:31:28 +01:00
ef350447b1 Merge commit 'OpenCFD/master' into olesenm 2009-10-19 14:21:12 +02:00
ffc9d0d97b find/replace pi/180.0 -> degToRad() and 180.0/pi -> radToDeg()
- note left utilities/mesh/advanced/collapseEdges/collapseEdges.C as-is.
  It looks suspicious, but the change was recent, so maybe it means something
2009-10-19 13:53:25 +02:00
61a577c860 minor cleanup on constants/
- removed/renamed one level of directories, not all constants are dimensioned
    global/dimensionedConstants -> global/constants/
    global/dimensionedConstants/constants/* -> global/constants/

- formatting and doxygen cleanup

- added degToRad() and radToDeg() inline functions (in mathematicalConstants)
  removed equivalent degToRad() from engineTime
2009-10-19 13:00:33 +02:00
a8f7488e0f Merge branch 'olesenm' 2009-10-13 12:39:35 +01:00
e9da288118 Reverted the Americanism "math" back to the original "mathematical" and reverted name of
the include file back to mathematicalConstants.H to make upgrading code slightly easier.
2009-10-10 22:58:58 +01:00
29f40776ed Fixing bug in faceIntersection where the sign of the distance was
being discarded on return from the triPointRef intersecion test.  Was
only appearing when using FULL_RAY tests.
2009-10-09 10:39:06 +01:00
84be998ebc Merge commit 'OpenCFD/master' into olesenm 2009-10-08 12:07:04 +02:00
c45ea2c4f1 reworked stringListOps to improve the flexibility
- added subsetStrings and inplaceSubsetString

- added class wordReListMatcher to wrap a match() for a UList<wordRe>
2009-10-08 11:32:26 +02:00
5f440f1aef Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev 2009-10-02 17:18:15 +01:00
cba2e9905c removed whitespace 2009-10-02 17:17:00 +01:00
fc039195c5 Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev 2009-10-02 10:32:43 +01:00
734a8e7d58 Consistency correction. 2009-10-02 10:31:46 +01:00
7798c4feb9 write access to tag 2009-10-01 21:21:10 +01:00
c3519f5b4a patch decomposition through mapping 2009-09-29 22:53:17 +01:00
821635d186 fix mastercell calculation 2009-09-29 20:31:24 +01:00
74ae63a6c0 minor optimization for zones checking
- when reporting is off, stop checking on the first error
2009-09-24 10:19:15 +02:00
ad5d10b817 Merge commit 'OpenCFD/master' into olesenm 2009-09-23 09:14:28 +02:00
2f9e3fa6a9 disable wildcard matching when expanding variables 2009-09-22 15:26:57 +01:00
9dea06e9d8 Merge commit 'OpenCFD/master' into olesenm 2009-09-22 09:33:23 +02:00
344a43fd37 Cleaned error title slightly 2009-09-17 17:00:43 +01:00
47d3f1c31d Improved IOerror in the same manner as error 2009-09-17 16:56:27 +01:00
1d1fd3a37c Improved the error message buffering by rewinding when the error is throw rather
than when it is initialised.  This allows messages to be created and added to.
2009-09-17 15:10:07 +01:00
c69fe0e28f minor adjustments to zone and {cell,face,point}Zones classes
- added static data member with the name associated with the zone-labels
     eg, cellLabels, etc.
  This will be useful when reading the files directly.
2009-09-17 15:44:43 +02:00
791b5aaeaa replacing isType with isA to enable directMappedWall to work 2009-09-15 17:51:59 +01:00
eef3c7ceb6 added pow025 function
- graham showed significant speedup (8-9x) for sqrt(sqrt(x)) compared to pow(x, 0.25)
2009-09-09 16:30:26 +01:00
4f4d1393fa firstTime always chooses constant 2009-09-03 12:29:49 +01:00
97af722217 Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev 2009-09-02 17:56:39 +01:00
40e22860e9 added find(name) method + general updates 2009-09-02 17:24:46 +01:00
fa5091dd50 initial error checking 2009-09-02 16:13:55 +01:00
8dcea0f8cd using new constant definitions 2009-08-28 18:04:22 +01:00
243bff1a55 initial commit of updated dimensioned constants 2009-08-28 15:23:01 +01:00
0b51b764d6 bundle outstanding send and receive requests 2009-08-25 23:03:33 +01:00
4575c3328b Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev 2009-08-18 22:12:22 +01:00
0d343e4d89 indexing error 2009-08-18 22:10:41 +01:00
dc385799db Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev 2009-08-18 10:18:55 +01:00
9b350a235d zone updates 2009-08-17 18:38:44 +01:00
52a3897863 restructured zones - now have common base (zone) 2009-08-17 17:36:37 +01:00
5896bd04f7 remove commented out code 2009-08-17 17:06:45 +01:00
6302bef159 removed duplicate comment lines 2009-08-17 14:32:44 +01:00
5c90c347f9 mapDistribute non-blocking of non-contiguous data 2009-08-13 17:28:33 +01:00
87b8f86255 illegal use of List_ELEM macro 2009-08-13 15:28:13 +01:00