|
FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
|
A Field is a collection of CreativeArrayBase reference pointers which are accessed via FragmentID objects. More...
#include <Field.hpp>
Public Types | |
| enum class | CreationFailAlternative { Fail , Persistent , Discardable } |
| using | fragments_t = FlatMap< FragmentIndex_t, RefPtr< CreativeArrayBase > > |
| using | fragment_mutex_t = MemCore::shared_mutex |
| using | CAB_t = RefPtr< CreativeArrayBase > |
| typedef WeakPtr< Field, Field::reference_domain_t > | WeakFieldPtr_t |
| using | NamedFragment = std::pair< RefPtr< CreativeArrayBase >, RefPtr< FragmentID > > |
| using | Iterator = FragmentIterator |
| using | FragmentIterator_t = std::function< bool(const RefPtr< FragmentID > &, const RefPtr< CreativeArrayBase > &)> |
| Callback type for functions iterating over Field fragments. | |
Public Types inherited from Fiber::OwnerBase | |
| template<class ItemType > | |
| using | Item = MemCore::InterfaceData< ItemType > |
| An optional convenience class that allows to easily add arbitrary types to Intercubes . | |
Public Member Functions | |
| void | reserve_fragments (size_t N) |
| void | extremeUnction () override |
| void | clear () |
| Remove all fragments of this Field. | |
| FragmentIndex_t | getNumericalID (const RefPtr< FragmentID > &fid) |
| FragmentIndex_t | findNumericalID (const RefPtr< FragmentID > &fid) const |
| FragmentIndex_t | findNumericalIDByName (const string &FragmentName) const |
| RefPtr< FragmentID > & | makeFragmentID (const string &fragmentname) |
| Create a new fragment ID if not existent yet. | |
| RefPtr< FragmentID > & | operator[] (const string &fragmentname) |
| RefPtr< FragmentIDCollection > | getFragmentIDCollection () const override |
| DynamicSize | getFragmentLayout () const |
| const FragmentIDCollection::FragmentIDs_t & | getFragmentIDs () const |
| Return iteratable container of fragment ID's for this field. | |
| Field () | |
| Default constructor, no data or fragments. | |
| Field (const RefPtr< FragmentIDCollection > &theFragmentIDCollection) | |
| Create a new field from an existing FragmentID collection, such as an existing field. | |
| Field (const WeakPtr< Field > &SimilarField) | |
| Field (const FragmentIDCollectionProvider &FICP) | |
| Field (const RefPtr< CreativeArrayBase > &FFC, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) | |
| Create unfragmented field with data creation via Creator. | |
| Field (const RefPtr< MemBase > &Mb, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) | |
| Create unfragmented field with data stored always in memory ( calls setPersistentData() ) | |
| Field (const RefPtr< CreativeArrayBase > &FFC, const WeakPtr< Field > &SimilarField) | |
| Field (const RefPtr< MemBase > &MAb, const WeakPtr< Field > &SimilarField) | |
| Field (const RefPtr< CreativeArrayBase > &FFC, const FragmentIDCollectionProvider &FICP) | |
| Field (const RefPtr< MemBase > &MAb, const FragmentIDCollectionProvider &FICP) | |
| Field (const RefPtr< MemBase > &Mb, const RefPtr< MemCore::Cache > &Cache, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) | |
| Create unfragmented field with data stored in memory as long as the cache allows. ( calls setPersistentData() ) | |
| template<Dims_t DIMS> | |
| Field (const MultiIndex< DIMS > &NumberOfFragments, const string &FragmentNamePrefix) | |
| Create a field with a multi-dimensional regular layout for the fragments. | |
| template<Dims_t DIMS> | |
| bool | setFragmentLayout (const MultiIndex< DIMS > &NumberOfFragments, const string &FragmentNamePrefix) |
| Add a multi-dimensional regular layout for the fragments if it had no layout yet. | |
| RefPtr< MemBase > | newFragmentationArray () const |
| For fields with a fragment layout provide such in a MultiArray. | |
| template<class T , Dims_t N> | |
| Field (const MemCore::Ref< MemArray< N, T > > &MemRefPtr, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) | |
| Convenience function initializing from a Ref<> to some MemArray. | |
| template<class T , Dims_t N> | |
| Field (const MemCore::RefPtr< MemArray< N, T > > &MemRefPtr, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) | |
| Convenience function initializing from a RefPtr<> to some MemArray. | |
| template<class T , Dims_t N> | |
| Field (const MemCore::WeakPtr< MemArray< N, T > > &MemRefPtr, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) | |
| Convenience function initializing from a RefPtr<> to some MemArray. | |
| template<class T , Dims_t N> | |
| Field (const MemCore::MemVector< T > &Data, const MultiIndex< N > &Size, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) | |
| Construct an unfragmented field from a MemVector and a MultiIndex. | |
| template<class T , Dims_t N> | |
| Field (const MemCore::RefPtr< MemCore::TypedChunk< T > > &Data, const MultiIndex< N > &Size, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) | |
| Construct an unfragmented field from a Chunk of data and multidimensional index. | |
| void | own (CreativeArrayBase &CAB) |
| void | own (const RefPtr< CreativeArrayBase > &CAB) |
| bool | hasData (const RefPtr< FragmentID > &FID=nullptr) const |
| Check if there are data on this field fragment. | |
| const CAB_t & | setPersistentData (const RefPtr< MemBase > &Mb, const RefPtr< FragmentID > &=nullptr, const RefPtr< MemCore::Cache > &Cache=MemCore::Cache::MemCache(), const string &ProvenanceInfo={}) |
| Set data for a certain field fragment that is always kept in memory, the cache reference is just use to trace memory utilization. | |
| const CAB_t & | setPersistentData (const RefPtr< MemBase > &Mb, const RefPtr< FragmentID > &fID, const string &ProvenanceInfo) |
| const CAB_t & | setPersistentDataByName (const RefPtr< MemBase > &Mb, const string &FragmentName, const RefPtr< MemCore::Cache > &Cache=MemCore::Cache::MemCache()) |
| template<class T , Dims_t N> | |
| const CAB_t & | setPersistentData (const MemCore::RefPtr< Chunk< T > > &Mb, const MultiIndex< N > &Dimensions, const RefPtr< FragmentID > &FragID=nullptr, const RefPtr< MemCore::Cache > &Cache=MemCore::Cache::MemCache()) |
| A convenience function to set a field's data from a Chunk of data. | |
| template<class T , Dims_t N> | |
| const CAB_t & | setPersistentData (Chunk< T > *Mb, const MultiIndex< N > &Dimensions, const RefPtr< FragmentID > &FragID=nullptr, const RefPtr< MemCore::Cache > &Cache=MemCore::Cache::MemCache()) |
| A convenience function to set a field's data from a Chunk of data. | |
| template<class T > | |
| const CAB_t & | setPersistentData1D (const MemCore::RefPtr< Chunk< T > > &data, const RefPtr< FragmentID > &FragID=nullptr, const RefPtr< MemCore::Cache > &Cache=MemCore::Cache::MemCache()) |
| A convenience function to set a field's data from a Chunk of data, interpreting them as one-dimensional. | |
| RefPtr< MemArrayProperties > | getProperties () const |
| Return properties associated with this field. | |
| const type_info & | getFieldStorageType () const |
| Get the type of the field. | |
| const type_info & | getElementType () const |
| Retrieve the element type of this field, which is stored with the properties of this field. | |
| MemCore::WeakPtr< FiberTypeBase > | getElementFiberType () const |
| Retrieve the fiber type that is associated with this field. | |
| MemCore::WeakPtr< FiberTypeBase > | getFiberType () const |
| int | getMemoryUsage (memsize_t &UsedMemory, memsize_t &WantedMemory) const |
| Get the memory occupied by this field (and all of its fragments). | |
| bool | isType (const TypeList_t &TL) const |
| Check if the type of this field is contained in the given type list. | |
| FiberTypeIndex | getFiberTypeIndex () const |
| bool | addFiberType (TypeList_t &TypeList) const |
| Add the type used by this field to the given TypeList. | |
| const RefPtr< CreativeArrayBase > & | setCreator (const RefPtr< CreativeArrayBase > &FFC, const RefPtr< FragmentID > &=nullptr) |
| Sets the creator for an unfragmented field. | |
| const RefPtr< CreativeArrayBase > & | setCreatorByName (const RefPtr< CreativeArrayBase > &FFC, const string &FragmentName) |
| const RefPtr< CreativeArrayBase > & | setCompatibleCreator (const RefPtr< CreativeArrayBase > &CAB, const RefPtr< FragmentID > &fid=nullptr) |
| Set the creator for a fragment ID on a different Skeleton such that the fragment IDs are different, only their names matching. | |
| FunctionalCreator & | setLambda (const FunctionalCreator::Functor &F, const RefPtr< FragmentID > &fid=nullptr) |
| FunctionalCreator & | setLambda (const RefPtr< FragmentID > &fid, const FunctionalCreator::Functor &F) |
| FunctionalCreator & | setCompatibleLambda (const FunctionalCreator::Functor &F, const RefPtr< FragmentID > &fid=nullptr) |
| const RefPtr< CreativeArrayBase > & | setFunctionalCreator (const FunctionalCreator::Functor &F, const RefPtr< FragmentID > &fid=nullptr) |
| template<class Functor > | |
| FunctionalCreator & | setFunctor (const Functor &F, const RefPtr< FragmentID > &fid=nullptr) |
| Alias for setLambda(). | |
| template<class Functor > | |
| FunctionalCreator & | setFunctor (const RefPtr< FragmentID > &fid, const Functor &F) |
| Alias for setLambda(). | |
| size_t | nFragments () const |
| The number of fragments in this field. | |
| size_t | NumberOfFragments () const |
| The number of fragments in this field. | |
| bool | isUnfragmented () const |
| bool | isFragmented () const |
| RefPtr< FragmentID > | getFragmentID (const string &FragmentName) const |
| RefPtr< FragmentID > | operator() (const string &FragmentName) const |
| RefPtr< CreativeArrayBase > | getCreator (const RefPtr< FragmentID > &=nullptr) const |
| Get the creator of an unfragmented field. | |
| RefPtr< CreativeArrayBase > | operator() (const RefPtr< FragmentID > &FID=nullptr) const |
| RefPtr< CreativeArrayBase > | getCreatorByName (const string &FragmentName) const |
| Get the creator of an unfragmented field via the textual description of a fragment ID. | |
| NamedFragment | getCreatorByNameF (const string &FragmentName) const |
| RefPtr< CreativeArrayBase > | getCreatorByNumericalID (FragmentIndex_t NumericalID) const |
| RefPtr< CreativeArrayBase > & | getCreatorReferenceViaFragmentIndex (FragmentIndex_t NumericalID) |
| RefPtr< CreativeArrayBase > | getCreator (FragmentIndex_t NumericalID) const |
| RefPtr< CreativeArrayBase > | getCompatibleCreator (const RefPtr< FragmentID > &F=nullptr) const |
| Get a creator from a fragment ID that is NAMED similar to one fragment here. | |
| NamedFragment | getCompatibleCreatorF (const RefPtr< FragmentID > &F=nullptr) const |
| Get a creator from a fragment ID that is NAMED similar to one fragment here. | |
| RefPtr< MemBase > | getData (const RefPtr< FragmentID > &FID=nullptr) const |
| Get the data of a contigous field. | |
| RefPtr< MemBase > | getDataByNumericalID (FragmentIndex_t NumericalID) const |
| Get some fragment's data via its numerical fragment ID. | |
| DEPRECATED ("Use function getDataByNumericalID() instead", RefPtr< MemBase > getData(FragmentIndex_t NumericalID) const) | |
| RefPtr< MemBase > | getFirstData () const |
| In case this is field is fragmented, but there is only one fragment, return the ID of this singular fragment. | |
| RefPtr< CreativeArrayBase > | getFirstCreator () const |
| In case this is field is fragmented, but there is only one fragment, return the ID of this singular fragment. | |
| RefPtr< FragmentID > | getFirstFragmentID () const |
| Get the first fragment ID. | |
| RefPtr< MemCore::ChunkBase > | getChunk (const RefPtr< FragmentID > &FID=nullptr) const |
| Return the stored memory chunk associated with this array. | |
| RefPtr< MemBase > | getCompatibleData (const RefPtr< FragmentID > &F=nullptr) const |
| Get data from a fragment ID that is NAMED similar to one fragment here. | |
| unsigned | iterate (FragmentIterator &, const MemCore::WeakPtr< FragmentSelector > &FS=nullptr) const |
| template<class T > | |
| unsigned | Iterate (const T &t, const MemCore::WeakPtr< FragmentSelector > &FS=nullptr) const |
| template<class T > | |
| unsigned | iterate_fragments (const T &t, const MemCore::WeakPtr< FragmentSelector > &FS=nullptr) const |
| Ageable | getMostRecentCreatorAge () const |
| Ageable | getMostRecentAttributeAge () const |
| bool | hasFragmentsNewerThan (const Ageable &A) const |
| unsigned | iterate (const FragmentIterator_t &FI, bool parallel=false, bool copy_map_internally=false) const |
| unsigned | iterate (bool parallel, const FragmentIterator_t &FI, bool copy_map_internally=false) const |
| Same as iterate(const FragmentIterator_t&, bool), just other order of arguments for convenience. | |
| unsigned | iterate_parallel (const FragmentIterator_t &FI, bool copy_map_internally=false) const |
| Iterate over all fragments in parallel. | |
| unsigned | iterate (FragmentIndexIterator &FFI, const WeakPtr< FragmentSelector > &FS=nullptr, bool copy_map_internally=false) const |
| Iterate over the fragments of a field using the integer ID of each fragment. | |
| Dims_t | Dims () const |
| The dimensionality of the field, taken from the getProperties(). | |
| RefPtr< SizeInterface > | getSize () const |
| The size of the field, which is the sum of all fragments. | |
| bool | isCompatible (const Field &F) |
| void | Speak (int indent=0, int maxindent=-1) const |
| Informative debug message. | |
| string | xml () const |
| RefPtr< CreativeArrayBase > | createCreator (const RefPtr< MemBase > &Data, const RefPtr< FragmentID > &=nullptr, CreationFailAlternative=CreationFailAlternative::Persistent, const WeakPtr< MemCore::Cache > &theCache=MemCore::Cache::MemCache()) |
| Insert some data into a Field with various memory management methods. | |
| RefPtr< CreativeArrayBase > | createCreator (const RefPtr< MemBase > &Data, const string &FragmentName, CreationFailAlternative=CreationFailAlternative::Persistent, const WeakPtr< MemCore::Cache > &theCache=MemCore::Cache::MemCache()) |
| template<Dims_t N, class T > | |
| std::pair< RefPtr< MemArray< N, T > >, RefPtr< CreativeArrayBase > > | createData (const MultiIndex< N > &Size, const RefPtr< FragmentID > &fid=nullptr, Field::CreationFailAlternative FailMode=Field::CreationFailAlternative::Persistent, const WeakPtr< MemCore::Cache > &theCache=MemCore::Cache::MemCache()) |
| Create a mem array and insert it as a fragment to the Field. | |
| template<Dims_t N, class T > | |
| std::pair< RefPtr< MemArray< N, T > >, RefPtr< CreativeArrayBase > > | createData (const MultiIndex< N > &Size, const string &fragmentname, Field::CreationFailAlternative FailMode=Field::CreationFailAlternative::Persistent, const WeakPtr< MemCore::Cache > &theCache=MemCore::Cache::MemCache()) |
| Create a mem array and insert it as a fragment to the Field under the given fragmentname: | |
| template<Dims_t Dims> | |
| MultiIndex< Dims > & | setFragmentOffset (const string &FragmentName, const MultiIndex< Dims > &Offset) |
| Set a fragment's index offset. | |
Public Member Functions inherited from Fiber::Ownable< Field > | |
| void | x_updateOwnershipAge (const MemCore::Ageable &theNewAge) override |
| Forward some age to all Owners. | |
| void | insertOwner (const Container &theOwner) |
| Add some owner. | |
| bool | insertOwner (const MemCore::WeakPtr< Container > &theOwner) |
| Add some owner. | |
| void | addOwner (const Container &theOwner, const MemCore::Ageable &theNewAge) |
| Add some owner and broadcast a new age to all Ownerrs. | |
| void | addOwner (const MemCore::WeakPtr< Container > &theOwner, const MemCore::Ageable &theNewAge) |
| Add some owner and broadcast a new age to all Ownerrs. | |
| Ownable () | |
| Default constructor, empty Ownership list. | |
| Ownable (const Ownable &) | |
| Copy constructor, does NOT copy any ownership information, the new Ownable will be unowned. | |
| Ownable (const MemCore::WeakPtr< Container > &theOwner, const MemCore::Ageable &theNewAge) | |
| Construct an Ownable with an initial owner. | |
| Ownable (const Container &theOwner, const MemCore::Ageable &theNewAge) | |
| Construct an Ownable with an initial owner. | |
| Ownable & | operator= (const Ownable &) |
| Assignment, does NOT copy any ownership information, the assigned Ownable will retain all its ownership information. | |
| MemCore::WeakPtr< Container > | getPrimaryOwner () const |
| Get the first valid owner. | |
| size_t | getNumberOfValidOwners () const |
| Get the first valid owner. | |
| bool | processOwnership (MemCore::Intercube &Output, const MemCore::Intercube &Input) const override |
| Process some ownership action. | |
Public Member Functions inherited from Fiber::OwnerBase | |
| bool | processOwnership (MemCore::Intercube &OutputAndInput) const |
| Process ownership where the input information is shared with the output information in the same Intercube. | |
Public Member Functions inherited from MemCore::Intercube | |
| void | addInterface (const RefPtr< InterfaceBase > &I) const |
| void | addInterfaceData (const Data &D) |
| void | addInterfaceData (const Data &D) |
| void | clearInterfaces () |
| bool | const_iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP) const |
| virtual RefPtr< InterfaceBase > | createInterface (const type_info &) const |
| RefPtr< InterfaceBase > | findInterface (const type_info &t) const |
| RefPtr< InterfaceBase > | getInterface (const type_info &t) |
| std::string | getInterfaceNames (const char delim=';') const |
| bool | gotNewInterfaceData (const Data &D) |
| bool | gotNewInterfaceData (mutex &M, const Data &D) |
| bool | gotNewInterfaceData (mutex &M, const Data &D) |
| bool | gotNewInterfaceData (mutex &M, const Data &D, const Selector &S) |
| bool | gotNewInterfaceData (mutex &M, const Data &D, const Selector *S) |
| bool | hasChangedInterfaceData (const Data &D) const |
| bool | hasChangedInterfaceData (const Data &D) const |
| bool | hasChangedInterfaceData (const Data &D, const Selector &) const |
| bool | hasChangedInterfaceData (const Data &D, const Selector *) const |
| bool | hasInterface (const type_info &t) const |
| bool | iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP) |
| void | printInterfaces () const |
| void | registerInterface (const type_info &t) |
| void | removeInterface () |
| void | removeInterfaceBase (const type_info &InterfaceBaseID) |
Public Member Functions inherited from MemCore::Ageable | |
| constexpr | Ageable (age_t t) noexcept |
| constexpr | Ageable (const Ageable &A) noexcept |
| Ageable (const volatile Ageable &A) noexcept | |
| constexpr const Ageable & | getAge () const |
| bool | isNewerThan (const Ageable &a) const noexcept |
| bool | isOlderThan (const Ageable &a) const noexcept |
| bool | isYoungerThan (const Ageable &a) const noexcept |
| bool | operator!= (const Ageable &a) const noexcept |
| bool | operator< (const Ageable &a) const noexcept |
| bool | operator<= (const Ageable &a) const noexcept |
| bool | operator<= (const volatile Ageable &a) const volatile noexcept |
| bool | operator== (const Ageable &a) const noexcept |
| bool | operator> (const Ageable &a) const noexcept |
| bool | operator> (const volatile Ageable &a) const volatile |
| bool | operator>= (const Ageable &a) const noexcept |
| bool | operator>= (const volatile Ageable &a) const volatile noexcept |
| constexpr void | resetAge () noexcept |
| void | setInfinitelyNew () noexcept |
| age_t | time_value () const noexcept |
| age_t | time_value () const volatile noexcept |
| Ageable & | touch () noexcept |
| age_t | update (age_t age) noexcept |
| age_t | update (const Ageable &Other) noexcept |
| age_t | update (const volatile Ageable &Other) volatile noexcept |
Public Member Functions inherited from Fiber::SaveableAttributes | |
| void | attributesHaveBeenSaved () const |
| bool | attributesNeedSaving () const |
Public Member Functions inherited from MemCore::Attributes | |
| MemCore::RefPtr< MemCore::ChunkBase > | getAttribute (const std::string &name) const |
| const Ageable & | getAttributeAge () const |
| std::pair< bool, T > | getAttributeValue (const string &AttributeName, size_t ElementNumber=0) const |
| attributes_t & | getAttributeValues () |
| const attributes_t & | getAttributeValues () const |
| size_t | getNumberOfAttributes () const |
| bool | hasAttribute (const std::string &name) const |
| int | Iterate (const Functor &L) const |
| int | iterate (Iterator &it) const |
| int | iterate_attributes (const Functor &L) const |
| size_t | NumberOfAttributes () const |
| void | setAttribute (const std::string &name, const MemCore::RefPtr< MemCore::ChunkBase > &AttribData) |
| ResizableChunk< T > & | setAttributeValue (const std::string &name, const T &AttribData) |
| ResizableChunk< T > & | setAttributeValues (const std::string &name, const std::initializer_list< T > &AttribData) |
| const T & | setValue (const T &AttribData, const std::string &name) |
| const T & | setValue (const T &AttribData, const std::string &name, const std::string &Comment, const std::string &CommentPrefix="Comment") |
| string | toString () const |
| const Ageable & | touchAttributes () const |
| const Ageable & | updateAttributeAge (const Ageable &A) const |
Static Public Member Functions | |
| static const CAB_t & | CreativeArrayNullPtr () |
| static const RefPtr< Field > & | NullPtrField () |
Static Public Member Functions inherited from MemCore::Ageable | |
| static const Ageable & | InfinitelyNew () noexcept |
| static constexpr const Ageable & | InfinitelyOld () noexcept |
| static age_t | now () noexcept |
Public Attributes | |
| ListRelativeToBinder< WeakPtr< CreativeArrayBase > > | UnsavedCreators |
Public Attributes inherited from Fiber::Ownable< Field > | |
| std::unordered_set< MemCore::WeakPtr< Container > > | Owners |
| The (internal) list of owners. | |
Public Attributes inherited from Fiber::SaveableAttributes | |
| MemCore::Ageable | LastSavedAttributes |
Static Public Attributes | |
| static constexpr bool | use_std__flat_map_for_fragments = false |
Protected Member Functions | |
| const RefPtr< CreativeArrayBase > & | setCreatorViaFragmentIndex (FragmentIndex_t FI, const RefPtr< CreativeArrayBase > &CAB) |
| ~Field () | |
| Destructor. | |
Protected Attributes | |
| MemCore::shared_mutex | fragment_mutex |
| fragments_t | fragments |
A Field is a collection of CreativeArrayBase reference 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.
Code Examples ** Set a data set to a Field fragment:
Create a 3D data array of doubles and set it as Field Fragment:
Create a function creating a data set on-demand when needed (and forgotten if we go short in RAM):
|
inline |
Construct an unfragmented field from a MemVector and a MultiIndex.
Implicitly creates a MemArray of the proper dimension.
|
inline |
Construct an unfragmented field from a Chunk of data and multidimensional index.
Implicitly creates a MemArray.
|
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. |
References std::set< typename _Key, typename _Compare, typename _Alloc >::insert().
|
inline |
Create a mem array and insert it as a fragment to the Field.
|
inline |
Create a mem array and insert it as a fragment to the Field under the given fragmentname:
| Dims_t Fiber::Field::Dims | ( | ) | const |
The dimensionality of the field, taken from the getProperties().
References getProperties().
|
inline |
Return the stored memory chunk associated with this array.
Will only work of the data for this fragment is contiguous.
| RefPtr< CreativeArrayBase > Fiber::Field::getCreator | ( | const RefPtr< FragmentID > & | fid = nullptr | ) | const |
Get the creator of an unfragmented field.
References MemCore::breakpoint().
Referenced by Fiber::FEM::GetFirstFieldSize::apply(), getCompatibleCreatorF(), getData(), and Wizt::ShaderFields::getShaderDefinitions().
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();
References getCreator().
Referenced by Fiber::GridEvaluator::evalFloatIndices().
| RefPtr< MemBase > Fiber::Field::getDataByNumericalID | ( | FragmentIndex_t | NumericalID | ) | const |
Get some fragment's data via its numerical fragment ID.
In general, this function will return the field's first fragment data and return a valid result regardless of the field being unfragmented or fragmented. In contrast, function getData() will yield a valid result only if the field is unfragmented. However, numerical IDs are just associated with fragments and in some cases a fragment number zero may no exist at all. Thus it is possible that a field with many fragments yields invalid data on getDataByNumericalID(0)
| MemCore::WeakPtr< FiberTypeBase > Fiber::Field::getElementFiberType | ( | ) | const |
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.
References getProperties().
Referenced by Fiber::FiberIO::HDF5::PrecisionTransformation::getFileType(), getMemoryUsage(), and Wizt::ShaderFields::getShaderDefinitions().
Retrieve the element type of this field, which is stored with the properties of this field.
See the getProperties() call for more information.
References getProperties().
Referenced by Fiber::FEM::FindPossibleStressField::apply(), Fiber::FEM::FindPossibleDisplacementField::apply(), Fiber::FEM::SetupDerivedFields::apply(), Fiber::FEM::ComputeToVertexCellFields::apply(), Fiber::FEM::AverageToVertexFields::apply(), and Wizt::ShaderFields::getShaderDefinitions().
Get the type of the field.
| RefPtr< CreativeArrayBase > Fiber::Field::getFirstCreator | ( | ) | const |
In case this is field is fragmented, but there is only one fragment, return the ID of this singular fragment.
Will return Null otherwise.
Referenced by getFirstData().
In case this is field is fragmented, but there is only one fragment, return the ID of this singular fragment.
Will return Null otherwise.
References getFirstCreator().
| RefPtr< FragmentID > Fiber::Field::getFirstFragmentID | ( | ) | const |
Get the first fragment ID.
This function is useful only for special cases when a field is fragmented into a single fragment and this property is required. In all other cases, iteration over all fragments is highly recommended. This is pretty much always the case.
|
overridevirtual |
Implements Fiber::FragmentIDCollectionProvider.
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.
References getElementFiberType().
| RefPtr< MemArrayProperties > Fiber::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.
Referenced by Dims(), getElementFiberType(), and getElementType().
| RefPtr< SizeInterface > Fiber::Field::getSize | ( | ) | const |
The size of the field, which is the sum of all fragments.
References MemCore::Intercube::addInterface(), and NumberOfFragments().
|
inline |
Check if the type of this field is contained in the given type list.
| TL | A list of types. |
References Fiber::containsType().
| unsigned Fiber::Field::iterate | ( | const FragmentIterator_t & | FI, |
| bool | parallel = false, |
||
| bool | copy_map_internally = false |
||
| ) | const |
Iterate over fragments of a field using std::function .
Given a field myField, minimal code using a lambda function for iteration looks like this:
References std::async.
|
inline |
Iterate over all fragments in parallel.
Same as iterate(,true);
| const RefPtr< CreativeArrayBase > & Fiber::Field::setCreator | ( | const RefPtr< CreativeArrayBase > & | FFC, |
| const RefPtr< FragmentID > & | fid = nullptr |
||
| ) |
Sets the creator for an unfragmented field.
An eventually existing creator is overwritten.
Referenced by Fiber::ComputationalField< FieldOperator >::apply(), and Field().
|
inline |
Set a lambda function as on-demand creator for a Field, such
as in:
Special attention must be given to the captures of the lambda function to avoid dangling references, strong pointers and references to MemBase instances.
|
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).
|
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).
| const Field::CAB_t & Fiber::Field::setPersistentData | ( | const RefPtr< MemBase > & | Mb, |
| const RefPtr< FragmentID > & | fid = nullptr, |
||
| const RefPtr< MemCore::Cache > & | Cache = MemCore::Cache::MemCache(), |
||
| const string & | ProvenanceInfo = {} |
||
| ) |
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.
References Fiber::ElementIterator< T >::length, and MemCore::Ageable::touch().
|
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.
Informative debug message.
| indent | How much to indent during printf() calls. |
|
related |
Set a data set to a Field fragment:
Use Field::setPersistentData() if you need more control such as passing a Cache argument.
|
related |
Set a creator:
Use Field::setCreator() if you need more control such as passing a Cache argument.
|
related |
Set a data set to a Field fragment:
Use Field::setPersistentData() if you need more control such as passing a Cache argument.
|
related |
Set a data creator to a Field fragment:
Use Field::setCreator() if you need more control such as passing a Cache argument.
|
related |
Get a creator:
|
related |
A simplied function for data that can be discarded at any time.
It makes use of the AlzheimerCreator. ()