mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- The only reasonable means of mirroring the data layout.
The '{}' delimiters mark the extent of the binary writes.
The primitives 'label' and 'scalar' are directly supported and correspond
to known byte widths.
Using "List<scalar>" was a bad choice, since this triggers unpleasant
tokenizing behaviour. Instead use 'scalars' as a provisional placeholder
to indicates a list of scalar values. However, there is currently no
support for actually handling lists of scalars, for several reasons:
* The information is not available at compile-time.
The cloud or parcel must be queried. And it must be guaranteed
that this value is consistent for the entire cloud.
* Binary output of lists is currently not great for determining the
the encoded width:
- A zero-size list is a single '0'.
- The leading size is a non-constant number of digits.
- There are prefix/suffix newlines need to be tagged and
skipped.
The special '*' (glob) token indicates that the remaining content
has a dynamic variable length and nothing reasonable can be known
about their sizes. This is exemplified by the collision records.
101 lines
4.5 KiB
C++
101 lines
4.5 KiB
C++
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration |
|
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
|
-------------------------------------------------------------------------------
|
|
License
|
|
This file is part of OpenFOAM.
|
|
|
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
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::particle
|
|
|
|
Description
|
|
Macros for adding to particle property lists
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef particleMacros_H
|
|
#define particleMacros_H
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
namespace Foam
|
|
{
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
//- Define a static 'propertyList' for particle properties
|
|
// The property list is space-delimited with brackets for vector groupings
|
|
// \sa AddToPropertyList
|
|
#define DefinePropertyList(str) \
|
|
\
|
|
static string propertyList_; \
|
|
\
|
|
static string propertyList() \
|
|
{ \
|
|
return str; \
|
|
}
|
|
|
|
|
|
//- Add to existing static 'propertyList' for particle properties
|
|
// The property list is space-delimited with brackets for vector groupings
|
|
// \sa DefinePropertyList
|
|
#define AddToPropertyList(ParcelType, str) \
|
|
\
|
|
static string propertyList_; \
|
|
\
|
|
static string propertyList() \
|
|
{ \
|
|
return ParcelType::propertyList() + str; \
|
|
}
|
|
|
|
|
|
//- Define a static 'propertyTypes' for the types of particle properties
|
|
// Brace brackets are used to delimit binary write groups
|
|
// \sa AddToPropertyTypes
|
|
#define DefinePropertyTypes(str) \
|
|
\
|
|
static string propertyTypes_; \
|
|
\
|
|
static string propertyTypes() \
|
|
{ \
|
|
return str; \
|
|
}
|
|
|
|
|
|
//- Add to existing static 'propertyTypes' for the types of particle properties
|
|
// Brace brackets are used to delimit binary write groups
|
|
// \sa AddToPropertyTypes
|
|
#define AddToPropertyTypes(ParcelType, str) \
|
|
\
|
|
static string propertyTypes_; \
|
|
\
|
|
static string propertyTypes() \
|
|
{ \
|
|
return ParcelType::propertyTypes() + str; \
|
|
}
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
} // End namespace Foam
|
|
|
|
#endif
|
|
|
|
// ************************************************************************* //
|