Commit Graph

30 Commits

Author SHA1 Message Date
0a4c8f7266 ENH: add assignment from UIndirectList to DynamicList 2010-06-15 11:02:23 +02:00
defea5836e Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
Conflicts:
	src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
	src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C
	src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C
2010-04-13 11:07:19 +01:00
70589ddcd1 BUG: no copy constructor visible for returning DynamicLists from functions. 2010-04-08 21:03:50 +01:00
ec284e3818 BUG: DynamicList copy constructor was explicit 2010-04-07 14:24:18 +02:00
d29c438657 STYLE: use url for FSF license instead of postal address, switch to GPL v3 2010-03-29 14:07:56 +02:00
cdb8880cb3 Code clean-up 2010-01-15 15:57:44 +00:00
3345fd8378 Removed support for cint. 2009-06-22 21:03:57 +01:00
48247a3d62 consistency update
- DynamicList gets append methods as per List
- misc cosmetic changes
2009-04-27 10:08:29 +02:00
42c04b8505 Merge commit 'OpenCFD/master' into olesenm 2009-01-23 12:51:45 +01:00
6bd41c513d missing assignment operator 2009-01-23 08:59:28 +00:00
7b769b5035 added C++0x-style cbegin(), cend() iterator methods
- added STL-compatible resize() method.
  Should this be the primary entry point?

- made [DS]LListBase end iterators private
2009-01-20 10:55:39 +01:00
ba6f878f6b added copy constructor since List copy constructor does not know about allocated size 2009-01-19 12:46:00 +00:00
96751f7e02 Applied Mattijs' DynamicList copy constructor patch 2009-01-19 14:31:31 +01:00
19503c93e1 rename xfer<T> class to Xfer<T>
- The capitalization is consistent with most other template classes, but
  more importantly frees up xfer() for use as method name without needing
  special treatment to avoid ambiguities.

  It seems reasonable to have different names for transfer(...) and xfer()
  methods, since the transfer is occuring in different directions.
  The xfer() method can thus replace the recently introduced zero-parameter
  transfer() methods.
  Other name candidates (eg, yield, release, etc.) were deemed too abstract.
2009-01-05 12:30:19 +01:00
cf488912bb added xfer<...> transfer() method to various containers
- this should provide a slightly more naturally means to using transfer
  constructors, for example
          labelList list2(list1.transfer());
      vs. labelList list2(xferMove(list1));

- returns a plain list where appropriate (eg, DynamicList, SortableList)
  for example
          labelList list2(dynList1.transfer());
      vs. labelList list2(xferMoveTo<labelList>(dynList1));
2009-01-02 15:54:51 +01:00
28b200bcd9 update copyrights for 2009 2008-12-31 19:01:56 +01:00
dee34f2775 DynamicList: cosmetics
- using SizeInc to define the granularity in the SizeMult=0 needed?
2008-11-29 13:11:52 +01:00
41bbcb6337 DynamicList changes.
- setSize() adjusts the addressable length only.
  Changed setSize(label) usage to setCapacity(label) or reserve(label)
  throughout. The final name (capacity vs. storageSize() vs. whatever) can
  easily be decided at a later date.
- added setSize(label, const T&), which may still not be really useful, but
  is at least now meaningful
- made shrink() a bit more legible.
- added append(UList<T>&)
- copying from a UList avoids reallocations where possible

The following bits of code continue to use the DynamicList::setSize(), but
appear to be legitimate (or the corresponding code itself needs rethinking).

  src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointCells.C:167: error: within this context
  src/OpenFOAM/lnInclude/faceTemplates.C:44: error: within this context
  src/surfMesh/surfaceFormats/tri/TRIsurfaceFormatCore.C:178: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:737: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:741: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:745: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:749: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:754: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:935: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:940: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:1041: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:1046: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2161: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2162: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2201: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2205: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2261: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2262: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2263: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2264: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2265: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3011: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3076: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3244: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3371: error: within this context
  src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:73: error: within this context
  src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:91: error: within this context
  src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:73: error: within this context
  src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:91: error: within this context
2008-11-24 17:22:37 +01:00
129e16f975 DynamicList improvements/disambiguities
* DynamicList::allocSize(label)
  - Adjust the allocated size. The addressed list can be truncated but not
    extended, use setSize() for that.

* DynamicList::reserve(label)
  - Reserve allocation for *at least* this number of elements.
    Never shrinks the allocated size, nor touches the addressed list size.

* DynamicList::setSize(label)
  - proposed behaviour:
    Adjust the addressed list size, allocating extra space if required.
  - The current behaviour is ambiguous about what addressable size will
    actually get set and using it to extend the addressable size (as
    per List) automatically shrinks the allocated space to this size!
2008-11-23 12:17:11 +01:00
b22ada09b7 DynamicList re-visited:
- shrink() should now correctly actually shrink
 - List::transfer(DynamicList&) invokes shrink() before transferring
   contents: otherwise the ununsed allocated space is never recovered
   until much, much later.
 - DynamicList::transfer(List&) no longer throws a FatalError when
   transferring in a smaller list. The original list contents are getting
   tossed away anyhow!
2008-10-20 16:30:48 +02:00
2c6b136876 DynamicList changes
- setSize(const label)
    * When the new size is greater than the addressed list size, the allocated
      list sizes is adjusted and the addressed size does not change.
    * Otherwise the addressed list size is just reduced and the allocated
      size does not change. inline void setSize(const label);

  - setSize(const label, const T&)
    Disabled, since the usefulness and semantics are not quite clear

  - operator=(const T&)
    should not affect the allocated size (BUGFIX)
2008-10-13 11:54:19 +02:00
b770ddf357 DynamicList - consistent setSize() behaviour
- expansion of a list beyond the currently addressed list size
    changes both the allocated size and the addressed list size

  - contracting list below the currently addressed list size
    changes the addressed list size only.

  If someone really wishes to increase the underlying allocated list size
  without touching the addressed list size:

      prevSize = myList.size();
      myList.setSize(largerSize);
      myList.setSize(prevSize);

  or introduce an equivalent allocSize(const label) method if this is needed
2008-10-10 21:10:31 +02:00
b92ed1ec98 DynamicList - fixed setSize() semantics
setSize(const label)
  - When the new size is smaller than the addressed list size, the addressed
    list size is reduced and the allocated size does not change.
  - Otherwise the allocated size is adjusted, but the addressed list size
    does not change.

setSize(const label, const T&)
  - When the new size is larger than the addressed list size, both allocated
    and addressed list sizes are adjusted.

NOTE: it might be more consistent to have setSize(label) also adjust the
      addressed list size.  This also corresponds to what previous releases
      did, although I don't know if anyone has relied upon any particular
      behaviour
2008-10-10 20:58:16 +02:00
16fefa2f14 Merge branch 'master' of /home/hunt2/OpenFOAM/OpenFOAM-dev
Conflicts:

	src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
2008-09-25 09:56:08 +01:00
b496cf9cec fixes for running with range checking on List 2008-09-25 09:45:47 +01:00
71a3620ea3 List, DynamicList : cosmetics and minor bug-fix 2008-09-23 11:16:11 +02:00
c4c0f54fc6 dynamicList change 2008-09-17 11:53:14 +01:00
8a658ee063 DynamicList: cosmetics 2008-09-18 14:44:13 +02:00
02cabc3cf2 updated Copyright (C) \d+-2008 OpenCFD Ltd. 2008-06-25 15:01:46 +02:00
3170c7c0c9 Creation of OpenFOAM-dev repository 15/04/2008 2008-04-15 18:56:58 +01:00