Skip to content
Snippets Groups Projects
sfx-sheba.h 2.57 KiB
Newer Older
  • Learn to ignore specific revisions
  • 数学の武士's avatar
    数学の武士 committed
    #pragma once
    
    #include "sfx-template-parameters.h"
    #include "model-base.h"
    #include "sfx-data.h"
    
    数学の武士's avatar
    数学の武士 committed
    
    
    数学の武士's avatar
    数学の武士 committed
    template<typename T, MemType memIn, MemType memOut, MemType RunMem >
    
    class FluxSheba : public ModelBase<T, memIn, memOut, RunMem>
    
    数学の武士's avatar
    数学の武士 committed
    {};
    
    数学の武士's avatar
    数学の武士 committed
    
    
    数学の武士's avatar
    数学の武士 committed
    template<typename T, MemType memIn, MemType memOut >
    
    class FluxSheba<T, memIn, memOut, MemType::CPU> : public ModelBase<T, memIn, memOut, MemType::CPU>
    
    数学の武士's avatar
    数学の武士 committed
    {
    
        using ModelBase<T, memIn, memOut, MemType::CPU>::res_sfx;
        using ModelBase<T, memIn, memOut, MemType::CPU>::sfx;
        using ModelBase<T, memIn, memOut, MemType::CPU>::meteo;
        using ModelBase<T, memIn, memOut, MemType::CPU>::grid_size;
        using ModelBase<T, memIn, memOut, MemType::CPU>::ifAllocated;
        using ModelBase<T, memIn, memOut, MemType::CPU>::allocated_size;
    
    数学の武士's avatar
    数学の武士 committed
    public:
        FluxSheba(sfxDataVecTypeC* sfx,
                    meteoDataVecTypeC* meteo,
    
                    const int grid_size) : ModelBase<T, memIn, memOut, MemType::CPU>(sfx, meteo, grid_size) {}
        ~FluxSheba() = default;
        void compute_flux(const sfx_sheba_param_C model, 
    
    数学の武士's avatar
    数学の武士 committed
                    const sfx_surface_param surface,
                    const sfx_sheba_numericsType_C numerics,
    
                    const sfx_phys_constants phys);
        void noit_compute_flux(const sfx_sheba_noit_param_C model, 
                    const sfx_surface_param surface,
                    const sfx_sheba_noit_numericsType_C numerics,
                    const sfx_phys_constants phys);
    
    数学の武士's avatar
    数学の武士 committed
    };
    
    数学の武士's avatar
    数学の武士 committed
    
    
    数学の武士's avatar
    数学の武士 committed
    #ifdef INCLUDE_CUDA
    template<typename T, MemType memIn, MemType memOut >
    
    class FluxSheba<T, memIn, memOut, MemType::GPU> : public ModelBase<T, memIn, memOut, MemType::GPU>
    
    数学の武士's avatar
    数学の武士 committed
    {
    
        using ModelBase<T, memIn, memOut, MemType::GPU>::res_sfx;
        using ModelBase<T, memIn, memOut, MemType::GPU>::sfx;
        using ModelBase<T, memIn, memOut, MemType::GPU>::meteo;
        using ModelBase<T, memIn, memOut, MemType::GPU>::grid_size;
        using ModelBase<T, memIn, memOut, MemType::GPU>::ifAllocated;
        using ModelBase<T, memIn, memOut, MemType::GPU>::allocated_size;
    
    数学の武士's avatar
    数学の武士 committed
    public:
        FluxSheba(sfxDataVecTypeC* sfx,
                    meteoDataVecTypeC* meteo,
    
                    const int grid_size) : ModelBase<T, memIn, memOut, MemType::GPU>(sfx, meteo, grid_size) {}
        ~FluxSheba() = default;
        void compute_flux(const sfx_sheba_param_C model, 
    
    数学の武士's avatar
    数学の武士 committed
                    const sfx_surface_param surface,
                    const sfx_sheba_numericsType_C numerics,
    
                    const sfx_phys_constants phys);
        void noit_compute_flux(const sfx_sheba_noit_param_C model, 
                    const sfx_surface_param surface,
                    const sfx_sheba_noit_numericsType_C numerics,
                    const sfx_phys_constants phys);
    
    数学の武士's avatar
    数学の武士 committed
    };
    #endif