A Field is a collection of CreativeArrayBase pointers which are accessed via FragmentID objects. More...
#include <Field.hpp>
(Note that these are not member functions.)
A Field is a collection of CreativeArrayBase pointers which are accessed via FragmentID objects.
Each entry describes a fragment of the entire field.
A field is a dataset which is given on various points of a topological space. It consists of a collection of multidimensional arrays (class MultiArray) with same dimensionality. If there is only one such multidimensional array, then the field is called contiguous, otherwise it is fragmented.
Note that the dimensionality of the arrays only corresponds to the dimensions of the topological space if that one is regular. Otherwise, the arrays will just be one-dimensional
The field class provides aging (a counter telling when it has been modified) and deferred data loading via external I/O layers (which can be added at runtime).
In other words, the data of the field are logically available as multidimensional arrays. As a special case, these data may also be portioned in multiple fragments, which are multidimensional arrays themselves. For instance, this may be useful for data from a domain-decomposed parallel computation. The fragments do not necessarily need to cover the entire domain. A sparse cover may be used to describe one level of an adaptive mesh. Mixing fragments of different dimensionality makes no sense.
A section of the fiber bundle is a Field plus coordinates.
bool Field::addFiberType | ( | TypeList_t & | TypeList | ) | const [inline] |
Add the type used by this field to the given TypeList.
The type is supposed to be stored with the properties of this field, see the getProperties() function for more information. This function does NOT load or create any data associated with this Field.
TypeList | The list of types that shall on return contain the type of this field. |
Referenced by Wizt::FieldObject::update().
RefPtr<MemCore::ChunkBase> Field::getChunk | ( | const RefPtr< FragmentID > & | FID = NullPtr() |
) | const [inline] |
Return the stored memory chunk associated with this array.
Will only work of the data for this fragment is contiguous.
RefPtr< CreativeArrayBase > Field::getCreator | ( | const RefPtr< FragmentID > & | fid = NullPtr() |
) | const |
Get the creator of an unfragmented field.
Get the data of a contigous field.
Returns Null if the data could not be created or the field is fragmented. For fragmented fields, use iterate();
Referenced by Op::apply().
const type_info& Field::getElementType | ( | ) | const [inline] |
Retrieve the element type of this field, which is stored with the properties of this field.
See the getProperties() call for more information.
Referenced by Wizt::FieldObject::update().
const FiberTypeBase& Field::getFiberType | ( | ) | const [inline] |
Retrieve the fiber type that is associated with this field.
It is stored with the properties of this field, see the getProperties() function for more information.
const type_info & Field::getFieldStorageType | ( | ) | const |
Get the type of the field.
Get the memory occupied by this field (and all of its fragments).
Note that if fragments are shared then they will be counted twice here.
RefPtr< MemArrayProperties > Field::getProperties | ( | ) | const |
Return properties associated with this field.
Note that properties are stored with field fragments as an Interface. All fragments are supposed to provide compatible properties, so this function returns the first one found with an arbitrary fragment.
RefPtr< SizeInterface > Field::getSize | ( | ) | const |
The size of the field, which is the sum of all fragments.
bool Field::isType | ( | const TypeList_t & | TL | ) | const [inline] |
Check if the type of this field is contained in the given type list.
TL | A list of types. |
Referenced by Wizt::FieldObject::update().
int Field::rank | ( | ) | const |
The dimensionality of the field, taken from the getProperties().
void Field::setCreator | ( | const RefPtr< CreativeArrayBase > & | FFC, | |
const RefPtr< FragmentID > & | fid = NullPtr() | |||
) |
Sets the creator for an unfragmented field.
An eventually existing creator is overwritten.
bool Field::setPersistentData | ( | const MemCore::RefPtr< Chunk< T > > & | Mb, | |
const MultiIndex< N > & | Dimensions, | |||
const RefPtr< FragmentID > & | FragID = NullPtr() , |
|||
const RefPtr< MemCore::Cache > & | Cache = MemCore::Cache::MemCache() | |||
) | [inline] |
A convenience function to set a field's data from a Chunk of data.
Calls setPersistentData(), as data will be kept forever in memory and never discared (use with care).
bool Field::setPersistentData | ( | const RefPtr< MemBase > & | Mb, | |
const RefPtr< FragmentID > & | fid = NullPtr() , |
|||
const RefPtr< MemCore::Cache > & | Cache = MemCore::Cache::MemCache() | |||
) |
Set data for a certain field fragment that is always kept in memory, the cache reference is just use to trace memory utilization.
As such, all data added to the cache this way will contribute to the overall memory counting, even though the data added here cannot be removed from memory.
bool Field::setPersistentData1D | ( | const MemCore::RefPtr< Chunk< T > > & | data, | |
const RefPtr< FragmentID > & | FragID = NullPtr() , |
|||
const RefPtr< MemCore::Cache > & | Cache = MemCore::Cache::MemCache() | |||
) | [inline] |
A convenience function to set a field's data from a Chunk of data, interpreting them as one-dimensional.
Calls setPersistentData(), as data will be kept forever in memory and never discarded (use with care). Use setPersistentData() to specify another dimensionality that shall be imposed on this data set.
In general, avoid using calls to setPersistentData() and derive from a CreatorBase class instead, such that data may be discarded and re-created on demand if memory is short.
void Field::Speak | ( | int | indent = 0 , |
|
int | maxindent = -1 | |||
) | const |
Informative debug message.
indent | How much to indent during printf() calls. |
bool Field::setDiscardableData | ( | const RefPtr< MemBase > & | Mb, | |
const RefPtr< MemCore::Cache > & | Cache = MemCore::Cache::MemCache() , |
|||
const RefPtr< FragmentID > & | fid = NullPtr() | |||
) | [related] |
A simplied function for data that can be discarded at any time.
It makes use of the AlzheimerCreator. ()