Commit Graph

22 Commits

Author SHA1 Message Date
Mark Olesen
b0c88dff58 ENH: treat self-assignment as no-op instead of a Fatal (#1473)
- this can help if using std algorithms that return a const reference
  such as std::min() does.
2019-11-05 11:10:49 +01:00
Andrew Heather
fdf8d10ab4 Merge commit 'e9219558d7' into develop-v1906 2019-12-05 11:47:19 +00:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
de11575e1e STYLE: mark containers empty() and size() as noexcept 2019-10-02 09:04:20 +02:00
Mark Olesen
765493b69f ENH: generalize indirect lists and support new types
- use an IndirectListBase class for various indirect list types.

- new SortList type

  In some places the SortList can be used as a lightweight alternative
  to SortableList to have the convenience of bundling data and sort
  indices together, but while operating on existing data lists.
  In other situations, it can be useful as an alternative to
  sortedOrder.  For example,

        pointField points = ...;

        labelList order;
        sortedOrder(points, order);

        forAll(order, i)
        {
            points[order[i]] = ...;
        }

   Can be replaced with the following (with the same memory overhead)

        pointField points = ...;

        SortList<point> sortedPoints(points);

        for (point& pt : sortedPoints)
        {
            pt = ...;
        }

- new SliceList type (#1220), which can be used for stride-based
  addressing into existing lists
2019-04-11 15:24:33 +02:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
35d348c00d BUG: guard against potential wasted memory in DynamicField
- specialize transfer and swap to ensure allocated capacity isn't
  forgotten.
2018-03-21 15:30:14 +01:00
Mark Olesen
4cb763f9d2 STYLE: make null constructed lists constexpr, noexcept
- can assist the compiler in producing tighter code.
2018-03-19 13:53:28 +01:00
Mark Olesen
3d608bf06a ENH: remove reliance on the Xfer class (issue #639)
This class is largely a pre-C++11 holdover. It is now possible to
simply use move construct/assignment directly.

In a few rare cases (eg, polyMesh::resetPrimitives) it has been
replaced by an autoPtr.
2018-03-05 13:28:53 +01:00
Mark Olesen
5c1ec7ecb8 ENH: relocate protected List::size(label) to UList (issue #595)
- makes it accessible for containers that manage their own storage
  and derive directly from UList.

- DynamicList::min_size() method to access the corresponding
  SizeMin template parameter.

- ensure consistency in the reserve size for the constructor

      DynamicList<..> lst(N);

  now has identical sizing as

      DynamicList<..> lst();
      reserve(N);
2017-10-25 08:45:05 +02:00
Mark Olesen
049617d037 ENH: update List and DynamicList methods (issue #595)
- improve functional compatibility with DynList (remove methods)
  * eg, remove an element from any position in a DynamicList
  * reduce the number of template parameters
  * remove/subset regions of DynamicList

- propagate Swap template specializations for lists, hashtables

- move construct/assignment to various containers.

- add find/found methods for FixedList and UList for a more succinct
  (and clearer?) usage than the equivalent global findIndex() function.

- simplify List_FOR_ALL loops
2017-09-20 17:20:54 +02:00
Mark Olesen
28c75d8d7d BUG: Field construct from Xfer<Field> fails (issued #298)
- Cannot pass through to underlying list constructor directly.

- As this constructor was broken, there seem to be a number of
  workarounds scattered in the code. Could revisit them in the future
  as part of code-style:

      edgeMesh(const Xfer<pointField>&, const Xfer<edgeList>&);
      CompactIOField(const IOobject&, const Xfer<Field<T>>&);
      GlobalIOField(const IOobject&, const Xfer<Field<Type>>&);
      IOField(const IOobject&, const Xfer<Field<Type>>&);
2016-11-13 14:37:40 +01:00
Henry Weller
56fa7c0906 Update code to use the simpler C++11 template syntax removing spaces between closing ">"s 2016-01-10 22:41:16 +00:00
Henry Weller
4eba393fe1 Update code to use the simpler C++11 template syntax 2016-01-10 19:20:16 +00:00
Henry Weller
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
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01: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
13f86d8b68 ENH: DynamicField: extend to be like DynamicList. 2010-10-29 16:37:37 +01:00
Mark Olesen
3277d0573e STYLE: use 'using Field<Type>::operator[]' in DynamicField 2010-06-07 14:37:48 +02:00
Mark Olesen
d29c438657 STYLE: use url for FSF license instead of postal address, switch to GPL v3 2010-03-29 14:07:56 +02:00
mattijs
e92d84b7a9 extrudeMesh improvements 2009-06-16 16:44:35 +01:00