ThunderEgg  1.0.0
ThunderEgg::GMG::LinearRestrictor< D > Class Template Reference

Restrictor that averages the corresponding fine cells into each coarse cell. More...

#include <LinearRestrictor.h>

Inheritance diagram for ThunderEgg::GMG::LinearRestrictor< D >:
Collaboration diagram for ThunderEgg::GMG::LinearRestrictor< D >:

Public Member Functions

 LinearRestrictor (const Domain< D > &fine_domain, const Domain< D > &coarse_domain, bool extrapolate_boundary_ghosts=false)
 Create new LinearRestrictor object. More...
 
LinearRestrictor< D > * clone () const override
 Clone this restrictor. More...
 
void restrictPatches (const std::vector< std::pair< int, std::reference_wrapper< const PatchInfo< D >>>> &patches, const Vector< D > &finer_vector, Vector< D > &coarser_vector) const override
 Restrict values into coarse vector. More...
 
- Public Member Functions inherited from ThunderEgg::GMG::MPIRestrictor< D >
 MPIRestrictor (const Domain< D > &coarser_domain, const Domain< D > &finer_domain)
 Create new LinearRestrictor object. More...
 
Vector< D > restrict (const Vector< D > &fine) const override
 
- Public Member Functions inherited from ThunderEgg::GMG::Restrictor< D >
virtual ~Restrictor ()
 Destroy the Restrictor object.
 

Detailed Description

template<int D>
class ThunderEgg::GMG::LinearRestrictor< D >

Restrictor that averages the corresponding fine cells into each coarse cell.

Constructor & Destructor Documentation

◆ LinearRestrictor()

template<int D>
ThunderEgg::GMG::LinearRestrictor< D >::LinearRestrictor ( const Domain< D > &  fine_domain,
const Domain< D > &  coarse_domain,
bool  extrapolate_boundary_ghosts = false 
)
inline

Create new LinearRestrictor object.

Parameters
fine_domainthe finer Domain
coarse_domainthe coarser Domain
extrapolate_boundary_ghostsset to true if ghost values at the boundaries should be extrapolated

Member Function Documentation

◆ clone()

template<int D>
LinearRestrictor<D>* ThunderEgg::GMG::LinearRestrictor< D >::clone ( ) const
inlineoverridevirtual

Clone this restrictor.

Returns
LinearRestrictor<D>* a newly allocated copy of this restrictor

Implements ThunderEgg::GMG::Restrictor< D >.

◆ restrictPatches()

template<int D>
void ThunderEgg::GMG::LinearRestrictor< D >::restrictPatches ( const std::vector< std::pair< int, std::reference_wrapper< const PatchInfo< D >>>> &  patches,
const Vector< D > &  finer_vector,
Vector< D > &  coarser_vector 
) const
inlineoverridevirtual

Restrict values into coarse vector.

The idea behind this is that this function will be called twice. Once to fill in the ghost values, and once to fill in the local values. The ghost values will be filled first and the local values will be fill while MPI communication is happening.

Parameters
patchespairs where the first value is the index in the coarse vector and the second value is a reference to the PatchInfo object
finer_vectorthe finer vector
coarser_vectorthe coarser vector

Implements ThunderEgg::GMG::MPIRestrictor< D >.


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