group_particles
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations
fields.hpp File Reference

Templates to construct types that tell the code which data fields are to to be read from the group and particle files. More...

Go to the source code of this file.

Classes

class  FieldCollection< field_type_, Fields >
 Template to define a "bundle" of fields. More...
 
struct  AllFields< GroupFields_, ParticleFields_ >
 Convenience type that bundles the group and particle fields. More...
 

Macros

#define FIELD(name_, dim_, value_type_, type_, coord_)
 Macro to define a new field type.
 

Typedefs

using coord_t = float
 Internal coordinate type.
 
template<typename... Fields>
using GrpFields = FieldCollection< FieldTypes::GrpFld, Fields... >
 Specialization of the FieldCollection to group fields.
 
template<typename... Fields>
using PrtFields = FieldCollection< FieldTypes::PrtFld, Fields... >
 Specialization of the FieldCollection to particle fields.
 

Enumerations

enum class  FieldTypes { GrpFld , PrtFld }
 Fields fall into two categories, group and particle fields. More...
 

Detailed Description

Templates to construct types that tell the code which data fields are to to be read from the group and particle files.

Macro Definition Documentation

◆ FIELD

#define FIELD (   name_,
  dim_,
  value_type_,
  type_,
  coord_ 
)

Macro to define a new field type.

Parameters
namethe field's name (e.g. Coordinates, GroupMass, ...). This macro will create a class with this name.
dimthe field's dimensionality.
value_typethe field's type in the data file (usually float).
typeone of the FieldTypes.
coorda boolean describing whether the field is suitable to describe positions.

See common_fields.hpp for some examples.

Typedef Documentation

◆ coord_t

using coord_t = float

Internal coordinate type.

Internally, the code converts all coordinates to a common type for efficiency. The user will not need to consider this, apart from the return type of the Callback::grp_radius method and the fact that the Callback::BaseProperties::get method will return a coord_t-pointer if a coordinate field is requested.

◆ GrpFields

template<typename... Fields>
using GrpFields = FieldCollection<FieldTypes::GrpFld, Fields...>

Specialization of the FieldCollection to group fields.

Template Parameters
Fieldsthe fields to be read from the group catalog.

◆ PrtFields

template<typename... Fields>
using PrtFields = FieldCollection<FieldTypes::PrtFld, Fields...>

Specialization of the FieldCollection to particle fields.

Template Parameters
Fieldsthe fields to be read from the particle catalog.

Enumeration Type Documentation

◆ FieldTypes

enum class FieldTypes
strong

Fields fall into two categories, group and particle fields.

Enumerator
GrpFld 

label for a group field

PrtFld 

label for a particle field