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

Default FabFactory that calls new / delete on the FAB type directly. More...

#include <AMReX_FabFactory.H>

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

Public Member Functions

FAB * create (const Box &box, int ncomps, const FabInfo &info, int) const override
 Create a FAB covering box with ncomps components.
 
FAB * create_alias (FAB const &rhs, int scomp, int ncomp) const override
 Create an alias FAB that views components [scomp, scomp+ncomp) of rhs.
 
void destroy (FAB *fab) const override
 Destroy a FAB previously created by this factory.
 
DefaultFabFactory< FAB > * clone () const override
 Return a heap-allocated copy of this factory.
 
- Public Member Functions inherited from amrex::FabFactory< FAB >
 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 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::DefaultFabFactory< FAB >

Default FabFactory that calls new / delete on the FAB type directly.

Template Parameters
FABFAB type to construct.

Member Function Documentation

◆ clone()

template<class FAB >
DefaultFabFactory< FAB > * amrex::DefaultFabFactory< FAB >::clone ( ) const
inlineoverridevirtual

Return a heap-allocated copy of this factory.

Implements amrex::FabFactory< FAB >.

◆ create()

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

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.

Implements amrex::FabFactory< FAB >.

◆ create_alias()

template<class FAB >
FAB * amrex::DefaultFabFactory< FAB >::create_alias ( FAB const &  ,
int  ,
int   
) const
inlineoverridevirtual

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

Default implementation returns nullptr, indicating aliasing is unsupported.

Reimplemented from amrex::FabFactory< FAB >.

◆ destroy()

template<class FAB >
void amrex::DefaultFabFactory< FAB >::destroy ( FAB *  fab) const
inlineoverridevirtual

Destroy a FAB previously created by this factory.

Implements amrex::FabFactory< FAB >.


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