Proto  3.2
Classes | Namespaces | Macros | Typedefs | Functions | Variables
Proto_LevelBoxData.H File Reference
#include "Proto_MemType.H"
#include "Proto_Memory.H"
#include "Proto_Point.H"
#include "Proto_Centering.H"
#include "Proto_Box.H"
#include "Proto_Copier.H"
#include "Proto_DisjointBoxLayout.H"
#include "Proto_DataIterator.H"
#include "Proto_NeighborIterator.H"
#include "Proto_MayDay.H"
#include "Proto_SPMD.H"
#include <cstdlib>
#include <iostream>
#include <cstring>
#include "implem/Proto_LevelBoxDataImplem.H"
Include dependency graph for Proto_LevelBoxData.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Proto::LevelBoxData< T, C, MEM, CTR >
 Level Box Data. More...
 
class  Proto::LevelExchangeCopier< T, C, MEM, CTR >
 Exchange Copier. More...
 
class  Proto::LevelBoxData< T, C, MEM, CTR >
 Level Box Data. More...
 
class  Proto::LevelCopierOp< T, C, SRC_MEM, DST_MEM, CTR >
 Level Copier Operator. More...
 
class  Proto::LevelCopier< T, C, SRC_MEM, DST_MEM, CTR >
 Level Copier. More...
 
class  Proto::LevelExchangeCopier< T, C, MEM, CTR >
 Exchange Copier. More...
 

Namespaces

 Proto
 

Macros

#define _PROTO_LEVELBOXDATA_H_
 

Typedefs

typedef MotionItem< BoxPartition, BoxPartition > Proto::LevelMotionItem
 

Functions

template<typename T , unsigned int C, MemType MEM, Centering CTR>
void Proto::interpBoundaries (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, InterpStencil< T > &a_interp)
 Interpolate Boundaries. More...
 
template<typename T , unsigned int C, MemType MEM, Centering CTR>
void Proto::interpBoundaries (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, LevelBoxData< T, C, MEM, CTR > &a_crseFine, InterpStencil< T > &a_interp)
 Interpolate Boundaries. More...
 
template<typename T , unsigned int C, MemType MEM, Centering CTR>
void Proto::averageDown (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, Point a_refRatio)
 Average Down. More...
 
template<typename T , unsigned int C, MemType MEM, Centering CTR>
void Proto::averageDown (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, int a_refRatio)
 Average Down (Scalar Refinement Ratio) More...
 
template<typename T , unsigned int C, MemType MEM, Centering CTR>
void Proto::averageDown (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, LevelBoxData< T, C, MEM, CTR > &a_crseFine, Point a_refRatio)
 Average Down. More...
 
template<typename T , unsigned int C, MemType MEM, Centering CTR>
void Proto::averageDown (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, LevelBoxData< T, C, MEM, CTR > &a_crseFine, int a_refRatio)
 Average Down (Scalar Refinement Ratio) More...
 
template<typename T , MemType MEM>
PROTO_KERNEL_START void Proto::f_proto_iotaF (Point &a_pt, Var< T, DIM, MEM > &a_X, Array< T, DIM > a_dx, Array< T, DIM > a_offset, int a_ctr)
 
template<typename IN >
const IN & Proto::parse_level_arg (LevelIndex &a_index, const IN &a_arg)
 
template<typename T , unsigned int C, MemType MEM, Centering CTR>
const BoxData< T, C, MEM > & Proto::parse_level_arg (LevelIndex &a_index, const LevelBoxData< T, C, MEM, CTR > &a_arg)
 
template<int I = 0, typename Func , typename... LArgs, typename... FArgs>
std::enable_if< I==sizeof...(LArgs), void >::type Proto::call_level_forall (Func &a_func, LevelIndex &a_index, std::tuple< LArgs... > a_args, FArgs &&... a_fargs)
 

Variables

template<int I = 0, typename Func , typename... LArgs, typename... FArgs>
std::enable_if< I< sizeof...(LArgs), void >::typecall_level_forall(Func &a_func, LevelIndex &a_index, std::tuple< LArgs... > a_args, FArgs &&... a_fargs){ auto &arg=parse_level_arg(a_index, std::get< I >a_args));call_level_forall< I+1 >a_func, a_index, a_args, a_fargs..., arg);}template< typename T, unsigned int C, MemType MEM, Centering CTR >template< typename Func, typename... Srcs >void LevelBoxData< T, C, MEM, CTR >::initialize(Func &a_func, Srcs &... a_srcs){ PROTO_ASSERT(m_isDefined, "LevelBoxData::initialize | Error: Object not defined");auto srcs=std::tuple< Srcs &... >a_srcs...);for(auto iter :m_layout) { auto &patch=(*this)[iter];call_level_forall(a_func, iter, srcs, patch);}}template< typename T, unsigned int C, MemType MEM, Centering CTR >BoxLevelBoxData< T, C, MEM, CTR >::patchBox(const DataIndex< BoxPartition > &a_index) const { PROTO_ASSERT(m_isDefined, "LevelBoxData::patchBox | Error: Object not defined");PROTO_ASSERT(DIM<=6, "LevelBoxData::patchBox | Error: This function will fail for DIM > 6");Box B;if(CTR==PR_CELL) { B=layout()[a_index];} else if(CTR==PR_NODE) { B=layout()[a_index].extrude(Point::Ones());} else { int ctr=(int) CTR;B=layout()[a_index].extrude(Point::Basis(ctr, 1));} return B;}template< typename T, unsigned int C, MemType MEM, Centering CTR >unsigned intLevelBoxData< T, C, MEM, CTR >::patchSize() const { PROTO_ASSERT(m_isDefined, "LevelBoxData::patchSize | Error: Object not defined");int size=1;Point boxSize=layout().boxSize()+2 *ghost();switch(CTR) { case PR_NODE:boxSize+=Point::Ones();break;case PR_CELL:break;default:MayDay< void >::Abort("LevelBoxData::patchSize | Specified centering not implemented");} for(int ii=0;ii< DIM;ii++) { size *=boxSize[ii];} return C *size;}template< typename T, unsigned int C, MemType MEM, Centering CTR >unsigned intLevelBoxData< T, C, MEM, CTR >::offset(int a_proc) const { return layout().offset(a_proc) *patchSize();}template< typename T, unsigned int C, MemType MEM, Centering CTR >unsigned int LevelBoxData< T, C, MEM, CTR >::numBoxes() const { return m_layout.size();}template< typename T, unsigned int C, MemType MEM, Centering CTR >void LevelBoxData< T, C, MEM, CTR >::setToZero(int a_comp){ setVal(0, a_comp);}template< typename T, unsigned int C, MemType MEM, Centering CTR >void LevelBoxData< T, C, MEM, CTR >::setVal(T a_value, int a_comp){ PROTO_ASSERT(m_isDefined, "LevelBoxData::setVal | Error: Object not defined");PROTO_ASSERT((a_comp >=-1) &&(a_comp< DIM), "LevelBoxData::setVal | Error: %i is not a valid component specification.", a_comp);for(auto iter :m_layout) { auto &patch=(*this)[iter];if(a_comp==-1) { patch.setVal(a_value);} else { auto patch_i=slice(patch, a_comp);patch_i.setVal(a_value);} }}template< typename T, unsigned int C, MemType MEM, Centering CTR >void LevelBoxData< T, C, MEM, CTR >::setDomainBoundary(T a_value, int a_comp){ PROTO_ASSERT(m_isDefined, "LevelBoxData::setBoundary | Error: Object not defined");PROTO_ASSERT((a_comp >=-1) &&(a_comp< DIM), "LevelBoxData::setBoundary | Error: \%i is not a valid component specification.", a_comp);if(ghost()==Point::Zeros()){ return;} for(auto iter :m_layout) { if(!layout().onLevelBoundary(m_layout.point(iter))) { continue;} auto &patch=(*this)[iter];if(a_comp==-1) { BoxData< T, C, MEM > tmp(layout()[iter]);patch.copyTo(tmp);patch.setVal(a_value);tmp.copyTo(patch);} else { auto patch_i=slice(patch, a_comp);BoxData< T, 1, MEM > tmp(layout()[iter]);patch_i.copyTo(tmp);patch_i.setVal(a_value);tmp.copyTo(patch_i);} } exchange();}template< typename T, unsigned int C, MemType MEM, Centering CTR >void LevelBoxData< T, C, MEM, CTR >::setRandom(T a_low, T a_high){ for(auto iter :m_layout) { auto &patch=(*this)[iter];patch.setRandom(a_low, a_high);} exchange();}template< typename T, unsigned int C, MemType MEM, Centering CTR >void LevelBoxData< T, C, MEM, CTR >::exchange(){ PROTO_ASSERT(m_isDefined, "LevelBoxData::exchange | Error: Object not defined");if(m_ghost==Point::Zeros()) { return;} PR_TIME("LevelBoxData::exchange");PROTO_ASSERT(m_exchangeCopier !=nullptr, "LevelBoxData::exchange | Error: exchange copier is not defined");m_exchangeCopier-> Proto::execute ()
 

Macro Definition Documentation

◆ _PROTO_LEVELBOXDATA_H_

#define _PROTO_LEVELBOXDATA_H_