Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::FabFactory< FAB > Class Template Referenceabstract

Abstract factory interface for creating, aliasing, and destroying FAB objects. More...

#include <AMReX_FabFactory.H>

Inheritance diagram for amrex::FabFactory< FAB >:
amrex::DefaultFabFactory< FAB >

Public Member Functions

 FabFactory () noexcept=default
 
 FabFactory (FabFactory const &) noexcept=default
 
 FabFactory (FabFactory &&) noexcept=default
 
FabFactoryoperator= (FabFactory const &) noexcept=default
 
FabFactoryoperator= (FabFactory &&) noexcept=default
 
virtual ~FabFactory () noexcept=default
 
virtual FAB * create (const Box &box, int ncomps, const FabInfo &info, int box_index) const =0
 Create a FAB covering box with ncomps components.
 
virtual FAB * create_alias (FAB const &, int, int) const
 Create an alias FAB that views components [scomp, scomp+ncomp) of rhs.
 
virtual void destroy (FAB *fab) const =0
 Destroy a FAB previously created by this factory.
 
virtual FabFactory< FAB > * clone () const =0
 Return a heap-allocated copy of this factory.
 
virtual Long nBytes (const Box &box, int ncomps, int) const
 Return the storage size for ncomps components in box, or -1 if unavailable.
 

Detailed Description

template<class FAB>
class amrex::FabFactory< FAB >

Abstract factory interface for creating, aliasing, and destroying FAB objects.

Template Parameters
FABFAB type produced by this factory.

Constructor & Destructor Documentation

◆ FabFactory() [1/3]

template<class FAB >
amrex::FabFactory< FAB >::FabFactory ( )
defaultnoexcept

◆ FabFactory() [2/3]

template<class FAB >
amrex::FabFactory< FAB >::FabFactory ( FabFactory< FAB > const &  )
defaultnoexcept

◆ FabFactory() [3/3]

template<class FAB >
amrex::FabFactory< FAB >::FabFactory ( FabFactory< FAB > &&  )
defaultnoexcept

◆ ~FabFactory()

template<class FAB >
virtual amrex::FabFactory< FAB >::~FabFactory ( )
virtualdefaultnoexcept

Member Function Documentation

◆ clone()

template<class FAB >
virtual FabFactory< FAB > * amrex::FabFactory< FAB >::clone ( ) const
pure virtual

Return a heap-allocated copy of this factory.

Implemented in amrex::EBFArrayBoxFactory, and amrex::DefaultFabFactory< FAB >.

◆ create()

template<class FAB >
virtual FAB * amrex::FabFactory< FAB >::create ( const Box box,
int  ncomps,
const FabInfo info,
int  box_index 
) const
pure virtual

Create a FAB covering box with ncomps components.

Storage allocation is controlled by info.

Parameters
boxRegion represented by the FAB.
ncompsNumber of components per cell.
infoAllocation hints (arena, shared flag, etc.).
box_indexGlobal box index supplied by the owning container.
Returns
A newly created FAB owned by the caller.

Implemented in amrex::EBFArrayBoxFactory, and amrex::DefaultFabFactory< FAB >.

◆ create_alias()

template<class FAB >
virtual FAB * amrex::FabFactory< FAB >::create_alias ( FAB const &  ,
int  ,
int   
) const
inlinevirtual

Create an alias FAB that views components [scomp, scomp+ncomp) of rhs.

Default implementation returns nullptr, indicating aliasing is unsupported.

Reimplemented in amrex::DefaultFabFactory< FAB >, and amrex::EBFArrayBoxFactory.

◆ destroy()

template<class FAB >
virtual void amrex::FabFactory< FAB >::destroy ( FAB *  fab) const
pure virtual

Destroy a FAB previously created by this factory.

Implemented in amrex::DefaultFabFactory< FAB >, and amrex::EBFArrayBoxFactory.

◆ nBytes()

template<class FAB >
virtual Long amrex::FabFactory< FAB >::nBytes ( const Box box,
int  ncomps,
int   
) const
inlinevirtual

Return the storage size for ncomps components in box, or -1 if unavailable.

◆ operator=() [1/2]

template<class FAB >
FabFactory & amrex::FabFactory< FAB >::operator= ( FabFactory< FAB > &&  )
defaultnoexcept

◆ operator=() [2/2]

template<class FAB >
FabFactory & amrex::FabFactory< FAB >::operator= ( FabFactory< FAB > const &  )
defaultnoexcept

The documentation for this class was generated from the following files: