Skip to content

Commit 3e4c506

Browse files
committed
Add particlePatches to JSON schema
1 parent ccb6565 commit 3e4c506

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
type = "object"
2+
title = "Particle Patches"
3+
description = "Recommended group for post-processing. It logically orders the 1D arrays of attributes into local patches of particles that can be read and processed in parallel."
4+
5+
################################
6+
# General layout of attributes #
7+
################################
8+
9+
[properties.attributes]
10+
title = "Attribute layout"
11+
description = "Custom attributes allowed, no required attributes defined."
12+
"$ref" = "attributes.json"
13+
14+
#######################################################
15+
# Definition of particle patches via #
16+
# numParticles, numParticlesOffset, offset and extent #
17+
#######################################################
18+
19+
[properties.numParticles]
20+
title = "numParticles"
21+
description = "number of particles in this patch"
22+
23+
# todo: INT type dataset
24+
"$ref" = "record_component.json"
25+
26+
27+
[properties.numParticlesOffset]
28+
title = "numParticles"
29+
description = "offset within the one-dimensional records of the particle species where the first particle in this patch is stored"
30+
31+
# todo: INT type dataset
32+
"$ref" = "record_component.json"
33+
34+
35+
[properties.offset]
36+
title = "Offset"
37+
description = "absolute position (position + positionOffset as defined above) where the particle patch begins: defines the (inclusive) lower bound with positions that are associated with the patch; the same requirements as for regular record components apply"
38+
"$ref" = "patch_record.json"
39+
40+
41+
[properties.extent]
42+
title = "Extent"
43+
description = "extent of the particle patch; the offset + extent must be larger than the maximum absolute position of particles in the patch as the exact upper bound of position offset + extent is excluded from the patch; the same requirements as for regular record components apply"
44+
"$ref" = "patch_record.json"

share/openPMD/json_schema/particle_species.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ title = "Attribute layout"
2727
description = "Custom attributes allowed, no required attributes defined."
2828
"$ref" = "attributes.json"
2929

30+
[properties.particlePatches]
31+
title = "Particle Patches"
32+
"$ref" = "particle_patches.json"
33+
3034

3135
[patternProperties."^(?!(attributes|particlePatches)).*"]
3236
title = "Record"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#########################################################
2+
# Requirement 1: Mesh-specific structure and attributes #
3+
#########################################################
4+
5+
[[allOf]]
6+
7+
type = "object"
8+
required = ["attributes"]
9+
title = "Record"
10+
description = "A list of particle quantities."
11+
12+
##############################################
13+
# Requirement 1: Generic attribute structure #
14+
##############################################
15+
16+
17+
[allOf.properties.attributes]
18+
title = "Attribute layout"
19+
"$ref" = "attributes.json"
20+
21+
#######################################################
22+
# Requirement 2: Contains components of a vector mesh #
23+
#######################################################
24+
25+
[[allOf]]
26+
title = "Contains vector components"
27+
description = "Additionally to the attributes, at least one component must be contained"
28+
# The attributes are contained in this dict, and at least one further
29+
# non-scalar component. Hence, we require at least two entries.
30+
minProperties = 2
31+
propertyNames.pattern = "^\\w*$"
32+
33+
[allOf.patternProperties]
34+
35+
[allOf.patternProperties."^(?!attributes).*"]
36+
title = "Scalar component"
37+
"$ref" = "record_component.json"

0 commit comments

Comments
 (0)