#include <MultiPatchEngine.h>
Classes | |
class | PatchAllocator |
Special Runnable class for allocating patches. | |
Public Types | |
enum | { brick = false } |
enum | { dimensions = Dim } |
enum | { hasDataObject = false } |
enum | { dynamic = PatchEngine_t::dynamic } |
enum | { zeroBased = false } |
enum | { multiPatch = true } |
typedef MultiPatch< LayoutTag, PatchTag > | Tag_t |
typedef Engine< Dim, T, Tag_t > | This_t |
typedef Engine< Dim, T, Tag_t > | Engine_t |
typedef Interval< Dim > | Domain_t |
typedef T | Element_t |
typedef PatchTag | PatchTag_t |
typedef Engine< Dim, T, PatchTag > | PatchEngine_t |
typedef PatchEngine_t::ElementRef_t | ElementRef_t |
typedef RefCountedBlockPtr < PatchEngine_t > | PatchContainer_t |
typedef MultiPatchLayoutTraits < LayoutTag, Dim > | LayoutTraits_t |
typedef LayoutTraits_t::Layout_t | Layout_t |
typedef Layout_t | Observable_t |
typedef DynamicEvents::PatchID_t | PatchID_t |
typedef DynamicEvents::CreateSize_t | CreateSize_t |
typedef ObserverEvent::ID_t | DynamicID_t |
typedef NewEngine < PatchEngine_t, Domain_t > ::Type_t | PatchView_t |
Public Member Functions | |
Engine () | |
The default constructor is available, but must be followed by use of operator= to set this object up in a usable state. | |
Engine (const Layout_t &layout) | |
The constructor takes a Layout object. | |
Engine (const Engine_t &model) | |
Copy constructor. | |
~Engine () | |
We need to detach from the layout that we're viewing. | |
Engine_t & | operator= (const Engine_t &model) |
Assignment operators. | |
PatchEngine_t & | globalPatch (const INode< Dim > &inode) const |
Return a patch given a Node or INode. | |
template<class Domain > | |
PatchEngine_t & | globalPatch (const Node< Domain > &node) const |
PatchEngine_t & | globalPatch (PatchID_t gpatchID) const |
PatchEngine_t & | localPatch (PatchID_t lpatchID) const |
bool | patchEmpty (PatchID_t patch) const |
const Layout_t & | layout () const |
Return the layout. | |
Layout_t & | layout () |
const Domain_t & | domain () const |
Return the domain and base domain. | |
const Domain_t & | innerDomain () const |
int | first (int d) const |
Return the first index in the given direction. | |
bool | initialized () const |
Return whether we have been initialized yet or not. | |
const PatchContainer_t & | data () const |
Return the data. | |
Engine_t & | makeOwnCopy () |
Get a private copy of data viewed by this Engine. | |
void | fillGuards (const GuardLayers< Dim > &g) const |
Fill the internal guard cells. | |
void | fillGuards () const |
void | fillGuardsHandler (const GuardLayers< Dim > &, const WrappedInt< false > &) const |
void | fillGuardsHandler (const GuardLayers< Dim > &, const WrappedInt< true > &) const |
void | setGuards (const T &val) const |
Set the internal guard cells to a particular value. | |
void | accumulateFromGuards () const |
Accumulate from the internal guards into. | |
int | dirty () const |
Set and get the dirty flag (fillGuards is a no-op unless the dirty flag is true). | |
void | setDirty () const |
void | clearDirty (int face=-1) const |
bool | isDirty (int face=-1) const |
virtual void | notify (Observable_t &observed, const ObserverEvent &event) |
Be notified of various events from the layout, including when the layout is deleted or when dynamic operations occur. | |
void | dynamicHandler (Observable_t &, const ObserverEvent &, const WrappedInt< false > &) |
Handler for dynamic events. | |
void | dynamicHandler (Observable_t &, const ObserverEvent &, const WrappedInt< true > &) |
void | create (CreateSize_t num, PatchID_t localPatchID=(-1)) |
Create new elements by extending the current domain on the local context by the requested number of elements, or the specified local patch. | |
template<class Dom , class DeleteMethod > | |
void | destroy (const Dom &killlist, const DeleteMethod &method) |
Delete the elements within our domain specified by the given Range, using either a backfill mechanism or a shift-up mechanism to delete the data. | |
template<class Dom > | |
void | destroy (const Dom &killlist) |
template<class Dom , class DeleteMethod > | |
void | destroy (const Dom &killlist, PatchID_t frompatch, const DeleteMethod &method) |
Delete the elements within the specific local domain for the given patch. | |
template<class Dom > | |
void | copy (const Dom &domain, PatchID_t topatch=(-1)) |
Copy all elements of domain n to the end of the last patch (default) or to the end of the specified patch. | |
template<class Dom > | |
void | copy (const Dom &killlist, PatchID_t frompatch, PatchID_t topatch) |
Copy all elements from the specified local patch to the end of the local to-patch. | |
void | copy (const IndirectionList< IndirectionList< int > > &domlists, const IndirectionList< int > &fromlist, PatchID_t topatch, bool docreate) |
Perform a "multiple patch" copy, using a list of IndirectionList's for a set of source patches, and an IndirectionList giving the patch ID for the source patches. | |
void | sync () |
Synchronize all the contexts to update their domain information. | |
Element access via Loc. | |
Element_t | read (const Loc< Dim > &) const |
ElementRef_t | operator() (const Loc< Dim > &) const |
Element access via ints for speed. | |
Element_t | read (int) const |
Element_t | read (int, int) const |
Element_t | read (int, int, int) const |
Element_t | read (int, int, int, int) const |
Element_t | read (int, int, int, int, int) const |
Element_t | read (int, int, int, int, int, int) const |
Element_t | read (int, int, int, int, int, int, int) const |
ElementRef_t | operator() (int) const |
ElementRef_t | operator() (int, int) const |
ElementRef_t | operator() (int, int, int) const |
ElementRef_t | operator() (int, int, int, int) const |
ElementRef_t | operator() (int, int, int, int, int) const |
ElementRef_t | operator() (int, int, int, int, int, int) const |
ElementRef_t | operator() (int, int, int, int, int, int, int) const |
The data is distributed amongst a list of patches of type Engine<Dim, T, PatchTag>. The union of the "owned" domains of the patches (the patch-engine domains ignoring the portions that are used for storing internal guard data) is equal to the domain of the multi-patch engine.
The Engine makes no assumptions about the type of T beyond that it have a copy constructor and assignment operator. (Aren't these deferred to the underlying RCBPtr???)
The Domain of this engine is an Interval<Dim>, which is a tensor product of Dim 1-D intervals.
The organization of the patches, and all services related to looking up which patches correspond to which domains, is deferred to the layout, whose type is MultiPatchLayoutTraits<LayoutTag,Dim>::Layout_t. The type of the view layout is MultiPatchLayoutTraits<LayoutTag,ViewDim>::View1<Dim>::Layout_t.
Subsetting Engine<Dim, T, MultiPatch<LayoutTag,PatchTag> > returns an Engine<NewDim, T, MultiPatchView<LayoutTag,PatchTag,Dim> >. See below.
typedef MultiPatch<LayoutTag,PatchTag> Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Tag_t |
typedef Engine<Dim,T,Tag_t> Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::This_t |
typedef Engine<Dim,T,Tag_t> Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Engine_t |
typedef Interval<Dim> Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Domain_t |
typedef T Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Element_t |
typedef PatchTag Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::PatchTag_t |
typedef Engine<Dim, T, PatchTag> Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::PatchEngine_t |
typedef PatchEngine_t::ElementRef_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::ElementRef_t |
typedef RefCountedBlockPtr<PatchEngine_t> Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::PatchContainer_t |
typedef MultiPatchLayoutTraits<LayoutTag,Dim> Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::LayoutTraits_t |
typedef LayoutTraits_t::Layout_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Layout_t |
typedef Layout_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Observable_t |
typedef DynamicEvents::PatchID_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::PatchID_t |
typedef DynamicEvents::CreateSize_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::CreateSize_t |
typedef ObserverEvent::ID_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::DynamicID_t |
typedef NewEngine<PatchEngine_t, Domain_t>::Type_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::PatchView_t |
anonymous enum |
anonymous enum |
anonymous enum |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Engine | ( | ) |
The default constructor is available, but must be followed by use of operator= to set this object up in a usable state.
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Engine | ( | const Layout_t & | layout | ) | [explicit] |
The constructor takes a Layout object.
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Engine | ( | const Engine_t & | model | ) |
Copy constructor.
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::~Engine | ( | ) |
We need to detach from the layout that we're viewing.
Engine_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::operator= | ( | const Engine_t & | model | ) |
Assignment operators.
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Element_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::read | ( | const Loc< Dim > & | loc | ) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::ElementRef_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::operator() | ( | const Loc< Dim > & | loc | ) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Element_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::read | ( | int | i0 | ) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Element_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::read | ( | int | i0, | |
int | i1 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Element_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::read | ( | int | i0, | |
int | i1, | |||
int | i2 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Element_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::read | ( | int | i0, | |
int | i1, | |||
int | i2, | |||
int | i3 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Element_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::read | ( | int | i0, | |
int | i1, | |||
int | i2, | |||
int | i3, | |||
int | i4 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Element_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::read | ( | int | i0, | |
int | i1, | |||
int | i2, | |||
int | i3, | |||
int | i4, | |||
int | i5 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::Element_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::read | ( | int | i0, | |
int | i1, | |||
int | i2, | |||
int | i3, | |||
int | i4, | |||
int | i5, | |||
int | i6 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::ElementRef_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::operator() | ( | int | i0 | ) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::ElementRef_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::operator() | ( | int | i0, | |
int | i1 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::ElementRef_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::operator() | ( | int | i0, | |
int | i1, | |||
int | i2 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::ElementRef_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::operator() | ( | int | i0, | |
int | i1, | |||
int | i2, | |||
int | i3 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::ElementRef_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::operator() | ( | int | i0, | |
int | i1, | |||
int | i2, | |||
int | i3, | |||
int | i4 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::ElementRef_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::operator() | ( | int | i0, | |
int | i1, | |||
int | i2, | |||
int | i3, | |||
int | i4, | |||
int | i5 | |||
) | const [inline] |
Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::ElementRef_t Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::operator() | ( | int | i0, | |
int | i1, | |||
int | i2, | |||
int | i3, | |||
int | i4, | |||
int | i5, | |||
int | i6 | |||
) | const [inline] |
PatchEngine_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::globalPatch | ( | const INode< Dim > & | inode | ) | const [inline] |
Return a patch given a Node or INode.
References contains(), INode< Dim >::domain(), INode< Dim >::globalID(), and PAssert.
PatchEngine_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::globalPatch | ( | const Node< Domain > & | node | ) | const [inline] |
References contains(), Node< Dom, OrigDom >::domain(), Node< Dom, OrigDom >::globalID(), and PAssert.
PatchEngine_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::globalPatch | ( | PatchID_t | gpatchID | ) | const [inline] |
PatchEngine_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::localPatch | ( | PatchID_t | lpatchID | ) | const [inline] |
bool Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::patchEmpty | ( | PatchID_t | patch | ) | const [inline] |
const Layout_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::layout | ( | ) | const [inline] |
Return the layout.
Layout_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::layout | ( | ) | [inline] |
const Domain_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::domain | ( | ) | const [inline] |
Return the domain and base domain.
const Domain_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::innerDomain | ( | ) | const [inline] |
int Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::first | ( | int | d | ) | const [inline] |
Return the first index in the given direction.
bool Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::initialized | ( | ) | const [inline] |
Return whether we have been initialized yet or not.
const PatchContainer_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::data | ( | ) | const [inline] |
Return the data.
Engine_t& Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::makeOwnCopy | ( | ) |
Get a private copy of data viewed by this Engine.
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::fillGuards | ( | const GuardLayers< Dim > & | g | ) | const [inline] |
Fill the internal guard cells.
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::fillGuards | ( | ) | const [inline] |
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::fillGuardsHandler | ( | const GuardLayers< Dim > & | , | |
const WrappedInt< false > & | ||||
) | const [inline] |
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::fillGuardsHandler | ( | const GuardLayers< Dim > & | , | |
const WrappedInt< true > & | ||||
) | const |
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::setGuards | ( | const T & | val | ) | const |
Set the internal guard cells to a particular value.
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::accumulateFromGuards | ( | ) | const |
Accumulate from the internal guards into.
int Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::dirty | ( | ) | const [inline] |
Set and get the dirty flag (fillGuards is a no-op unless the dirty flag is true).
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::setDirty | ( | ) | const [inline] |
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::clearDirty | ( | int | face = -1 |
) | const [inline] |
References PAssert.
bool Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::isDirty | ( | int | face = -1 |
) | const [inline] |
References PAssert.
virtual void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::notify | ( | Observable_t & | observed, | |
const ObserverEvent & | event | |||
) | [virtual] |
Be notified of various events from the layout, including when the layout is deleted or when dynamic operations occur.
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::dynamicHandler | ( | Observable_t & | , | |
const ObserverEvent & | , | |||
const WrappedInt< false > & | ||||
) | [inline] |
Handler for dynamic events.
Notify delegates dynamic event handling to one of these functions by calling dynamicHandler with WrappedInt<PatchEngine_t::dynamic>. The "true" version handles dynamic events, and requires that the patch engine have the dynamic interface. The "false" version should never be called, but has to be compilable.
References PInsist.
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::dynamicHandler | ( | Observable_t & | , | |
const ObserverEvent & | , | |||
const WrappedInt< true > & | ||||
) |
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::create | ( | CreateSize_t | num, | |
PatchID_t | localPatchID = (-1) | |||
) | [inline] |
Create new elements by extending the current domain on the local context by the requested number of elements, or the specified local patch.
'local' means on this same context. The patch is refered to by local index, from 0 ... # local patches - 1. The default of -1 puts elements on the last local patch.
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::destroy | ( | const Dom & | killlist, | |
const DeleteMethod & | method | |||
) | [inline] |
Delete the elements within our domain specified by the given Range, using either a backfill mechanism or a shift-up mechanism to delete the data.
The second argument should be one of the following types:
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::destroy | ( | const Dom & | killlist | ) | [inline] |
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::destroy | ( | const Dom & | killlist, | |
PatchID_t | frompatch, | |||
const DeleteMethod & | method | |||
) | [inline] |
Delete the elements within the specific local domain for the given patch.
The domain values in this case should all be zero-based, so that they are relative to the first element of the specified local patch. The domain values should all be contained within the specified local patch as well. To perform cross-patch destroy's, use the form where you do not specify a local patch number.
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::copy | ( | const Dom & | domain, | |
PatchID_t | topatch = (-1) | |||
) | [inline] |
Copy all elements of domain n to the end of the last patch (default) or to the end of the specified patch.
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::copy | ( | const Dom & | killlist, | |
PatchID_t | frompatch, | |||
PatchID_t | topatch | |||
) | [inline] |
Copy all elements from the specified local patch to the end of the local to-patch.
The domain values in this case should all be zero- based, so that they are relative to the first element of the specified local patch. The domain values should all be contained within the specified local patch as well. To perform cross-patch copies, use the form where you do not specify a local from-patch number.
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::copy | ( | const IndirectionList< IndirectionList< int > > & | domlists, | |
const IndirectionList< int > & | fromlist, | |||
PatchID_t | topatch, | |||
bool | docreate | |||
) | [inline] |
Perform a "multiple patch" copy, using a list of IndirectionList's for a set of source patches, and an IndirectionList giving the patch ID for the source patches.
Copy data into the destination patch. The source and desination patches must be specified, this is only for "zero-based" index lists. If the last argument is true, storage is created at the end, otherwise elements are just copied to the end of the existing storage.
void Engine< Dim, T, MultiPatch< LayoutTag, PatchTag > >::sync | ( | ) | [inline] |
Synchronize all the contexts to update their domain information.
This should be used after create/destroy operations have modified the domain of local context's data, and all contexts must be told of the new situation. This should be an SPMD call.