Skip to main content

FieldMeta

C++: phynexis::fields::FieldMeta Python: phynexis.fields.FieldMeta Header: src/fields/core/field_meta.hpp

Schema-level metadata describing a field's name, value type, and field type (scalar vs variable-length vector). Used by FieldSchema and FieldManager for runtime field registration and I/O.

Enums

FieldType

Discriminates scalar fields from variable-length vector fields.

ValueDescription
ScalarOne value per grid index
VecXVariable-length vector per grid index

ValueType

Type tag for scalar values. Maps to phynexis primitive types.

ValueC++ TypeSize
Boolbool1 byte
Charchar1 byte
Floatfloat4 bytes
Doubledouble8 bytes
Int8int8_t1 byte
Int16int16_t2 bytes
Int32int32_t4 bytes
Int64int64_t8 bytes

Constructors

FieldMeta()

Default constructor. Creates a scalar double field named "default".

FieldMeta(name, field_type, value_type)

Create metadata with explicit parameters.

Parameters:

ParameterTypeDescription
namestrField name
field_typeFieldTypeFieldType.Scalar or FieldType.VecX
value_typeValueTypeOne of the ValueType enum values

Properties

PropertyTypeAccessDescription
namestrread/writeField name
field_typeFieldTyperead/writeScalar or VecX
value_typeValueTyperead/writePrimitive value type

Example

import phynexis

# Default construction
meta = phynexis.fields.FieldMeta()
print("default:", meta.name, meta.field_type, meta.value_type)

# Explicit construction
meta2 = phynexis.fields.FieldMeta(
"velocity",
phynexis.fields.FieldType.VecX,
phynexis.fields.ValueType.Double,
)
print("explicit:", meta2.name, meta2.field_type, meta2.value_type)

# Modify properties
meta2.name = "pressure"
meta2.field_type = phynexis.fields.FieldType.Scalar
meta2.value_type = phynexis.fields.ValueType.Float
print("modified:", meta2.name, meta2.field_type, meta2.value_type)

# Enum values
print("FieldType:", list(phynexis.fields.FieldType.__members__.keys()))
print("ValueType:", list(phynexis.fields.ValueType.__members__.keys()))

Output:

default: default FieldType.Scalar ValueType.Double
explicit: velocity FieldType.VecX ValueType.Double
modified: pressure FieldType.Scalar ValueType.Float
FieldType: ['Scalar', 'VecX']
ValueType: ['Bool', 'Char', 'Float', 'Double', 'Int8', 'Int16', 'Int32', 'Int64']

Unexposed C++ API

  • to_string(FieldType) / from_string(String) — string conversion helpers
  • to_json(json&, FieldType) / from_json(json&, FieldType&) — JSON serialization
  • to_json(json&, const FieldMeta&) / from_json(json&, FieldMeta&) — JSON serialization