ENH: group info about particle output with "{}" etc

- 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.
This commit is contained in:
Mark Olesen
2016-06-02 17:39:19 +02:00
parent 2b5e73fbce
commit 526ecfecf4
9 changed files with 16 additions and 19 deletions

View File

@ -322,7 +322,7 @@ public:
//- String representation of property types //- String representation of property types
DefinePropertyTypes DefinePropertyTypes
( (
"vector label label scalar label label label label" "{vector label label scalar label label label label}"
); );
//- Cumulative particle counter - used to provode unique ID //- Cumulative particle counter - used to provode unique ID

View File

@ -66,6 +66,7 @@ namespace Foam
//- Define a static 'propertyTypes' for the types of particle properties //- Define a static 'propertyTypes' for the types of particle properties
// Brace brackets are used to delimit binary write groups
// \sa AddToPropertyTypes // \sa AddToPropertyTypes
#define DefinePropertyTypes(str) \ #define DefinePropertyTypes(str) \
\ \
@ -78,6 +79,7 @@ namespace Foam
//- Add to existing static 'propertyTypes' for the types of particle properties //- Add to existing static 'propertyTypes' for the types of particle properties
// Brace brackets are used to delimit binary write groups
// \sa AddToPropertyTypes // \sa AddToPropertyTypes
#define AddToPropertyTypes(ParcelType, str) \ #define AddToPropertyTypes(ParcelType, str) \
\ \

View File

@ -162,12 +162,11 @@ public:
); );
//- String representation of property types //- String representation of property types
static string propertyTypes() AddToPropertyTypes
{ (
// TODO: collision information types ParcelType,
NotImplemented; "{vector vector vector} *"
return string::null; );
}
// Constructors // Constructors

View File

@ -325,7 +325,7 @@ public:
AddToPropertyTypes AddToPropertyTypes
( (
ParcelType, ParcelType,
" label" "{label"
+ " label" + " label"
+ " scalar" + " scalar"
+ " scalar" + " scalar"
@ -334,7 +334,7 @@ public:
+ " scalar" + " scalar"
+ " scalar" + " scalar"
+ " scalar" + " scalar"
+ " vector" + " vector}"
); );

View File

@ -184,7 +184,7 @@ public:
AddToPropertyTypes AddToPropertyTypes
( (
ParcelType, ParcelType,
" vector" "{vector}"
); );

View File

@ -272,9 +272,7 @@ public:
AddToPropertyTypes AddToPropertyTypes
( (
ParcelType, ParcelType,
" List<scalar>" " scalars scalars scalars"
+ " List<scalar>"
+ " List<Scalar>"
); );

View File

@ -226,8 +226,7 @@ public:
AddToPropertyTypes AddToPropertyTypes
( (
ParcelType, ParcelType,
" scalar" "{scalar} scalars"
+ " List<scalar>"
); );

View File

@ -282,8 +282,7 @@ public:
AddToPropertyTypes AddToPropertyTypes
( (
ParcelType, ParcelType,
" scalar" "{scalar scalar}"
+ " scalar"
); );

View File

@ -201,7 +201,7 @@ public:
AddToPropertyTypes AddToPropertyTypes
( (
ParcelType, ParcelType,
" scalar" "{scalar"
+ " vector" + " vector"
+ " scalar" + " scalar"
+ " scalar" + " scalar"
@ -213,7 +213,7 @@ public:
+ " scalar" + " scalar"
+ " scalar" + " scalar"
+ " scalar" + " scalar"
+ " scalar" + " scalar}"
); );