Skip to content
Snippets Groups Projects
sfx-sheba.h 3.83 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 >
    
    数学の武士's avatar
    数学の武士 committed
    class FluxShebaBase : public ModelBase<T, memIn, memOut, RunMem>
    
    数学の武士's avatar
    数学の武士 committed
    {
    
    数学の武士's avatar
    数学の武士 committed
    public:
        using ModelBase<T, memIn, memOut, RunMem>::res_sfx;
        using ModelBase<T, memIn, memOut, RunMem>::sfx;
        using ModelBase<T, memIn, memOut, RunMem>::meteo;
        using ModelBase<T, memIn, memOut, RunMem>::grid_size;
        using ModelBase<T, memIn, memOut, RunMem>::ifAllocated;
        using ModelBase<T, memIn, memOut, RunMem>::allocated_size;
    
    数学の武士's avatar
    数学の武士 committed
    
    
    数学の武士's avatar
    数学の武士 committed
        sfx_surface_param surface;
        sfx_phys_constants phys;
        sfx_sheba_param_C model;
        sfx_sheba_numericsType_C numerics;
    
    数学の武士's avatar
    数学の武士 committed
    
    
    数学の武士's avatar
    数学の武士 committed
        FluxShebaBase(sfxDataVecTypeC* sfx,
                    meteoDataVecTypeC* meteo,
    
    数学の武士's avatar
    数学の武士 committed
                    const sfx_sheba_param_C model, 
                    const sfx_surface_param surface,
                    const sfx_sheba_numericsType_C numerics,
                    const sfx_phys_constants phys,
    
    数学の武士's avatar
    数学の武士 committed
                    const int grid_size);
        ~FluxShebaBase();
    };
    
    template<typename T, MemType memIn, MemType memOut, MemType RunMem >
    class FluxSheba : public FluxShebaBase<T, memIn, memOut, RunMem>
    {};
    
    数学の武士's avatar
    数学の武士 committed
    
    
    数学の武士's avatar
    数学の武士 committed
    template<typename T, MemType memIn, MemType memOut >
    class FluxSheba<T, memIn, memOut, MemType::CPU> : public FluxShebaBase<T, memIn, memOut, MemType::CPU>
    {
        using FluxShebaBase<T, memIn, memOut, MemType::CPU>::res_sfx;
        using FluxShebaBase<T, memIn, memOut, MemType::CPU>::sfx;
        using FluxShebaBase<T, memIn, memOut, MemType::CPU>::meteo;
    
    数学の武士's avatar
    数学の武士 committed
        using FluxShebaBase<T, memIn, memOut, MemType::CPU>::surface;
        using FluxShebaBase<T, memIn, memOut, MemType::CPU>::phys;
    
    数学の武士's avatar
    数学の武士 committed
        using FluxShebaBase<T, memIn, memOut, MemType::CPU>::grid_size;
        using FluxShebaBase<T, memIn, memOut, MemType::CPU>::ifAllocated;
        using FluxShebaBase<T, memIn, memOut, MemType::CPU>::allocated_size;
    
    数学の武士's avatar
    数学の武士 committed
        using FluxShebaBase<T, memIn, memOut, MemType::CPU>::model;
    
    数学の武士's avatar
    数学の武士 committed
        using FluxShebaBase<T, memIn, memOut, MemType::CPU>::numerics;
    public:
        FluxSheba(sfxDataVecTypeC* sfx,
                    meteoDataVecTypeC* meteo,
    
    数学の武士's avatar
    数学の武士 committed
                    const sfx_sheba_param_C model, 
                    const sfx_surface_param surface,
                    const sfx_sheba_numericsType_C numerics,
                    const sfx_phys_constants phys,
                    const int grid_size) : FluxShebaBase<T, memIn, memOut, MemType::CPU>(sfx, meteo, model, 
                                           surface, numerics, phys, grid_size) {}
    
    数学の武士's avatar
    数学の武士 committed
        ~FluxSheba() = default;
        void compute_flux();
    };
    
    数学の武士's avatar
    数学の武士 committed
    
    
    数学の武士's avatar
    数学の武士 committed
    #ifdef INCLUDE_CUDA
    template<typename T, MemType memIn, MemType memOut >
    class FluxSheba<T, memIn, memOut, MemType::GPU> : public FluxShebaBase<T, memIn, memOut, MemType::GPU>
    {
        using FluxShebaBase<T, memIn, memOut, MemType::GPU>::res_sfx;
        using FluxShebaBase<T, memIn, memOut, MemType::GPU>::sfx;
        using FluxShebaBase<T, memIn, memOut, MemType::GPU>::meteo;
    
    数学の武士's avatar
    数学の武士 committed
        using FluxShebaBase<T, memIn, memOut, MemType::GPU>::surface;
        using FluxShebaBase<T, memIn, memOut, MemType::GPU>::phys;
    
    数学の武士's avatar
    数学の武士 committed
        using FluxShebaBase<T, memIn, memOut, MemType::GPU>::grid_size;
        using FluxShebaBase<T, memIn, memOut, MemType::GPU>::ifAllocated;
        using FluxShebaBase<T, memIn, memOut, MemType::GPU>::allocated_size;
    
    数学の武士's avatar
    数学の武士 committed
        using FluxShebaBase<T, memIn, memOut, MemType::GPU>::model;
    
    数学の武士's avatar
    数学の武士 committed
        using FluxShebaBase<T, memIn, memOut, MemType::GPU>::numerics;
    public:
        FluxSheba(sfxDataVecTypeC* sfx,
                    meteoDataVecTypeC* meteo,
    
    数学の武士's avatar
    数学の武士 committed
                    const sfx_sheba_param_C model, 
                    const sfx_surface_param surface,
                    const sfx_sheba_numericsType_C numerics,
                    const sfx_phys_constants phys,
                    const int grid_size) : FluxShebaBase<T, memIn, memOut, MemType::GPU>(sfx, meteo, model, 
                                           surface, numerics, phys, grid_size) {}
    
    数学の武士's avatar
    数学の武士 committed
        ~FluxSheba() = default;
        void compute_flux();
    };
    #endif