AmrPCInterpolater.h 1.94 KB
Newer Older
frey_m's avatar
frey_m committed
1 2 3 4
//
// Class AmrPCInterpolater
//   Piecewise constant interpolation of data on coarse cells to fine cells.
//
frey_m's avatar
frey_m committed
5
// Copyright (c) 2017 - 2020, Matthias Frey, Paul Scherrer Institut, Villigen PSI, Switzerland
frey_m's avatar
frey_m committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// All rights reserved
//
// Implemented as part of the PhD thesis
// "Precise Simulations of Multibunches in High Intensity Cyclotrons"
//
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
21 22 23 24 25
#ifndef AMR_PIECEWISE_CONST_INTERPOLATER_H
#define AMR_PIECEWISE_CONST_INTERPOLATER_H

#include "AmrInterpolater.h"

frey_m's avatar
frey_m committed
26 27
template <class Level>
class AmrPCInterpolater : public AmrInterpolater<Level>
28
{
29
public:
30 31 32 33 34 35
    typedef typename Level::go_t        go_t;
    typedef typename Level::lo_t        lo_t;
    typedef typename Level::scalar_t    scalar_t;
    typedef typename Level::umap_t      umap_t;
    typedef typename Level::basefab_t   basefab_t;
    typedef amr::AmrIntVect_t           AmrIntVect_t;
36
    
37 38 39 40
public:
    AmrPCInterpolater();
    
    void stencil(const AmrIntVect_t& iv,
41 42 43
                 const basefab_t& fab,
                 umap_t& map,
                 const scalar_t& scale,
frey_m's avatar
frey_m committed
44
                 Level* mglevel);
45 46
    
    void coarse(const AmrIntVect_t& iv,
47 48 49
                umap_t& map,
                const scalar_t& scale,
                lo_t dir, lo_t shift, const basefab_t& rfab,
50
                const AmrIntVect_t& riv,
frey_m's avatar
frey_m committed
51
                Level* mglevel);
52 53
    
    void fine(const AmrIntVect_t& iv,
54 55 56
              umap_t& map,
              const scalar_t& scale,
              lo_t dir, lo_t shift, const basefab_t& fab,
frey_m's avatar
frey_m committed
57
              Level* mglevel);
58 59 60 61 62 63
    
};

#include "AmrPCInterpolater.hpp"

#endif