Fish - FiberLib for VISH 0.3
Fish - The Fiber Bundle API for the Vish Visualization Shell
Wizt::GridSelector Class Reference

Context information to select a grid from within a bundle. More...

#include <GridSelector.hpp>

Inheritance diagram for Wizt::GridSelector:
Fiber::FieldSelector

Public Member Functions

const stringgetGridname () const
 Name of the selected grid (member function).
const stringgetGridName () const
 GridSelector ()
 Default Construct.
 GridSelector (const string &gridname, const Fiber::BundlePtr &Source=Fiber::BundlePtr(NullPtr()))
 Construct from gridname and bundle.
 GridSelector (const Fiber::BundlePtr &Source, const string &gridname)
 Construct from bundle and gridname.
 GridSelector (const GridSelector &Source, const string &gridname)
 Construct from GridSelector and gridname.
 GridSelector (const string &gridname, const GridSelector &Source)
 Construct from GridSelector and gridname.
 ~GridSelector ()
 Destructor.
GridSelector operator[] (const string &gridname) const
 Operator syntax for constructing a new GridSelector from an existing one and a new gridname.
Fiber::Gridoperator[] (double time)
const stringGridname () const
 Return the name of the currently selected Grid.
const Fiber::BundlePtrBundleSource () const
 Provide the original bundle of from where the Grid was selected.
const Fiber::BundlePtrgetBundle () const
 Provide the original bundle of from where the Grid was selected.
bool hasValidGrid () const
 check for validity, bundle pointer must be valid and grid name.
 operator bool () const
 check for validity
bool selectGrid (const string &name)
 Select a certain grid out of the given spacetime.
Info< GridfindMostRecentGrid (const Fiber::BundlePtr &theSpacetime, double time) const
 Return the time, slice and grid that is most recent to the given time for the selected grid.
Info< GridfindMostRecentGrid (double time, const Fiber::BundlePtr &theSpacetime=Fiber::BundlePtr(NullPtr())) const
 Find the Grid that is most recent for the given time.
Info< SkeletongetRefinementLevel (double time, int Level, int IndexDepth, const BundlePtr &SpaceTime=BundlePtr(NullPtr()))
 Retrieve a skeleton for the given refinement level for the current time.
Info< GridfindPrev (double time, const BundlePtr &theSpacetime=BundlePtr(NullPtr())) const
 Return the Grid that is just previous to the given time.
Info< GridfindNext (double time, const BundlePtr &theSpacetime=BundlePtr(NullPtr())) const
 Return the Grid that is just next after the given time.
RefPtr< Fiber::Gridoperator() (double time, const Fiber::BundlePtr &theSpacetime=Fiber::BundlePtr(NullPtr())) const
 Convenience function to easily retrieve just the most recent Grid for a given time.
RefPtr< Fiber::Gridoperator() (double time, const GridSelector &GS)
bool hasProperty (const BundleProperty &theProperty) const
 Check this GridSelector for a certain property.
bool providesFieldTypes (const Fiber::TypeList_t &AcceptedFields) const
 Check which field types are supported by the grid that is selected by the current grid selector.

Public Attributes

BundlePtr theSourceBundle
 The bundle that was used to retrieve the grid name, meaning: the selected grid name is ensured to exist on this bundle.
string theGridname
 Name of the selected grid.

Friends

bool operator== (const GridSelector &L, const GridSelector &R)
 Compare two Grid selectors.
bool operator!= (const GridSelector &L, const GridSelector &R)
 Check if two Grid selectors differ.

Detailed Description

Context information to select a grid from within a bundle.

Note that an actual Grid is not stored here, just the means to select one from a Bundle. The index for the Bundle's parameter space value must be specified to access a particular Grid object (which, in the simplest case, is a one-dimensional time value).

Member Function Documentation

◆ findMostRecentGrid()

Info< Grid > Fiber::GridSelector::findMostRecentGrid ( const Fiber::BundlePtr & theSpacetime,
double time ) const
inline

Return the time, slice and grid that is most recent to the given time for the selected grid.

@TODO REVISE THIS

◆ getRefinementLevel()

Info< Skeleton > Fiber::GridSelector::getRefinementLevel ( double time,
int Level,
int IndexDepth,
const BundlePtr & SpaceTime = BundlePtr(NullPtr() ) )

Retrieve a skeleton for the given refinement level for the current time.

Parameters
LevelThe 2-logarithm of the refinement factor, root level is 0, 1st level is refinement 2, 2nd level is refinement 4.
Note
Non-power of two refinements are not supported through this call, neither are non-isotropic refinements. This function relies on Grid::findIsotropicRefinementFactor(). More advanced applications must use another function or implement the Skeleton search explicitly.

◆ operator()()

RefPtr< Fiber::Grid > Fiber::GridSelector::operator() ( double time,
const Fiber::BundlePtr & theSpacetime = Fiber::BundlePtr(NullPtr() ) ) const
inline

Convenience function to easily retrieve just the most recent Grid for a given time.

Calls findMostRecentGrid() .

◆ operator[]()

GridSelector Fiber::GridSelector::operator[] ( const string & gridname) const
inline

Operator syntax for constructing a new GridSelector from an existing one and a new gridname.

The resulting GridSelector will share the same Bundle as the existing one.

GridSelector InputGS = ...;
string OutputGridname = ...;
GridSelector OutputGS = InputGS [ OutputGridname ];
GridSelector()
Default Construct.
Definition GridSelector.cpp:8

◆ providesFieldTypes()

bool Fiber::GridSelector::providesFieldTypes ( const Fiber::TypeList_t & AcceptedFields) const

Check which field types are supported by the grid that is selected by the current grid selector.

This function will only inspect slices that are already loaded, but not load any data from disk. Thus if the type of field changes over time and the fields of interest have not ever been existent on a grid time slice that is loaded, it will not show up here. However, a field's type changing over time is considered to be logically inconsistent anyway.