Enzo-E Fields
[ This page is under development ]
Cello allows field data to be created and operated on in Blocks of an adaptive mesh hierarchy. Enzo-E defines specific fields, as well as groups of related fields. This page documents what fields are accessed by different Methods, recommended usage of Fields when writing Methods, and a reference of the Field API.
Using Fields in Methods
Field API
- Method:
Field::Field(FieldDescr *, FieldData *)
- Summary:
Create a Field object given a Field descriptor and a Field Data object
- Return:
none
This constructor creates a new Field object given a FieldDescr (field descriptor) and FieldData (field data) object.
- Method:
Field::Field(FieldDescr *, FieldData *)
- Method:
Field(const Field & field)
- Summary:
Copy constructor
- Return:
none
- Method:
Field::operator= (const Field & field)
- Summary:
Assignment operator
- Return:
Field &
- Method:
Field::~Field()
- Summary:
Destructor
- Return:
none
- Method:
Field::pup (PUP::er &p)
- Summary:
CHARM++ Pack / Unpack function
- Return:
void
- Method:
Field::field_descr()
- Summary:
Return the field descriptor for this field
- Return:
FieldDescr *
- Method:
Field::field_data()
- Summary:
Return the field data for this field
- Return:
FieldData *
- Method:
Field::set_field_descr(FieldDescr * field_descr)
- Summary:
Set the field descriptor for the Field object
- Return:
void
- Method:
Field::set_field_data(FieldData * field_data)
- Summary:
Set the field data object for the Field object
- Return:
void
Field Descriptor
- Method:
Field::set_alignment(int alignment)
- Summary:
Set alignment
- Return:
void
- Method:
Field::set_padding(int padding)
- Summary:
Set padding
- Return:
void
- Method:
Field::set_centering(int id, int cx, int cy=0, int cz=0)
- Summary:
Set centering for a field
- Return:
void
- Method:
Field::set_ghost_depth(int id, int gx, int gy=0, int gz=0)
- Summary:
Set ghost_depth for a field
- Return:
void
- Method:
Field::set_precision(int id, int precision)
- Summary:
Set precision for a field
- Return:
void
- Method:
Field::insert_permanent(const std::string & name)
- Summary:
Insert a new field
- Return:
int
- Method:
Field::insert_temporary(const std::string & name = “”)
- Summary:
Insert a new field
- Return:
int
- Method:
Field::field_count() const
- Summary:
Return the number of fields
- Return:
int
- Method:
Field::field_name(int id) const
- Summary:
Return name of the ith field
- Return:
std::string
- Method:
Field::is_field(const std::string & name) const
- Summary:
Return whether the field has been inserted
- Return:
bool
- Method:
Field::field_id(const std::string & name) const
- Summary:
Return the integer handle for the named field
- Return:
int
Properties
- Method:
Field::groups()
- Summary:
Return the grouping object for Fields
- Return:
Grouping *
- Method:
alignment() const
- Summary:
alignment in bytes of fields in memory
- Return:
int
- Method:
padding() const
- Summary:
padding in bytes between fields in memory
- Return:
int
- Method:
centering(int id, int * cx, int * cy = 0, int * cz = 0) const
- Summary:
centering of given field
- Return:
void
- Method:
is_centered(int id) const
- Summary:
return whether the field variable is centered in the cell
- Return:
bool
- Method:
ghost_depth(int id, int * gx, int * gy = 0, int * gz = 0) const
- Summary:
depth of ghost zones of given field
- Return:
void
- Method:
precision(int id) const
- Summary:
Return precision of given field
- Return:
int
- Method:
bytes_per_element(int id) const
- Summary:
Number of bytes per element required by the given field
- Return:
int
- Method:
is_permanent (int id_field) const
- Summary:
Whether the field is permanent or temporary
- Return:
bool
- Method:
num_permanent() const
- Summary:
Return the number of permanent fields
- Return:
int
History
- Method:
set_history (int num_history)
- Summary:
Set the history depth for storing old field values
- Return:
void
- Method:
num_history () const
- Summary:
Return the number of history generations to store
- Return:
int
- Method:
save_history (double time)
- Summary:
Copy “current” fields to history
- Return:
void
Copy “current” fields to history = 1 fields (saving time), and push back older generations up to num_history()
- Method:
history_time (int ih) const
- Summary:
Return time for given history
- Return:
double
Units
- Method:
units_scale_cgs (int id, double amount)
- Summary:
scale the field to cgs units given the unit scaling factor
- Return:
void
if it’s already in cgs, then leave as-is except if it’s in cgs but the scaling factor has changed (e.g. due to expansion) then adjust for the new scaling factor
- Method:
units_scale_code (int id, double amount)
- Summary:
convert the field to “code units” given the unit scaling factor
- Return:
void
if it’s already in code units, leave it as-is warning if scaling factor has changed.
- Method:
units_scaling (const FieldDescr *, int id)
- Summary:
Return the current scaling factor of the given Field
- Return:
double
1.0 if in code units, or the scaling factor if in cgs
FieldData
- Method:
size(int * nx, int * ny = 0, int * nz = 0) const
- Summary:
Return size of fields on the data, assuming centered
- Return:
void
- Method:
dimensions(int id_field,int * mx, int * my = 0, int * mz = 0) const
- Summary:
Return dimensions of fields on the data, assuming centered
- Return:
void
- Method:
values (int id_field, int index_history=0)
- Method:
values (std::string name, int index_history=0)
- Summary:
Return full array of values for the corresponding field
- Return:
char *
Return array for the corresponding field, which may or may not contain ghosts depending on if they’re allocated
- Method:
unknowns (int id_field, int index_history=0)
- Method:
unknowns (std::string name, int index_history=0)
- Summary:
Return array for the corresponding field
- Return:
char *
Return array for the corresponding field, which does not contain ghosts whether they’re allocated or not
- Method:
permanent () const
- Summary:
Return the array of all permanent fields
- Return:
const char *
- Method:
cell_width(double xm, double xp, double * hx, double ym=0, double yp=0, double * hy=0, double zm=0, double zp=0, double * hz=0) const
- Summary:
Return width of cells along each dimension
- Return:
void
- Method:
clear (float value = 0.0, int id_first = -1, int id_last = -1)
- Summary:
Clear specified array(s) to specified value
- Return:
void
- Method:
permanent_allocated() const
- Summary:
Return whether array is allocated or not
- Return:
bool
- Method:
permanent_size() const
- Summary:
Return whether array is allocated or not
- Return:
size_t
- Method:
allocate_permanent(bool ghosts_allocated = false)
- Summary:
Allocate storage for the field data
- Return:
void
- Method:
allocate_temporary(int id)
- Summary:
Allocate storage for the temporary fields
- Return:
void
- Method:
deallocate_temporary(int id)
- Summary:
Deallocate storage for the temporary fields
- Return:
void
- Method:
reallocate_permanent(bool ghosts_allocated = false)
- Summary:
Reallocate storage for the field data
- Return:
void
Reallocate storage for the field data, e.g. when changing from ghosts to non-ghosts [ costly for large blocks ]
- Method:
deallocate_permanent()
- Summary:
Deallocate storage for the field data
- Return:
void
- Method:
ghosts_allocated() const
- Summary:
Return whether ghost cells are allocated or not.
- Return:
bool
- Method:
field_size (int id, int *nx=0, int *ny=0, int *nz=0) const
- Summary:
Return the number of elements (nx,ny,nz) along each axis
- Return:
int
Return the number of elements (nx,ny,nz) along each axis, and total number of bytes n
Debugging
- Method:
print (const char * message, bool use_file = false) const
- Summary:
Print basic field characteristics for debugging
- Return:
void
Enzo-E Fields
acceleration_x
acceleration_y
acceleration_z
B
bfieldx
bfieldx_rx
bfieldx_ry
bfieldx_rz
bfieldy
bfieldy_rx
bfieldy_ry
bfieldy_rz
bfieldz
bfieldz_rx
bfieldz_ry
bfieldz_rz
cooling_time
density
density_total
dens_rx
dens_ry
dens_rz
DI_density
DII_density
driving_x
driving_y
driving_z
e_density
gamma
H2I_density
H2II_density
HDI_density
HeI_density
HeII_density
HeIII_density
HI_density
HII_density
HM_density
internal_energy
metal_density
potential
pressure
species_De
species_DI
species_DII
species_H2I
species_H2II
species_HDI
species_HeI
species_HeII
species_HeIII
species_HI
species_HII
species_HM
temperature
total_energy
velocity_x
velocity_y
velocity_z
velox
velox_rx
velox_ry
velox_rz
veloy
veloy_rx
veloy_ry
veloy_rz
veloz
veloz_rx
veloz_ry
veloz_rz
X