AMR-Wind  v0.1.0
CFD solver for wind plant simulations
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
amr_wind::ViewField< T > Class Template Reference

Subview of a Field or a ScratchField. More...

#include <ViewField.H>

Public Member Functions

 ViewField (const ViewField &)=delete
 
ViewFieldoperator= (const ViewField &)=delete
 
 ViewField (ViewField &&)=default
 
ViewFieldoperator= (ViewField &&)=default
 
std::string name () const
 
int num_comp () const
 Number of components in this subview. More...
 
const amrex::IntVect & num_grow () const
 
FieldLoc field_location () const
 
amrex::MultiFab & operator() (int lev)
 Return the field data for a given level. More...
 
const amrex::MultiFab & operator() (int lev) const
 
amrex::Vector< amrex::MultiFab * > vec_ptrs () noexcept
 
amrex::Vector< const amrex::MultiFab * > vec_const_ptrs () const noexcept
 
const FieldReporepo () const
 Return a reference to the field repository that created this field. More...
 
Tsource_field ()
 Return a reference to the source field from which this view is derived. More...
 
const Tsource_field () const
 

Public Attributes

friend T
 

Private Member Functions

 ViewField (T &src, const int scomp=0, const int ncomp=1)
 

Private Attributes

Tm_src
 The base field. More...
 
int m_scomp
 Index of the starting component. More...
 
int m_ncomp
 Number of sub-components in this view. More...
 
amrex::Vector< amrex::MultiFab > m_data
 MultiFabs holding the alias views. More...
 

Detailed Description

template<typename T>
class amr_wind::ViewField< T >

Subview of a Field or a ScratchField.

A ViewField instance holds MultiFab corresponding to a subview of a Field or a ScratchField. As the data is managed by the source Field or ScratchField, subview instances cannot be created directly but instead must be created using the Field::subview() and ScratchField::subview() methods.

Constructor & Destructor Documentation

◆ ViewField() [1/3]

template<typename T >
amr_wind::ViewField< T >::ViewField ( const ViewField< T > &  )
delete

◆ ViewField() [2/3]

template<typename T >
amr_wind::ViewField< T >::ViewField ( ViewField< T > &&  )
default

◆ ViewField() [3/3]

template<typename T >
amr_wind::ViewField< T >::ViewField ( T src,
const int  scomp = 0,
const int  ncomp = 1 
)
private

Member Function Documentation

◆ field_location()

template<typename T >
FieldLoc amr_wind::ViewField< T >::field_location ( ) const
inline

◆ name()

template<typename T >
std::string amr_wind::ViewField< T >::name ( ) const
inline

◆ num_comp()

template<typename T >
int amr_wind::ViewField< T >::num_comp ( ) const
inline

Number of components in this subview.

◆ num_grow()

template<typename T >
const amrex::IntVect& amr_wind::ViewField< T >::num_grow ( ) const
inline

◆ operator()() [1/2]

template<typename T >
amrex::MultiFab& amr_wind::ViewField< T >::operator() ( int  lev)
inline

Return the field data for a given level.

◆ operator()() [2/2]

template<typename T >
const amrex::MultiFab& amr_wind::ViewField< T >::operator() ( int  lev) const
inline

◆ operator=() [1/2]

template<typename T >
ViewField& amr_wind::ViewField< T >::operator= ( const ViewField< T > &  )
delete

◆ operator=() [2/2]

template<typename T >
ViewField& amr_wind::ViewField< T >::operator= ( ViewField< T > &&  )
default

◆ repo()

template<typename T >
const FieldRepo& amr_wind::ViewField< T >::repo ( ) const
inline

Return a reference to the field repository that created this field.

◆ source_field() [1/2]

template<typename T >
T& amr_wind::ViewField< T >::source_field ( )
inline

Return a reference to the source field from which this view is derived.

◆ source_field() [2/2]

template<typename T >
const T& amr_wind::ViewField< T >::source_field ( ) const
inline

◆ vec_const_ptrs()

template<typename T >
amrex::Vector<const amrex::MultiFab*> amr_wind::ViewField< T >::vec_const_ptrs ( ) const
inlinenoexcept

◆ vec_ptrs()

template<typename T >
amrex::Vector<amrex::MultiFab*> amr_wind::ViewField< T >::vec_ptrs ( )
inlinenoexcept

Member Data Documentation

◆ m_data

template<typename T >
amrex::Vector<amrex::MultiFab> amr_wind::ViewField< T >::m_data
private

MultiFabs holding the alias views.

◆ m_ncomp

template<typename T >
int amr_wind::ViewField< T >::m_ncomp
private

Number of sub-components in this view.

◆ m_scomp

template<typename T >
int amr_wind::ViewField< T >::m_scomp
private

Index of the starting component.

◆ m_src

template<typename T >
T& amr_wind::ViewField< T >::m_src
private

The base field.

◆ T

template<typename T >
friend amr_wind::ViewField< T >::T

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