1#ifndef __FIBER_BUNDLE_HPP
2#define __FIBER_BUNDLE_HPP "Created 27.02.2001 21:42:27 by werner"
5#include <fiber/grid/Grid.hpp>
6#include <memcore/Persistencer.hpp>
7#include <memcore/Loader.hpp>
11#include "ParameterSpace.hpp"
12#include "SkeletonInfo.hpp"
42#ifndef __FIBER_BUNDLE_STORAGETRANSFORMATIONS_HPP
43class BUNDLE_API StorageTransformations;
46using RefPtrStorageTransformations =
RefPtr<StorageTransformations,
58template <
class ObjectLevel>
84 virtual ~EvolutionIterator();
98 virtual ~EvolutionIterator();
115 virtual ~EvolutionIterator();
124 ~EvolutionIterator();
139 virtual bool OpenFile(
const string&
fname);
144 virtual bool CreateSlice(
double t);
222 virtual void notifyChange(
const Bundle&
B) = 0;
231 void announceModification()
const;
249 bindTo(
const string&url,
261 bindToNew(
const string&url);
273 return getBinder().valid();
283 return myBinder->getUrl();
328 LP->setProgressCallbacks( Progress );
348 LP->setProgressCallbacks( Progress );
355 return {
nullptr, LP->load_failure};
366static RefPtr<Bundle> load(
const string&url,
const RefPtr<LoaderProgress>&Progress =
nullptr )
368 bool Success =
false;
369 RefPtr<Bundle> BP = load(Success, url,
nullptr, Progress);
384 bool merge(
const RefPtr<LoaderParameters>&LP);
386 bool merge(
const string&url);
388 bool merge(
const list<string>&urls);
402 void DeferredConstructor();
407 int save(
const string&url,
408 const RefPtr<LoaderProgress>&SaveProgress =
nullptr,
409 const RefPtrStorageTransformations&ST =
nullptr);
417 return (*myGridList)(gridname);
428 return (*myGridList)[gridname];
439 return myGridList->getGridnames(Gridnames);
450 return myGridList->getNumberOfGrids();
464 double minTime()
const;
469 double maxTime()
const;
492 return SI.second->accessSlice();
504 SlicePtr operator()(
double&time)
const;
506 SlicePtr findPrev(
double&time)
const;
507 SlicePtr findNext(
double&time)
const;
534 return (*S)(gridname);
549 Slice::grids_t::value_type getUniqueGrid(
double time);
598 int getNrSlicesOfGridInTimeRange(
double time_min,
double time_max,
const string& grid_name,
bool loaded_slices_only )
const;
604 GridInfo_t findMostRecentGrid(
double time,
const string&gridname)
const;
610 GridInfo_t findMostRecentGrid(
double time,
const RefPtr<GridID>&gridid)
const;
617 Info<Grid> findPrev(
double time,
const string&gridname)
const;
618 Info<Grid> findPrev(
double time,
const RefPtr<GridID>&gridname)
const;
621 GridInfo_t findPreviousGrid(
double time,
const string&gridname)
const;
622 GridInfo_t findPreviousGrid(
double time,
const RefPtr<GridID>&GID)
const;
629 Info<Grid> findNext(
double time,
const string&gridname)
const;
630 Info<Grid> findNext(
double time,
const RefPtr<GridID>&gridname)
const;
640 int iterateBackward(
double&time,
const string&gridname, EvolutionIterator<Grid>&GEI,
bool IterateOnlyLoadedSlices)
const;
650 int iterateForward (
double&time,
const string&gridname,
651 EvolutionIterator<Grid>&GEI,
652 bool IterateOnlyLoadedSlices)
const;
654 SkeletonInfo_t findPreviousRefinementLevel(
double&T,
const string&gridname,
int Level,
655 EvolutionIterator<Skeleton>*EIS,
int IndexDepth);
663 return findPreviousRefinementLevel(T,gridname,
Level,0,IndexDepth);
666 SkeletonInfo_t findPreviousRefinementLevel(
double&T,
const string&gridname,
int Level,
669 return findPreviousRefinementLevel(T,gridname,
Level,&
EIS,IndexDepth);
673 SkeletonInfo_t findNextRefinementLevel(P1D_t::const_iterator&it,
const string&gridname,
int Level,
int IndexDepth);
676 SkeletonInfo_t findNextRefinementLevel(
double&T,
const string&gridname,
int Level,
int IndexDepth = 0);
694 return AvailableParameters;
700 int iterate(
const ParameterList&PL, EvolutionIterator<Slice>&SI)
const;
707 int iterate(
const string&gridname, EvolutionIterator<Grid>&GEI,
bool IterateOnlyLoadedSlices)
const;
710 int iterate(
const string&gridname,
const EvolutionIterator<Grid>::functor&GEI,
bool IterateOnlyLoadedSlices)
const;
712 using grid_iterator = std::function<bool(
double t,
const GridID&
id, Grid&g)>;
718 int iterate(
const RefPtr<GridID>&
id,
const grid_iterator&gi,
bool IterateOnlyLoadedSlices=
false)
const;
732 template <
class Functor>
736 for(
const auto&
P1 : P1D)
738 if (!
P1.second)
continue;
740 P1.second->accessSlice();
742 if (F(
P1.first, *
P1.second))
767 void extremeUnction()
override;
839 if (!*
this)
return nullptr;
840 return (**
this)(time);
854 int save(
const string&url,
strong_ordering operator(const error_code &__lhs, const error_code &__rhs) noexcept
_Expr< _ValFunClos< _ValArray, _Tp >, _Tp > apply(_Tp __func(_Tp)) const
constexpr _OutputIterator merge(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
basic_string< char > string
constexpr _Bind_helper< __is_socketlike< _Func >::value, _Func, _BoundArgs... >::type bind(_Func &&__f, _BoundArgs &&... __args)
size_type size() const noexcept
Loading progress callback functor.
Definition Bundle.hpp:132
Convenience class that implements a pointer to a Bundle object but adds some useful member funtions t...
Definition Bundle.hpp:779
Bundle & operator*()
Dereferencing operator - it will always yield a valid object, if the bundle pointer was not yet initi...
Definition Bundle.hpp:811
Slice & operator[](double time)
Convenient slice access function.
Definition Bundle.hpp:827
BundlePtr(const BundlePtr &)=default
Copy Constructor.
BundlePtr & operator=(const BundlePtr &)=default
Assignment.
SlicePtr operator()(double &time)
Request a Slice without creating any data.
Definition Bundle.hpp:837
The main entity holding all information.
Definition Bundle.hpp:173
Info< Skeleton > SkeletonInfo_t
The information as returned by a query for Skeletons.
Definition Bundle.hpp:478
SliceInfo_t prev(double time) const
Return the time slice just before the given time.
Definition Bundle.hpp:510
static std::pair< RefPtr< Bundle >, std::string > load(const list< string > &urls, const RefPtr< LoaderProgress > &Progress=nullptr)
Convenience function to load a bundle from a given list of urls, returning a pair of a bundle pointer...
Definition Bundle.hpp:343
int getGridnames(GridList::stringset_t &Gridnames) const
Query all the grid names that lurk around at this Bundle.
Definition Bundle.hpp:436
std::string boundUrl() const
The URL of the storage device to which this Bundle is bound.
Definition Bundle.hpp:280
RefPtr< GridID > operator[](const string &gridname) const
Create a GridID from a name.
Definition Bundle.hpp:425
int iterate_timeslices(bool DoLoadAllSlices, const Functor &F) const
Definition Bundle.hpp:733
static RefPtr< Bundle > load(bool &success, const list< string > &urls, const RefPtr< Bundle > &B=nullptr, const RefPtr< LoaderProgress > &Progress=nullptr)
A simplified version to load a Bundle without detailed error information availlable (which would be i...
Definition Bundle.hpp:322
Info< Grid > GridInfo_t
The information as returned by a query for Grids.
Definition Bundle.hpp:475
size_t getNumberOfGrids() const
Get the number of grids defined on this Grid.
Definition Bundle.hpp:447
SkeletonInfo_t findPreviousRefinementLevel(double &T, const string &gridname, int Level, int IndexDepth=0)
Find the most recent refinement level of an adaptive mesh, which resides at a time before the current...
Definition Bundle.hpp:661
bool accessFirstSlice() const
Access the first slice of this bundle, which implies loading or creating any metadata as associated w...
Definition Bundle.hpp:488
bool isBound() const
Check if this bundle is bound.
Definition Bundle.hpp:271
SliceInfo_t next(double time) const
Return the time slice just next after the given time.
Definition Bundle.hpp:519
RefPtr< Grid > operator()(double time, const string &gridname) const
Query the one-dimensional index space for a Grid.
Definition Bundle.hpp:530
RefPtr< Slice > operator()(const ParameterSet &) const
Query the n-dimensional index space for a Slice entry.
int sizeP1D() const
The size of the one-dimensional parameter space.
Definition Bundle.hpp:686
RefPtr< Grid > newGrid() const
Create a new Grid object that lives on this Bundle, but is not yet associated to any time,...
Definition Bundle.hpp:556
MemCore::SaveParameters::SaveError bindToNew(const string &url, const RefPtrStorageTransformations &ST)
Bind to a newly created file.
Info< Slice > SliceInfo_t
The information as returned by a query for Slices.
Definition Bundle.hpp:472
RefPtr< Grid > operator()(double time, const RefPtr< GridID > &GridID) const
Query the one-dimensional index space for a Grid.
Definition Bundle.hpp:541
Slice & operator[](const ParameterSet &)
Access n-dimensional index space, possibly creating an Slice entry.
RefPtr< GridID > operator()(const string &gridname) const
Query a GridID from a name.
Definition Bundle.hpp:414
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
A Field is a collection of CreativeArrayBase reference pointers which are accessed via FragmentID obj...
Definition Field.hpp:245
A grid identifier.
Definition GridID.hpp:29
A Grid is a set of Skeleton objects, each of them accessed via some unique SkeletonID object.
Definition Grid.hpp:60
Implementation of an Iterator to a sequence of elements, which might be contiguous or a projection of...
Definition vector/Iterator.hpp:525
T & operator[](index_t i) const
Access an element of the array, writeable.
Definition vector/Iterator.hpp:712
Definition ParameterSpace.hpp:83
Definition ParameterSpace.hpp:49
A Skeleton is a set of Representation object, each of them accessed by an Representer object.
Definition Skeleton.hpp:102
Convenience shortcut for pointers to Slices.
Definition Slice.hpp:232
Information per time slice, mainly a set of Grid objects that are accessed via GridID objects.
Definition Slice.hpp:36
refvalue_t & operator*() const
MemSizeConfig< sizeof(void *)>::memsize_t memsize_t
RefPtr< ValueNotifier > addNotifier(TypedSlot< SlotType > &theSlot, VObjectClass *That)
Column< C, Value > operator*(const Column< C, Value > &A, double V)
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
typename Ownable< OwnedObjectType, ContainerBase >::Container OwnerOf
Shortcut to find the owning type.
Definition Ownable.hpp:265
StrongPtr< Object, ObjectBase > RefPtr
Mechanism to have notifier objects listening to changes on the Bundle, whatever nature those changes ...
Definition Bundle.hpp:215
The information as returned by a query for Skeletons.
Definition SkeletonInfo.hpp:20
The information as returned by a query for Slices.
Definition SliceInfo.hpp:37