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 | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -78,7 +78,7 @@ void infoHashString
void reportHashList(const UList<string>& list)
{
Info<< "contiguous = " << contiguous<string>() << nl << nl;
Info<< "contiguous = " << is_contiguous<string>::value << nl << nl;
for (const string& val : list)
{
@ -91,7 +91,7 @@ void reportHashList(const UList<string>& list)
void reportHashList(const UList<label>& list)
{
Info<<"contiguous = " << contiguous<label>() << nl << nl;
Info<<"contiguous = " << is_contiguous<label>::value << nl << nl;
for (const label val : list)
{
@ -110,7 +110,7 @@ void reportHashList(const UList<label>& list)
void reportHashList(const UList<face>& list)
{
Info<<"contiguous = " << contiguous<label>() << nl << nl;
Info<<"contiguous = " << is_contiguous<label>::value << nl << nl;
for (const face& f : list)
{
@ -157,7 +157,7 @@ typedef Pair<word> wordPair;
void reportHashList(const UList<wordPair>& list)
{
Info<<"contiguous = " << contiguous<wordPair>() << nl << nl;
Info<<"contiguous = " << is_contiguous<wordPair>::value << nl << nl;
for (const wordPair& pr : list)
{
@ -182,7 +182,7 @@ void reportHashList(const UList<wordPair>& list)
void reportHashList(const UList<labelPair>& list)
{
Info<<"contiguous = " << contiguous<labelPair>() << nl << nl;
Info<<"contiguous = " << is_contiguous<labelPair>::value << nl << nl;
for (const labelPair& pr : list)
{
@ -203,7 +203,7 @@ void reportHashList(const UList<labelPair>& list)
void reportHashList(const UList<labelPairPair>& list)
{
Info<<"contiguous = " << contiguous<labelPairPair>() << nl << nl;
Info<<"contiguous = " << is_contiguous<labelPairPair>::value << nl << nl;
for (const labelPairPair& pr : list)
{
@ -224,7 +224,7 @@ void reportHashList(const UList<labelPairPair>& list)
void reportHashList(const UList<edge>& list)
{
Info<<"contiguous = " << contiguous<edge>() << nl << nl;
Info<<"contiguous = " << is_contiguous<edge>::value << nl << nl;
for (const edge& e : list)
{
@ -245,7 +245,7 @@ void reportHashList(const UList<edge>& list)
void reportHashList(const UList<triFace>& list)
{
Info<<"contiguous = " << contiguous<triFace>() << nl << nl;
Info<<"contiguous = " << is_contiguous<triFace>::value << nl << nl;
for (const triFace& f : list)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -112,7 +112,7 @@ Ostream& printListOutputType(const char* what)
{
Info<< what
<< " (contiguous="
<< contiguous<T>() << " no_linebreak="
<< is_contiguous<T>::value << " no_linebreak="
<< Detail::ListPolicy::no_linebreak<T>::value
<< " short_length="
<< Detail::ListPolicy::short_length<T>::value << ')';

View File

@ -1,2 +1,7 @@
/* EXE_INC = */
EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/parallel/distributed/lnInclude
/* EXE_LIBS = */

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,6 +37,7 @@ Description
#include "IOstreams.H"
#include "scalar.H"
#include "vector.H"
#include "Switch.H"
#include "labelRange.H"
#include "scalarList.H"
@ -44,24 +45,43 @@ Description
#include "FixedList.H"
#include "Pair.H"
#include "distributedTriSurfaceMesh.H"
namespace Foam
{
// Wrong, but interesting to test
// template<> struct contiguous<Pair<word>> : std::true_type {};
template<> struct is_contiguous<Pair<word>> : std::true_type {};
} // End namespace Foam
} // end namespace Foam
using namespace Foam;
template<class T>
void printContiguous()
void printInfo(const char* const name = nullptr)
{
Info<<"contiguous " << typeid(T).name() << " () = "
<< contiguous<T>()
// << " value = " << contiguous<T>::value
<< nl;
if (name == nullptr)
{
Info<< typeid(T).name();
}
else
{
Info<< name;
}
Info<< " contiguous=" << Switch(is_contiguous<T>::value);
if (is_contiguous_label<T>::value)
{
Info<< " label";
}
if (is_contiguous_scalar<T>::value)
{
Info<< " scalar";
}
Info<< nl;
}
@ -74,18 +94,16 @@ int main(int argc, char *argv[])
argList::noParallel();
argList::noFunctionObjects();
#include "setRootCase.H"
printInfo<label>();
printInfo<double>();
printInfo<FixedList<double, 4>>();
printInfo<Pair<long>>();
printContiguous<label>();
printContiguous<double>();
printContiguous<FixedList<int, 2>>();
printContiguous<FixedList<int, 3>>();
printContiguous<Pair<long>>();
printInfo<FixedList<word, 2>>();
printInfo<Pair<word>>();
printContiguous<FixedList<word, 2>>();
printContiguous<Pair<word>>();
printContiguous<FixedList<FixedList<int, 2>, 2>>();
printInfo<FixedList<FixedList<int, 2>, 2>>();
printInfo<segment>();
return 0;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2012-2015 OpenFOAM Foundation

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) 2012-2015 OpenFOAM Foundation
@ -36,6 +36,7 @@ SourceFiles
#ifndef indexedCellEnum_H
#define indexedCellEnum_H
#include "contiguous.H"
#include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -63,11 +64,10 @@ public:
};
template<>
inline bool contiguous<indexedCellEnum>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for indexedCellEnum
template<> struct is_contiguous<indexedCellEnum> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2012-2016 OpenFOAM Foundation
@ -323,32 +323,26 @@ public:
} // End namespace CGAL
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
#ifdef CGAL_INEXACT
namespace Foam
{
// For inexact representations where the storage type is a double, the data
// is contiguous. This may not be true for exact number types.
template<>
inline bool contiguous
struct is_contiguous
<
CGAL::indexedVertex
<
K,
CGAL::Triangulation_vertex_base_3<K>
>
>()
{
return true;
}
CGAL::indexedVertex<K, CGAL::Triangulation_vertex_base_3<K>>
> : std::true_type {};
template<>
inline bool contiguous<CGAL::Triangulation_vertex_base_3<K>::Point>()
{
return true;
}
struct is_contiguous
<
CGAL::Triangulation_vertex_base_3<K>::Point
> : std::true_type {};
} // End namespace Foam
#endif

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) 2012-2016 OpenFOAM Foundation
@ -84,15 +84,17 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for indexedVertexEnum
template<> struct is_contiguous<indexedVertexEnum> : std::true_type {};
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
Istream& operator>>(Istream&, indexedVertexEnum::vertexType&);
Ostream& operator<<(Ostream&, const indexedVertexEnum::vertexType&);
template<>
inline bool contiguous<indexedVertexEnum>()
{
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2014 OpenFOAM Foundation
@ -38,6 +38,7 @@ SourceFiles
#ifndef volumeType_H
#define volumeType_H
#include "contiguous.H"
#include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,7 +46,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class dictionary;
class volumeType;
Istream& operator>>(Istream& is, volumeType& vt);
@ -128,9 +129,10 @@ public:
};
//- Data associated with volumeType type are contiguous
template<>
inline bool contiguous<volumeType>() {return true;}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for volumeType
template<> struct is_contiguous<volumeType> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -44,9 +44,9 @@ Foam::Ostream& Foam::IndirectListBase<T, Addr>::writeList
const label len = list.size();
// Write list contents depending on data format
if (os.format() == IOstream::ASCII || !contiguous<T>())
if (os.format() == IOstream::ASCII || !is_contiguous<T>::value)
{
if (len > 1 && contiguous<T>() && list.uniform())
if (len > 1 && is_contiguous<T>::value && list.uniform())
{
// Two or more entries, and all entries have identical values.
os << len << token::BEGIN_BLOCK << list[0] << token::END_BLOCK;
@ -60,7 +60,7 @@ Foam::Ostream& Foam::IndirectListBase<T, Addr>::writeList
&&
(
Detail::ListPolicy::no_linebreak<T>::value
|| contiguous<T>()
|| is_contiguous<T>::value
)
)
)

View File

@ -431,7 +431,7 @@ public:
unsigned seed=0
) const
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
return Hasher(obj.cdata(), N*sizeof(T), seed);
}
@ -445,6 +445,20 @@ public:
};
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- FixedList is contiguous if the type is contiguous
template<class T, unsigned N>
struct is_contiguous<FixedList<T, N>> : is_contiguous<T> {};
//- Check for FixedList of labels
template<class T, unsigned N>
struct is_contiguous_label<FixedList<T, N>> : is_contiguous_label<T> {};
//- Check for FixedList of scalars
template<class T, unsigned N>
struct is_contiguous_scalar<FixedList<T, N>> : is_contiguous_scalar<T> {};
// * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * * //
@ -465,7 +479,7 @@ struct Hash<FixedList<T, N>>
unsigned seed=0
) const
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
return Hasher(obj.cdata(), N*sizeof(T), seed);
}

View File

@ -29,7 +29,6 @@ License
#include "Istream.H"
#include "Ostream.H"
#include "token.H"
#include "contiguous.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -75,7 +74,7 @@ Foam::Ostream& Foam::FixedList<T, N>::writeList
// small and we desire a consistent appearance.
// Eg, FixedList<T,2> or Pair<T> as "(-1 -1)", not as "2{-1}"
if (os.format() == IOstream::ASCII || !contiguous<T>())
if (os.format() == IOstream::ASCII || !is_contiguous<T>::value)
{
if
(
@ -86,7 +85,7 @@ Foam::Ostream& Foam::FixedList<T, N>::writeList
&&
(
Detail::ListPolicy::no_linebreak<T>::value
|| contiguous<T>()
|| is_contiguous<T>::value
)
)
)
@ -146,7 +145,7 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, N>& list)
{
is.fatalCheck(FUNCTION_NAME);
if (is.format() == IOstream::ASCII || !contiguous<T>())
if (is.format() == IOstream::ASCII || !is_contiguous<T>::value)
{
token firstToken(is);

View File

@ -56,7 +56,7 @@ void Foam::List<T>::doResize(const label newSize)
if (overlap)
{
#ifdef USEMEMCPY
if (contiguous<T>())
if (is_contiguous<T>::value)
{
memcpy(nv, this->v_, overlap*sizeof(T));
}
@ -189,7 +189,7 @@ Foam::List<T>::List(const UList<T>& a)
doAlloc();
#ifdef USEMEMCPY
if (contiguous<T>())
if (is_contiguous<T>::value)
{
memcpy(this->v_, a.v_, this->byteSize());
}
@ -217,7 +217,7 @@ Foam::List<T>::List(const List<T>& a)
doAlloc();
#ifdef USEMEMCPY
if (contiguous<T>())
if (is_contiguous<T>::value)
{
memcpy(this->v_, a.v_, this->byteSize());
}
@ -252,7 +252,7 @@ Foam::List<T>::List(List<T>& a, bool reuse)
doAlloc();
#ifdef USEMEMCPY
if (contiguous<T>())
if (is_contiguous<T>::value)
{
memcpy(this->v_, a.v_, this->byteSize());
}
@ -456,7 +456,7 @@ void Foam::List<T>::operator=(const UList<T>& a)
if (this->size_)
{
#ifdef USEMEMCPY
if (contiguous<T>())
if (is_contiguous<T>::value)
{
memcpy(this->v_, a.v_, this->byteSize());
}

View File

@ -353,7 +353,7 @@ struct Hash<List<T>>
{
inline unsigned operator()(const UList<T>& obj, unsigned seed=0) const
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
return Hasher(obj.cdata(), obj.size()*sizeof(T), seed);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -79,7 +79,7 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& list)
// Read list contents depending on data format
if (is.format() == IOstream::ASCII || !contiguous<T>())
if (is.format() == IOstream::ASCII || !is_contiguous<T>::value)
{
// Read beginning of contents
const char delimiter = is.readBeginList("List");

View File

@ -115,7 +115,7 @@ void Foam::UList<T>::deepCopy(const UList<T>& list)
else if (len)
{
#ifdef USEMEMCPY
if (contiguous<T>())
if (is_contiguous<T>::value)
{
memcpy(this->v_, list.v_, this->byteSize());
}
@ -180,7 +180,7 @@ void Foam::UList<T>::operator=(const zero)
template<class T>
std::streamsize Foam::UList<T>::byteSize() const
{
if (!contiguous<T>())
if (!is_contiguous<T>::value)
{
FatalErrorInFunction
<< "Cannot return binary size of a list with non-primitive elements"

View File

@ -247,7 +247,7 @@ public:
//- Return the binary size in number of characters of the UList
//- if the element is a primitive type
// i.e. contiguous<T>() == true.
// i.e. is_contiguous<T>::value == true.
// Note that is of type streamsize since used in stream ops
std::streamsize byteSize() const;
@ -524,7 +524,7 @@ public:
unsigned seed=0
) const
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
return Hasher(obj.cdata(), obj.size()*sizeof(T), seed);
}
@ -591,7 +591,7 @@ struct Hash<UList<T>>
{
inline unsigned operator()(const UList<T>& obj, unsigned seed=0) const
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
return Hasher(obj.cdata(), obj.size()*sizeof(T), seed);
}

View File

@ -81,9 +81,9 @@ Foam::Ostream& Foam::UList<T>::writeList
const label len = list.size();
// Write list contents depending on data format
if (os.format() == IOstream::ASCII || !contiguous<T>())
if (os.format() == IOstream::ASCII || !is_contiguous<T>::value)
{
if (len > 1 && contiguous<T>() && list.uniform())
if (len > 1 && is_contiguous<T>::value && list.uniform())
{
// Two or more entries, and all entries have identical values.
os << len << token::BEGIN_BLOCK << list[0] << token::END_BLOCK;
@ -97,7 +97,7 @@ Foam::Ostream& Foam::UList<T>::writeList
&&
(
Detail::ListPolicy::no_linebreak<T>::value
|| contiguous<T>()
|| is_contiguous<T>::value
)
)
)
@ -213,7 +213,7 @@ Foam::Istream& Foam::operator>>(Istream& is, UList<T>& list)
// Read list contents depending on data format
if (is.format() == IOstream::ASCII || !contiguous<T>())
if (is.format() == IOstream::ASCII || !is_contiguous<T>::value)
{
// Read beginning of contents
const char delimiter = is.readBeginList("List");

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) 2011-2017 OpenFOAM Foundation
@ -62,7 +62,7 @@ void Foam::Pstream::combineGather
{
label belowID = myComm.below()[belowI];
if (contiguous<T>())
if (is_contiguous<T>::value)
{
T value;
UIPstream::read
@ -114,7 +114,7 @@ void Foam::Pstream::combineGather
<< " data:" << Value << endl;
}
if (contiguous<T>())
if (is_contiguous<T>::value)
{
UOPstream::write
(
@ -194,7 +194,7 @@ void Foam::Pstream::combineScatter
// Receive from up
if (myComm.above() != -1)
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
UIPstream::read
(
@ -236,7 +236,7 @@ void Foam::Pstream::combineScatter
Pout<< " sending to " << belowID << " data:" << Value << endl;
}
if (contiguous<T>())
if (is_contiguous<T>::value)
{
UOPstream::write
(
@ -304,7 +304,7 @@ void Foam::Pstream::listCombineGather
{
label belowID = myComm.below()[belowI];
if (contiguous<T>())
if (is_contiguous<T>::value)
{
List<T> receivedValues(Values.size());
@ -363,7 +363,7 @@ void Foam::Pstream::listCombineGather
<< " data:" << Values << endl;
}
if (contiguous<T>())
if (is_contiguous<T>::value)
{
UOPstream::write
(
@ -443,7 +443,7 @@ void Foam::Pstream::listCombineScatter
// Receive from up
if (myComm.above() != -1)
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
UIPstream::read
(
@ -485,7 +485,7 @@ void Foam::Pstream::listCombineScatter
Pout<< " sending to " << belowID << " data:" << Values << endl;
}
if (contiguous<T>())
if (is_contiguous<T>::value)
{
UOPstream::write
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -192,10 +192,11 @@ void Foam::Pstream::exchange
const bool block
)
{
if (!contiguous<T>())
// OR static_assert(is_contiguous<T>::value, "Contiguous data only!")
if (!is_contiguous<T>::value)
{
FatalErrorInFunction
<< "Continuous data only." << sizeof(T) << Foam::abort(FatalError);
<< "Contiguous data only." << sizeof(T) << Foam::abort(FatalError);
}
if (sendBufs.size() != UPstream::nProcs(comm))

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) 2011-2017 OpenFOAM Foundation
@ -64,7 +64,7 @@ void Pstream::gather
{
T value;
if (contiguous<T>())
if (is_contiguous<T>::value)
{
UIPstream::read
(
@ -95,7 +95,7 @@ void Pstream::gather
// Send up Value
if (myComm.above() != -1)
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
UOPstream::write
(
@ -161,7 +161,7 @@ void Pstream::scatter
// Receive from up
if (myComm.above() != -1)
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
UIPstream::read
(
@ -192,7 +192,7 @@ void Pstream::scatter
// (only when using a tree schedule!) first.
forAllReverse(myComm.below(), belowI)
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
UOPstream::write
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
@ -75,7 +75,7 @@ void Pstream::gatherList
label belowID = myComm.below()[belowI];
const labelList& belowLeaves = comms[belowID].allBelow();
if (contiguous<T>())
if (is_contiguous<T>::value)
{
List<T> receivedValues(belowLeaves.size() + 1);
@ -145,7 +145,7 @@ void Pstream::gatherList
<< " data:" << Values[UPstream::myProcNo(comm)] << endl;
}
if (contiguous<T>())
if (is_contiguous<T>::value)
{
List<T> sendingValues(belowLeaves.size() + 1);
sendingValues[0] = Values[UPstream::myProcNo(comm)];
@ -237,7 +237,7 @@ void Pstream::scatterList
{
const labelList& notBelowLeaves = myComm.allNotBelow();
if (contiguous<T>())
if (is_contiguous<T>::value)
{
List<T> receivedValues(notBelowLeaves.size());
@ -288,7 +288,7 @@ void Pstream::scatterList
label belowID = myComm.below()[belowI];
const labelList& notBelowLeaves = comms[belowID].allNotBelow();
if (contiguous<T>())
if (is_contiguous<T>::value)
{
List<T> sendingValues(notBelowLeaves.size());

View File

@ -634,7 +634,7 @@ void Foam::Field<Type>::writeEntry(const word& keyword, Ostream& os) const
// The contents are 'uniform' if the list is non-empty
// and all entries have identical values.
if (contiguous<Type>() && List<Type>::uniform())
if (is_contiguous<Type>::value && List<Type>::uniform())
{
os << "uniform " << this->first();
}

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) 2011-2016 OpenFOAM Foundation
@ -46,6 +46,7 @@ SourceFiles
#include "vector.H"
#include "Tuple2.H"
#include "transform.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -95,6 +96,12 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for pointConstraint
template<> struct is_contiguous<pointConstraint> : std::true_type {};
//- Reduce operator
class combineConstraintsEqOp
{
@ -102,15 +109,12 @@ public:
inline void operator()(pointConstraint&, const pointConstraint&) const;
};
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
//- Transformation function
inline pointConstraint transform(const tensor& tt, const pointConstraint& v);
//- contiguous
template<class T> bool contiguous();
template<>
inline bool contiguous<pointConstraint>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -68,7 +68,7 @@ bool Foam::Matrix<Form, Type>::readMatrix(Istream& is)
const label len = size();
// Read list contents depending on data format
if (is.format() == IOstream::ASCII || !contiguous<Type>())
if (is.format() == IOstream::ASCII || !is_contiguous<Type>::value)
{
// Read beginning of contents
char listDelimiter = is.readBeginList("Matrix");
@ -147,19 +147,19 @@ Foam::Ostream& Foam::Matrix<Form, Type>::writeMatrix
os << mat.m() << token::SPACE << mat.n();
// Write list contents depending on data format
if (os.format() == IOstream::ASCII || !contiguous<Type>())
if (os.format() == IOstream::ASCII || !is_contiguous<Type>::value)
{
if (len)
{
const Type* v = mat.cdata();
// Can the contents be considered 'uniform' (ie, identical)
if (len > 1 && contiguous<Type>() && mat.uniform())
if (len > 1 && is_contiguous<Type>::value && mat.uniform())
{
// Two or more entries, and all entries have identical values.
os << token::BEGIN_BLOCK << v[0] << token::END_BLOCK;
}
else if (len < shortLen && contiguous<Type>())
else if (len < shortLen && is_contiguous<Type>::value)
{
// Write start contents delimiter
os << token::BEGIN_LIST;

View File

@ -345,11 +345,19 @@ public:
};
//- Data associated with boundBox type are contiguous
template<>
inline bool contiguous<boundBox>() {return contiguous<point>();}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
// Global Operators
//- Contiguous data for boundBox
template<> struct is_contiguous<boundBox> : is_contiguous<point> {};
//- Contiguous scalar data for boundBox
template<> struct is_contiguous_scalar<boundBox>
:
is_contiguous_scalar<point>
{};
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
inline bool operator==(const boundBox& a, const boundBox& b);
inline bool operator!=(const boundBox& a, const boundBox& b);

View File

@ -306,12 +306,17 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for edge (a pair of labels)
template<> struct is_contiguous<edge> : std::true_type {};
//- Contiguous label data for edge (a pair of labels)
template<> struct is_contiguous_label<edge> : std::true_type {};
// * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * * //
// Edges are a pair of labels - thus contiguous
template<> inline bool contiguous<edge>() {return true;}
//- Return reverse of an edge
inline edge reverse(const edge& e)
{
@ -339,6 +344,7 @@ inline bool operator==(const edge& a, const edge& b);
inline bool operator!=(const edge& a, const edge& b);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -45,10 +45,8 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
// Forward Declarations
class labelledTri;
Istream& operator>>(Istream&, labelledTri&);
Ostream& operator<<(Ostream&, const labelledTri&);
@ -126,8 +124,13 @@ public:
};
template<>
inline bool contiguous<labelledTri>() {return true;}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for labelledTri
template<> struct is_contiguous<labelledTri> : std::true_type {};
//- Contiguous label data for labelledTri
template<> struct is_contiguous_label<labelledTri> : std::true_type {};
//- Specialization to offset faces, used in ListListOps::combineOffset

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) 2011-2017 OpenFOAM Foundation
@ -52,10 +52,11 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class cellShape;
/*---------------------------------------------------------------------------*\
class tetCell Declaration
Class tetCell Declaration
\*---------------------------------------------------------------------------*/
class tetCell
@ -120,11 +121,13 @@ public:
};
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data associated with the type are contiguous
template<>
inline bool contiguous<tetCell>() {return true;}
//- Contiguous data for tetCell
template<> struct is_contiguous<tetCell> : std::true_type {};
//- Contiguous label data for tetCell
template<> struct is_contiguous_label<tetCell> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -294,9 +294,14 @@ public:
};
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for triFace
template<> struct is_contiguous<triFace> : std::true_type {};
//- Contiguous label data for triFace
template<> struct is_contiguous_label<triFace> : std::true_type {};
template<> inline bool contiguous<triFace>() {return true;}
//- Hash specialization for triFace as a commutative hash value.
template<>

View File

@ -58,7 +58,7 @@ void Foam::globalIndex::gather
{
SubList<Type> procSlot(allFld, off[i+1]-off[i], off[i]);
if (contiguous<Type>())
if (is_contiguous<Type>::value)
{
IPstream::read
(
@ -88,7 +88,7 @@ void Foam::globalIndex::gather
{
// nonBlocking
if (!contiguous<Type>())
if (!is_contiguous<Type>::value)
{
FatalErrorInFunction
<< "nonBlocking not supported for non-contiguous data"
@ -125,7 +125,7 @@ void Foam::globalIndex::gather
|| commsType == Pstream::commsTypes::blocking
)
{
if (contiguous<Type>())
if (is_contiguous<Type>::value)
{
OPstream::write
(
@ -154,7 +154,7 @@ void Foam::globalIndex::gather
{
// nonBlocking
if (!contiguous<Type>())
if (!is_contiguous<Type>::value)
{
FatalErrorInFunction
<< "nonBlocking not supported for non-contiguous data"
@ -311,7 +311,7 @@ void Foam::globalIndex::scatter
off[i]
);
if (contiguous<Type>())
if (is_contiguous<Type>::value)
{
OPstream::write
(
@ -341,7 +341,7 @@ void Foam::globalIndex::scatter
{
// nonBlocking
if (!contiguous<Type>())
if (!is_contiguous<Type>::value)
{
FatalErrorInFunction
<< "nonBlocking not supported for non-contiguous data"
@ -383,7 +383,7 @@ void Foam::globalIndex::scatter
|| commsType == Pstream::commsTypes::blocking
)
{
if (contiguous<Type>())
if (is_contiguous<Type>::value)
{
IPstream::read
(
@ -412,7 +412,7 @@ void Foam::globalIndex::scatter
{
// nonBlocking
if (!contiguous<Type>())
if (!is_contiguous<Type>::value)
{
FatalErrorInFunction
<< "nonBlocking not supported for non-contiguous data"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2016, 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2017 OpenFOAM Foundation
@ -392,7 +392,7 @@ void Foam::mapDistributeBase::distribute
{
label nOutstanding = Pstream::nRequests();
if (!contiguous<T>())
if (!is_contiguous<T>::value)
{
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking, tag);
@ -890,7 +890,7 @@ void Foam::mapDistributeBase::distribute
{
label nOutstanding = Pstream::nRequests();
if (!contiguous<T>())
if (!is_contiguous<T>::value)
{
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking, tag);

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) 2011 OpenFOAM Foundation
@ -43,10 +43,8 @@ namespace Foam
typedef PointIndexHit<point> pointIndexHit;
//- Data associated with pointIndexHit type are contiguous
template<>
inline bool contiguous<pointIndexHit>() {return contiguous<point>();}
//- Contiguous data for pointIndexHit
template<> struct is_contiguous<pointIndexHit> : is_contiguous<point> {};
}

View File

@ -340,12 +340,19 @@ public:
};
//- Data associated with treeBoundBox type are contiguous
template<>
inline bool contiguous<treeBoundBox>() {return contiguous<boundBox>();}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for treeBoundBox
template<> struct is_contiguous<treeBoundBox> : is_contiguous<boundBox> {};
//- Contiguous scalar data for treeBoundBox
template<> struct is_contiguous_scalar<treeBoundBox>
:
is_contiguous_scalar<boundBox>
{};
// Global Operators
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
inline bool operator==(const treeBoundBox& a, const treeBoundBox& b);
inline bool operator!=(const treeBoundBox& a, const treeBoundBox& b);

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) 2016-2017 OpenFOAM Foundation
@ -38,6 +38,7 @@ SourceFiles
#ifndef Barycentric_H
#define Barycentric_H
#include "contiguous.H"
#include "VectorSpace.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -104,6 +105,21 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<Barycentric<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<Barycentric<Cmpt>> : is_contiguous_label<Cmpt> {};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<Barycentric<Cmpt>> : is_contiguous_scalar<Cmpt> {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2017 OpenFOAM Foundation
@ -117,6 +117,27 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<BarycentricTensor<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<BarycentricTensor<Cmpt>>
:
is_contiguous_label<Cmpt>
{};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<BarycentricTensor<Cmpt>>
:
is_contiguous_scalar<Cmpt>
{};
template<class Cmpt>
class typeOfTranspose<Cmpt, BarycentricTensor<Cmpt>>
{

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) 2016-2017 OpenFOAM Foundation
@ -36,34 +36,22 @@ Description
#include "scalar.H"
#include "Barycentric.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
class Random;
class cachedRandom;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef Barycentric<scalar> barycentric;
//- Generate a random barycentric coordinate within the unit tetrahedron
barycentric barycentric01(Random& rndGen);
template<>
inline bool contiguous<barycentric>()
{
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2016-2017 OpenFOAM Foundation
@ -36,7 +36,6 @@ Description
#include "scalar.H"
#include "BarycentricTensor.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,14 +46,6 @@ namespace Foam
typedef BarycentricTensor<scalar> barycentricTensor;
template<>
inline bool contiguous<barycentricTensor>()
{
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -38,6 +38,7 @@ SourceFiles
#ifndef Barycentric2D_H
#define Barycentric2D_H
#include "contiguous.H"
#include "VectorSpace.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -111,6 +112,21 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<Barycentric2D<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<Barycentric2D<Cmpt>> : is_contiguous_label<Cmpt> {};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<Barycentric2D<Cmpt>> : is_contiguous_scalar<Cmpt>{};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2017 OpenFOAM Foundation
@ -36,34 +36,23 @@ Description
#include "scalar.H"
#include "Barycentric2D.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
class Random;
class cachedRandom;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef Barycentric2D<scalar> barycentric2D;
//- Generate a random barycentric coordinate within the unit triangle
barycentric2D barycentric2D01(Random& rndGen);
template<>
inline bool contiguous<barycentric2D>()
{
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011-2016 OpenFOAM Foundation
@ -107,13 +107,27 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<DiagTensor<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<DiagTensor<Cmpt>> : is_contiguous_label<Cmpt> {};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<DiagTensor<Cmpt>> : is_contiguous_scalar<Cmpt> {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "DiagTensorI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011 OpenFOAM Foundation
@ -38,7 +38,6 @@ SourceFiles
#define diagTensor_H
#include "DiagTensor.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,12 +48,6 @@ namespace Foam
typedef DiagTensor<scalar> diagTensor;
//- Data associated with diagTensor type are contiguous
template<>
inline bool contiguous<diagTensor>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -173,6 +173,21 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Pair is contiguous if the type is contiguous
template<class T>
struct is_contiguous<Pair<T>> : is_contiguous<T> {};
//- Check for Pair of labels
template<class T>
struct is_contiguous_label<Pair<T>> : is_contiguous_label<T> {};
//- Check for Pair of scalars
template<class T>
struct is_contiguous_scalar<Pair<T>> : is_contiguous_scalar<T> {};
// * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * * //
//- Hashing for Pair data, which uses Hasher for contiguous data and
@ -182,7 +197,7 @@ struct Hash<Pair<T>>
{
inline unsigned operator()(const Pair<T>& obj, unsigned seed=0) const
{
if (contiguous<T>())
if (is_contiguous<T>::value)
{
return Hasher(obj.cdata(), sizeof(obj), seed);
}
@ -195,8 +210,6 @@ struct Hash<Pair<T>>
};
// * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * * //
//- Return reverse of a Pair
template<class T>
Pair<T> reverse(const Pair<T>& p)
@ -205,6 +218,8 @@ Pair<T> reverse(const Pair<T>& p)
}
// * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * * //
template<class T>
bool operator==(const Pair<T>& a, const Pair<T>& b)
{

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) 2011-2016 OpenFOAM Foundation
@ -39,6 +39,7 @@ SourceFiles
#ifndef SphericalTensor_H
#define SphericalTensor_H
#include "contiguous.H"
#include "VectorSpace.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -114,13 +115,33 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<SphericalTensor<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<SphericalTensor<Cmpt>>
:
is_contiguous_label<Cmpt>
{};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<SphericalTensor<Cmpt>>
:
is_contiguous_scalar<Cmpt>
{};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "SphericalTensorI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011 OpenFOAM Foundation
@ -38,7 +38,6 @@ SourceFiles
#define labelSphericalTensor_H
#include "SphericalTensor.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,11 +51,6 @@ typedef SphericalTensor<label> labelSphericalTensor;
//- Identity labelTensor
static const labelSphericalTensor labelI(1);
//- Data associated with labelSphericalTensor type are contiguous
template<>
inline bool contiguous<labelSphericalTensor>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011-2016 OpenFOAM Foundation
@ -39,7 +39,6 @@ SourceFiles
#include "SphericalTensor.H"
#include "Identity.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,11 +52,6 @@ typedef SphericalTensor<scalar> sphericalTensor;
static const sphericalTensor oneThirdI(1.0/3.0);
static const sphericalTensor twoThirdsI(2.0/3.0);
//- Specify data associated with sphericalTensor type are contiguous
template<>
inline bool contiguous<sphericalTensor>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011-2016 OpenFOAM Foundation
@ -39,6 +39,7 @@ SourceFiles
#ifndef SphericalTensor2D_H
#define SphericalTensor2D_H
#include "contiguous.H"
#include "VectorSpace.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,7 +48,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class SphericalTensor2D Declaration
Class SphericalTensor2D Declaration
\*---------------------------------------------------------------------------*/
template<class Cmpt>
@ -105,13 +106,33 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<SphericalTensor2D<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<SphericalTensor2D<Cmpt>>
:
is_contiguous_label<Cmpt>
{};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<SphericalTensor2D<Cmpt>>
:
is_contiguous_scalar<Cmpt>
{};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "SphericalTensor2DI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011 OpenFOAM Foundation
@ -39,7 +39,6 @@ SourceFiles
#include "SphericalTensor2D.H"
#include "tensor.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,12 +55,6 @@ static const sphericalTensor2D I2D(1);
static const sphericalTensor2D oneThirdI2D(1.0/3.0);
static const sphericalTensor2D twoThirdsI2D(2.0/3.0);
//- Data associated with sphericalTensor2D type are contiguous
template<>
inline bool contiguous<sphericalTensor2D>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011-2016 OpenFOAM Foundation
@ -40,6 +40,7 @@ SourceFiles
#ifndef SymmTensor_H
#define SymmTensor_H
#include "contiguous.H"
#include "VectorSpace.H"
#include "SphericalTensor.H"
@ -138,6 +139,21 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<SymmTensor<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<SymmTensor<Cmpt>> : is_contiguous_label<Cmpt> {};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<SymmTensor<Cmpt>> : is_contiguous_scalar<Cmpt> {};
template<class Cmpt>
class symmTypeOfRank<Cmpt, 2>
{
@ -153,7 +169,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "SymmTensorI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011 OpenFOAM Foundation
@ -38,7 +38,6 @@ SourceFiles
#define labelSymmTensor_H
#include "SymmTensor.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,11 +48,6 @@ namespace Foam
typedef SymmTensor<label> labelSymmTensor;
//- Data associated with labelSymmTensor type are contiguous
template<>
inline bool contiguous<labelSymmTensor>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011-2012 OpenFOAM Foundation
@ -38,7 +38,6 @@ SourceFiles
#define symmTensor_H
#include "SymmTensor.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,11 +48,6 @@ namespace Foam
typedef SymmTensor<scalar> symmTensor;
//- Data associated with symmTensor type are contiguous
template<>
inline bool contiguous<symmTensor>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011-2016 OpenFOAM Foundation
@ -40,6 +40,7 @@ SourceFiles
#ifndef SymmTensor2D_H
#define SymmTensor2D_H
#include "contiguous.H"
#include "VectorSpace.H"
#include "SphericalTensor2D.H"
@ -130,13 +131,27 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<SymmTensor2D<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<SymmTensor2D<Cmpt>> : is_contiguous_label<Cmpt> {};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<SymmTensor2D<Cmpt>> : is_contiguous_scalar<Cmpt> {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "SymmTensor2DI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011-2013 OpenFOAM Foundation
@ -38,7 +38,6 @@ SourceFiles
#define symmTensor2D_H
#include "SymmTensor2D.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,11 +48,6 @@ namespace Foam
typedef SymmTensor2D<scalar> symmTensor2D;
//- Data associated with symmTensor2D type are contiguous
template<>
inline bool contiguous<symmTensor2D>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -272,6 +272,21 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<Tensor<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<Tensor<Cmpt>> : is_contiguous_label<Cmpt> {};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<Tensor<Cmpt>> : is_contiguous_scalar<Cmpt> {};
template<class Cmpt>
class typeOfRank<Cmpt, 2>
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,7 @@ Typedef
Foam::doubleTensor
Description
A Tensor of values with double precision
A Tensor of double precision values
SourceFiles
doubleTensor.C
@ -36,7 +36,6 @@ SourceFiles
#define doubleTensor_H
#include "Tensor.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,12 +46,6 @@ namespace Foam
typedef Tensor<double> doubleTensor;
//- Data associated with doubleTensor type are contiguous
#if !defined(WM_DP)
template<>
inline bool contiguous<doubleTensor>() {return true;}
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -27,7 +27,7 @@ Typedef
Foam::floatTensor
Description
A Tensor of values with float precision
A Tensor of float precision values
SourceFiles
floatTensor.C
@ -38,7 +38,6 @@ SourceFiles
#define floatTensor_H
#include "Tensor.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,12 +48,6 @@ namespace Foam
typedef Tensor<float> floatTensor;
//- Data associated with floatTensor type are contiguous
#if !defined(WM_SP) && !defined(WM_SPDP)
template<>
inline bool contiguous<floatTensor>() {return true;}
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011 OpenFOAM Foundation
@ -27,7 +27,7 @@ Typedef
Foam::labelTensor
Description
A Tensor of values using label (integer) representation.
A Tensor of label (integer) values
SourceFiles
labelTensor.C
@ -38,7 +38,6 @@ SourceFiles
#define labelTensor_H
#include "Tensor.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,11 +48,6 @@ namespace Foam
typedef Tensor<label> labelTensor;
//- Specify data associated with labelTensor type are contiguous
template<>
inline bool contiguous<labelTensor>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011-2014 OpenFOAM Foundation
@ -41,7 +41,6 @@ SourceFiles
#include "vector.H"
#include "sphericalTensor.H"
#include "symmTensor.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -74,10 +73,6 @@ vector eigenVector
tensor eigenVectors(const symmTensor& T, const vector& lambdas);
tensor eigenVectors(const symmTensor& T);
//- Data associated with tensor type are contiguous
template<>
inline bool contiguous<tensor>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -48,8 +48,8 @@ SourceFiles
namespace Foam
{
template<class Cmpt>
class SymmTensor2D;
// Forward Declarations
template<class Cmpt> class SymmTensor2D;
/*---------------------------------------------------------------------------*\
Class Tensor2D Declaration
@ -172,13 +172,27 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<Tensor2D<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<Tensor2D<Cmpt>> : is_contiguous_label<Cmpt> {};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<Tensor2D<Cmpt>> : is_contiguous_scalar<Cmpt> {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "Tensor2DI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011-2017 OpenFOAM Foundation
@ -27,7 +27,7 @@ Typedef
Foam::tensor2D
Description
Tensor2D or scalars.
Tensor2D of scalars.
SourceFiles
tensor2D.C
@ -39,7 +39,6 @@ SourceFiles
#include "Tensor2D.H"
#include "vector2D.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,10 +59,6 @@ vector2D eigenVector
tensor2D eigenVectors(const tensor2D& t, const vector2D& lambdas);
tensor2D eigenVectors(const tensor2D& t);
//- Data associated with tensor2D type are contiguous
template<>
inline bool contiguous<tensor2D>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -43,6 +43,7 @@ SourceFiles
#ifndef Vector_H
#define Vector_H
#include "contiguous.H"
#include "VectorSpace.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -132,6 +133,21 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<Vector<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<Vector<Cmpt>> : is_contiguous_label<Cmpt> {};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<Vector<Cmpt>> : is_contiguous_scalar<Cmpt> {};
template<class Cmpt>
class typeOfRank<Cmpt, 1>
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,7 +36,6 @@ SourceFiles
#define doubleVector_H
#include "Vector.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,12 +46,6 @@ namespace Foam
typedef Vector<double> doubleVector;
//- Data associated with doubleVector type are contiguous
#if !defined(WM_DP)
template<>
inline bool contiguous<doubleVector>() {return true;}
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -2,10 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2011-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -38,7 +36,6 @@ SourceFiles
#define floatVector_H
#include "Vector.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,12 +46,6 @@ namespace Foam
typedef Vector<float> floatVector;
//- Data associated with floatVector type are contiguous
#if !defined(WM_SP) && !defined(WM_SPDP)
template<>
inline bool contiguous<floatVector>() {return true;}
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011 OpenFOAM Foundation
@ -39,7 +39,6 @@ SourceFiles
#include "label.H"
#include "Vector.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,12 +49,6 @@ namespace Foam
typedef Vector<label> labelVector;
//- Data associated with labelVector type are contiguous
template<>
inline bool contiguous<labelVector>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011 OpenFOAM Foundation
@ -39,7 +39,6 @@ SourceFiles
#include "scalar.H"
#include "Vector.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,11 +49,7 @@ namespace Foam
typedef Vector<scalar> vector;
//- Data associated with vector type are contiguous
template<>
inline bool contiguous<vector>() {return true;}
// Traits
template<class Type>
class flux

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -39,6 +39,7 @@ SourceFiles
#ifndef Vector2D_H
#define Vector2D_H
#include "contiguous.H"
#include "VectorSpace.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -115,13 +116,27 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<Vector2D<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<Vector2D<Cmpt>> : is_contiguous_label<Cmpt> {};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<Vector2D<Cmpt>> : is_contiguous_scalar<Cmpt> {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "Vector2DI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -37,7 +37,6 @@ SourceFiles
#include "label.H"
#include "Vector2D.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,12 +47,6 @@ namespace Foam
typedef Vector2D<label> labelVector2D;
//- Data associated with labelVector2D type are contiguous
template<>
inline bool contiguous<labelVector2D>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2011 OpenFOAM Foundation
@ -39,7 +39,6 @@ SourceFiles
#include "scalar.H"
#include "Vector2D.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,12 +49,6 @@ namespace Foam
typedef Vector2D<scalar> vector2D;
//- Data associated with vector2D type are contiguous
template<>
inline bool contiguous<vector2D>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -38,12 +38,12 @@ SourceFiles
#ifndef complex_H
#define complex_H
#include <complex>
#include <type_traits>
#include "scalar.H"
#include "word.H"
#include "zero.H"
#include "contiguous.H"
#include <complex>
#include <type_traits>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -344,6 +344,15 @@ namespace Detail
} // End namespace Detail
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for complex
template<> struct is_contiguous<complex> : std::true_type {};
//- Contiguous scalar data for complex
template<> struct is_contiguous_scalar<complex> : std::true_type {};
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
Istream& operator>>(Istream& is, complex& c);
@ -358,10 +367,6 @@ inline complex operator~(const complex& c);
//- Return string representation of complex
word name(const complex& c);
//- Data associated with complex type are contiguous
template<>
inline bool contiguous<complex>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,21 +23,46 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
InClass
Foam::contiguous
Class
Foam::is_contiguous
Description
Template function to specify if the data of a type are contiguous.
A template class to specify that a data type can be considered as being
contiguous in memory.
The default function specifies that data are not contiguous.
This is specialised for the types (eg, primitives) with contiguous data.
Normally only integral and floating-point types can be considered
contiguous, but some other types (eg, FixedList, Pair, Vector etc)
consisting purely of these fundamental types can be considered
as having a contiguous memory layout as well.
Note
In OpenFOAM 1906 and earlier, the contiguous trait was handled
by templated \c contiguous global functions.
While possible to mark this as deleted, this does not detect or
prevent specializations. Thus omit the usual housekeeping.
Class
Foam::is_contiguous_label
Description
A template class to specify if a data type is composed solely of
Foam::label elements.
Class
Foam::is_contiguous_scalar
Description
A template class to specify if a data type is composed solely of
Foam::scalar elements.
\*---------------------------------------------------------------------------*/
#ifndef contiguous_H
#define contiguous_H
#include "int.H"
#include "scalar.H"
#include "label.H"
#include <type_traits>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,87 +70,30 @@ Description
namespace Foam
{
// Forward Declarations
template<class T, unsigned N> class FixedList;
template<class T> class Pair;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Default definition: (integral | floating-point) are contiguous
// Base definition for (integral | floating-point) as contiguous
template<class T>
inline bool contiguous()
{
return std::is_arithmetic<T>::value;
}
struct is_contiguous
:
std::is_arithmetic<T>
{};
//
// Fixed size containers of (integral | floating-point) are contiguous
//
template<>
inline bool contiguous<FixedList<bool, 2>>() {return true;}
template<>
inline bool contiguous<Pair<bool>>() {return true;}
// Base definition for 'label'
template<class T>
struct is_contiguous_label
:
std::is_same<T, label>
{};
template<>
inline bool contiguous<FixedList<char, 2>>() {return true;}
template<>
inline bool contiguous<Pair<char>>() {return true;}
template<>
inline bool contiguous<FixedList<int8_t, 2>>() {return true;}
template<>
inline bool contiguous<Pair<int8_t>>() {return true;}
template<>
inline bool contiguous<FixedList<uint8_t, 2>>() {return true;}
template<>
inline bool contiguous<Pair<uint8_t>>() {return true;}
template<>
inline bool contiguous<FixedList<int16_t, 2>>() {return true;}
template<>
inline bool contiguous<Pair<int16_t>>() {return true;}
template<>
inline bool contiguous<FixedList<uint16_t, 2>>() {return true;}
template<>
inline bool contiguous<Pair<uint16_t>>() {return true;}
template<>
inline bool contiguous<FixedList<int32_t, 2>>() {return true;}
template<>
inline bool contiguous<Pair<int32_t>>() {return true;}
template<>
inline bool contiguous<FixedList<uint32_t, 2>>() {return true;}
template<>
inline bool contiguous<Pair<uint32_t>>() {return true;}
template<>
inline bool contiguous<FixedList<int64_t, 2>>() {return true;}
template<>
inline bool contiguous<Pair<int64_t>>() {return true;}
template<>
inline bool contiguous<FixedList<uint64_t, 2>>() {return true;}
template<>
inline bool contiguous<Pair<uint64_t>>() {return true;}
template<>
inline bool contiguous<FixedList<float, 2>>() {return true;}
template<>
inline bool contiguous<Pair<float>>() {return true;}
template<>
inline bool contiguous<FixedList<double, 2>>() {return true;}
template<>
inline bool contiguous<Pair<double>>() {return true;}
template<>
inline bool contiguous<FixedList<long double, 2>>() {return true;}
template<>
inline bool contiguous<Pair<long double>>() {return true;}
// Base definition for 'scalar'
template<class T>
struct is_contiguous_scalar
:
std::is_same<T, scalar>
{};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -50,7 +50,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
// Forward Declarations
class vectorTensorTransform;
Istream& operator>>(Istream& is, vectorTensorTransform&);
@ -172,25 +172,27 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for vectorTensorTransform
template<> struct is_contiguous<vectorTensorTransform> : std::true_type {};
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
//- Return the inverse of the given vectorTensorTransform
inline vectorTensorTransform inv(const vectorTensorTransform& tr);
//- Return a string representation of a vectorTensorTransform
word name(const vectorTensorTransform&);
//- Data associated with vectorTensorTransform type are contiguous
template<>
inline bool contiguous<vectorTensorTransform>() {return true;}
//- Template specialisations
template<>
tmp<Field<bool>> vectorTensorTransform::transform(const Field<bool>&) const;
template<>
tmp<Field<label>> vectorTensorTransform::transform(const Field<label>&) const;
template<>
tmp<Field<scalar>> vectorTensorTransform::transform(const Field<scalar>&)
const;

View File

@ -42,7 +42,6 @@ SourceFiles
#include "vector.H"
#include "tensor.H"
#include "word.H"
#include "contiguous.H"
#include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -239,6 +238,15 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for quaternion
template<> struct is_contiguous<quaternion> : std::true_type {};
//- Contiguous scalar data for quaternion
template<> struct is_contiguous_scalar<quaternion> : std::true_type {};
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
inline scalar magSqr(const quaternion& q);
@ -280,10 +288,6 @@ quaternion pow(const quaternion& q, const label power);
//- Power of a quaternion
quaternion pow(const quaternion& q, const scalar power);
//- Data associated with quaternion type are contiguous
template<>
inline bool contiguous<quaternion>() {return true;}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2004-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -47,15 +47,13 @@ SourceFiles
#include "quaternion.H"
#include "spatialTransform.H"
#include "word.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
// Forward Declarations
class septernion;
Istream& operator>>(Istream& is, septernion&);
Ostream& operator<<(Ostream& os, const septernion& C);
@ -67,7 +65,7 @@ Ostream& operator<<(Ostream& os, const septernion& C);
class septernion
{
// private data
// Private Data
//- Translation vector
vector t_;
@ -154,6 +152,15 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for septernion
template<> struct is_contiguous<septernion> : std::true_type {};
//- Contiguous scalar data for septernion
template<> struct is_contiguous_scalar<septernion> : std::true_type {};
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
//- Return the inverse of the given septernion
@ -177,10 +184,6 @@ septernion average
const UList<scalar> w
);
//- Data associated with septernion type are contiguous
template<>
inline bool contiguous<septernion>() {return true;}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //

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) 2016-2017 OpenFOAM Foundation
@ -98,6 +98,27 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<CompactSpatialTensor<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<CompactSpatialTensor<Cmpt>>
:
is_contiguous_label<Cmpt>
{};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<CompactSpatialTensor<Cmpt>>
:
is_contiguous_scalar<Cmpt>
{};
template<class Cmpt>
class typeOfInnerProduct<Cmpt, CompactSpatialTensor<Cmpt>, Tensor<Cmpt>>
{

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) 2016 OpenFOAM Foundation
@ -48,11 +48,6 @@ namespace Foam
typedef CompactSpatialTensor<scalar> compactSpatialTensor;
//- Data associated with compactSpatialTensor type are contiguous
template<>
inline bool contiguous<compactSpatialTensor>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2016 OpenFOAM Foundation
@ -97,6 +97,27 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<CompactSpatialTensorT<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<CompactSpatialTensorT<Cmpt>>
:
is_contiguous_label<Cmpt>
{};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<CompactSpatialTensorT<Cmpt>>
:
is_contiguous_scalar<Cmpt>
{};
template<class Cmpt>
class typeOfTranspose<Cmpt, CompactSpatialTensor<Cmpt>>
{

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) 2016 OpenFOAM Foundation
@ -128,6 +128,27 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<SpatialTensor<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<SpatialTensor<Cmpt>>
:
is_contiguous_label<Cmpt>
{};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<SpatialTensor<Cmpt>>
:
is_contiguous_scalar<Cmpt>
{};
template<class Cmpt>
class typeOfTranspose<Cmpt, SpatialTensor<Cmpt>>
{
@ -170,7 +191,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "SpatialTensorI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2016 OpenFOAM Foundation
@ -48,11 +48,6 @@ namespace Foam
typedef SpatialTensor<scalar> spatialTensor;
//- Data associated with spatialTensor type are contiguous
template<>
inline bool contiguous<spatialTensor>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2016 OpenFOAM Foundation
@ -158,6 +158,27 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Data are contiguous if component type is contiguous
template<class Cmpt>
struct is_contiguous<SpatialVector<Cmpt>> : is_contiguous<Cmpt> {};
//- Data are contiguous label if component type is label
template<class Cmpt>
struct is_contiguous_label<SpatialVector<Cmpt>>
:
is_contiguous_label<Cmpt>
{};
//- Data are contiguous scalar if component type is scalar
template<class Cmpt>
struct is_contiguous_scalar<SpatialVector<Cmpt>>
:
is_contiguous_scalar<Cmpt>
{};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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) 2016 OpenFOAM Foundation
@ -48,10 +48,6 @@ namespace Foam
typedef SpatialVector<scalar> spatialVector;
//- Data associated with spatialVector type are contiguous
template<>
inline bool contiguous<spatialVector>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2012-2016 OpenFOAM Foundation
@ -53,13 +53,12 @@ namespace Foam
// Forward declarations
class triad;
class quaternion;
class Istream;
class Ostream;
Istream& operator>>(Istream&, triad&);
Ostream& operator<<(Ostream&, const triad&);
class quaternion;
/*---------------------------------------------------------------------------*\
Class triad Declaration
\*---------------------------------------------------------------------------*/
@ -165,15 +164,20 @@ public:
};
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for triad
template<> struct is_contiguous<triad> : std::true_type {};
//- Contiguous 'scalar' data for triad
template<> struct is_contiguous_scalar<triad> : std::true_type {};
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
//- Return a quantity of the difference between two triads
scalar diff(const triad& A, const triad& B);
//- Data associated with quaternion type are contiguous
template<>
inline bool contiguous<triad>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2004-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -271,8 +271,7 @@ public:
//- Destructor
virtual ~smoothDelta()
{}
virtual ~smoothDelta() = default;
// Member Functions
@ -289,14 +288,13 @@ public:
} // End namespace LESModels
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Data associated with deltaData type are contiguous
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for deltaData
template<>
inline bool contiguous<LESModels::smoothDelta::deltaData>()
{
return true;
}
struct is_contiguous<LESModels::smoothDelta::deltaData> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011-2016 OpenFOAM Foundation
@ -64,16 +64,14 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class polyPatch;
class polyMesh;
class primitiveMesh;
class edge;
class face;
class polyMesh;
// Forward declaration of friend functions and operators
class directionInfo;
Istream& operator>>(Istream&, directionInfo&);
@ -86,7 +84,7 @@ Ostream& operator<<(Ostream&, const directionInfo&);
class directionInfo
{
// Private data
// Private Data
// Either mesh edge or face point
label index_;
@ -262,12 +260,10 @@ public:
};
//- Data associated with directionInfo type are contiguous
template<>
inline bool contiguous<directionInfo>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for directionInfo
template<> struct is_contiguous<directionInfo> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011-2016 OpenFOAM Foundation
@ -49,13 +49,9 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
class polyPatch;
class polyMesh;
// Forward declaration of friend functions and operators
class wallNormalInfo;
Istream& operator>>(Istream&, wallNormalInfo&);
@ -202,12 +198,10 @@ public:
};
//- Data associated with wallNormalInfo type are contiguous
template<>
inline bool contiguous<wallNormalInfo>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for wallNormalInfo
template<> struct is_contiguous<wallNormalInfo> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -46,7 +46,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class polyPatch;
class polyMesh;
class pointEdgeStructuredWalk;
@ -236,12 +236,10 @@ public:
};
//- Data associated with pointEdgeStructuredWalk type are contiguous
template<>
inline bool contiguous<pointEdgeStructuredWalk>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for pointEdgeStructuredWalk
template<> struct is_contiguous<pointEdgeStructuredWalk> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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-2016 OpenFOAM Foundation
@ -47,13 +47,9 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
class polyPatch;
class polyMesh;
// Forward declaration of friend functions and operators
class externalPointEdgePoint;
Istream& operator>>(Istream&, externalPointEdgePoint&);
@ -251,12 +247,10 @@ public:
};
//- Data associated with externalPointEdgePoint type are contiguous
template<>
inline bool contiguous<externalPointEdgePoint>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for externalPointEdgePoint
template<> struct is_contiguous<externalPointEdgePoint> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2012-2016 OpenFOAM Foundation
@ -46,13 +46,9 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
class polyPatch;
class polyMesh;
// Forward declaration of friend functions and operators
class pointEdgeCollapse;
Istream& operator>>(Istream&, pointEdgeCollapse&);
@ -221,12 +217,10 @@ public:
};
//- Data associated with pointEdgeCollapse type are contiguous
template<>
inline bool contiguous<pointEdgeCollapse>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for pointEdgeCollapse
template<> struct is_contiguous<pointEdgeCollapse> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011-2016 OpenFOAM Foundation
@ -47,12 +47,9 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class polyPatch;
class polyMesh;
// Forward declaration of friend functions and operators
class refinementData;
Istream& operator>>(Istream&, refinementData&);
@ -219,12 +216,13 @@ public:
};
//- Data associated with refinementData type are contiguous
template<>
inline bool contiguous<refinementData>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for refinementData
template<> struct is_contiguous<refinementData> : std::true_type {};
//- Contiguous label data for refinementData
template<> struct is_contiguous_label<refinementData> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011-2016 OpenFOAM Foundation
@ -47,12 +47,9 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class polyPatch;
class polyMesh;
// Forward declaration of friend functions and operators
class refinementDistanceData;
Istream& operator>>(Istream&, refinementDistanceData&);
@ -65,7 +62,6 @@ Ostream& operator<<(Ostream&, const refinementDistanceData&);
class refinementDistanceData
{
// Private data
//- Unrefined (level0) buffer size (nBufferLayers*level0Size)
@ -253,12 +249,10 @@ public:
};
//- Data associated with refinementDistanceData type are contiguous
template<>
inline bool contiguous<refinementDistanceData>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for refinementDistanceData
template<> struct is_contiguous<refinementDistanceData> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011-2016 OpenFOAM Foundation
@ -221,13 +221,10 @@ public:
};
//- Data associated with smoothData type are contiguous
template<>
inline bool contiguous<smoothData>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for smoothData
template<> struct is_contiguous<smoothData> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2010-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -212,13 +212,10 @@ public:
};
//- Data associated with sweepData type are contiguous
template<>
inline bool contiguous<sweepData>()
{
return true;
}
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for sweepData
template<> struct is_contiguous<sweepData> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011-2016 OpenFOAM Foundation
@ -53,7 +53,6 @@ SourceFiles
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class wallPointYPlus Declaration
\*---------------------------------------------------------------------------*/
@ -81,7 +80,7 @@ public:
// Static data members
//- cut-off value for y+
//- The cut-off value for y+
static scalar yPlusCutOff;
@ -144,12 +143,11 @@ public:
};
//- Data associated with pointEdgePoint type as contiguous as underlying type
// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
//- Contiguous data for wallPointYPlus
template<>
inline bool contiguous<wallPointYPlus>()
{
return contiguous<wallPointData<scalar>>();
}
struct is_contiguous<wallPointYPlus> : is_contiguous<wallPointData<scalar>> {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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 {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011-2015 OpenFOAM Foundation
@ -62,11 +62,8 @@ namespace Foam
>
> coalParcel;
template<>
inline bool contiguous<coalParcel>()
{
return false;
}
//- Non-contiguous data for coalParcel
template<> struct is_contiguous<coalParcel> : std::false_type {};
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,11 +60,9 @@ namespace Foam
>
> basicHeterogeneousReactingParcel;
//- Non-contiguous data for basicHeterogeneousReactingParcel
template<>
inline bool contiguous<basicHeterogeneousReactingParcel>()
{
return false;
}
struct is_contiguous<basicHeterogeneousReactingParcel> : std::false_type {};
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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-2016 OpenFOAM Foundation
@ -48,11 +48,9 @@ namespace Foam
{
typedef MPPICParcel<KinematicParcel<particle>> basicKinematicMPPICParcel;
//- Contiguous data for basicKinematicMPPICParcel
template<>
inline bool contiguous<basicKinematicMPPICParcel>()
{
return true;
}
struct is_contiguous<basicKinematicMPPICParcel> : std::true_type {};
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011 OpenFOAM Foundation
@ -47,11 +47,8 @@ namespace Foam
{
typedef KinematicParcel<particle> basicKinematicParcel;
template<>
inline bool contiguous<basicKinematicParcel>()
{
return true;
}
//- Contiguous data for basicKinematicParcel
template<> struct is_contiguous<basicKinematicParcel> : std::true_type {};
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011 OpenFOAM Foundation
@ -63,11 +63,9 @@ namespace Foam
>
> basicReactingMultiphaseParcel;
//- Non-contiguous data for basicReactingMultiphaseParcel
template<>
inline bool contiguous<basicReactingMultiphaseParcel>()
{
return false;
}
struct is_contiguous<basicReactingMultiphaseParcel> : std::false_type {};
}

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) 2011-2016 OpenFOAM Foundation
@ -50,11 +50,8 @@ namespace Foam
typedef ReactingParcel<ThermoParcel<KinematicParcel<particle>>>
basicReactingParcel;
template<>
inline bool contiguous<basicReactingParcel>()
{
return false;
}
//- Non-contiguous data for basicReactingParcel
template<> struct is_contiguous<basicReactingParcel> : std::false_type {};
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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) 2011-2016 OpenFOAM Foundation
@ -48,11 +48,8 @@ namespace Foam
{
typedef ThermoParcel<KinematicParcel<particle>> basicThermoParcel;
template<>
inline bool contiguous<basicThermoParcel>()
{
return true;
}
//- Contiguous data for basicThermoParcel
template<> struct is_contiguous<basicThermoParcel> : std::true_type {};
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Some files were not shown because too many files have changed in this diff Show More