AmrTrilinearInterpolater.h 1.99 KB
Newer Older
frey_m's avatar
frey_m committed
1 2 3 4
//
// Class AmrTrilinearInterpolater
//   Trilinear 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 21
// 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/>.
//

22 23 24 25 26 27 28 29
#ifndef AMR_TRILINEAR_INTERPOLATER_H
#define AMR_TRILINEAR_INTERPOLATER_H

#include "AmrInterpolater.h"

#include <algorithm>
#include <iterator>

frey_m's avatar
frey_m committed
30 31
template <class Level>
class AmrTrilinearInterpolater : public AmrInterpolater<Level>
32
{
33
public:
34 35 36 37 38 39
    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;
40 41 42 43 44 45
    
public:
    
    AmrTrilinearInterpolater();
    
    void stencil(const AmrIntVect_t& iv,
46 47 48
                 const basefab_t& fab,
                 umap_t& map,
                 const scalar_t& scale,
frey_m's avatar
frey_m committed
49
                 Level* mglevel);
50 51
    
    void coarse(const AmrIntVect_t& iv,
52 53 54
                umap_t& map,
                const scalar_t& scale,
                lo_t dir, lo_t shift, const basefab_t& rfab,
55
                const AmrIntVect_t& riv,
frey_m's avatar
frey_m committed
56
                Level* mglevel);
57 58
    
    void fine(const AmrIntVect_t& iv,
59 60 61
              umap_t& map,
              const scalar_t& scale,
              lo_t dir, lo_t shift, const basefab_t& fab,
frey_m's avatar
frey_m committed
62
              Level* mglevel);
63 64 65 66 67 68
};


#include "AmrTrilinearInterpolater.hpp"

#endif