ENH: additional contiguous traits (#1378)

- change contiguous from a series of global functions to separate
  templated traits classes:

    - is_contiguous
    - is_contiguous_label
    - is_contiguous_scalar

  The static constexpr 'value' and a constexpr conversion operator
  allow use in template expressions.  The change also makes it much
  easier to define general traits and to inherit from them.

  The is_contiguous_label and is_contiguous_scalar are special traits
  for handling data of homogeneous components of the respective types.
This commit is contained in:
Mark Olesen
2019-07-29 11:36:30 +02:00
committed by Andrew Heather
parent 3c07a1bb6f
commit 1d79c0452c
120 changed files with 950 additions and 900 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2013-2017 OpenFOAM Foundation
@ -45,11 +45,8 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class findCellParticleCloud;
// Forward declaration of friend functions and operators
class findCellParticle;
Ostream& operator<<(Ostream&, const findCellParticle&);
@ -273,11 +270,10 @@ public:
};
template<>
inline bool contiguous<findCellParticle>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for findCellParticle
template<> struct is_contiguous<findCellParticle> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //