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
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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