#include #include #include template using SyclHostAlloc = acpp::sycl::usm_allocator, acpp::sycl::usm::alloc::host>; template using SyclDeviceAlloc = acpp::sycl::usm_allocator, acpp::sycl::usm::alloc::device>; namespace kel { namespace lbm { namespace sch { using namespace saw::schema; /** * Basic distribution function * Base type * D * Q * Scalar factor * D factor * Q factor */ using T = Float64; using D2Q9 = Descriptor<2u,9u>; using DfCell = Cell; using CellInfo = Cell; /** * Basic type for simulation */ using CellStruct = Struct< Member, Member, Member >; template using MacroStruct = Struct< Member, "velocity">, Member >; } namespace cmpt { template struct PressureBoundaryRestrictedVelocityTo {}; } /** * This is massively hacky and expects a lot of conditions * Either this or mirrored along the horizontal line works * * 0 - 2 - 2 * 0 - 3 - 1 * 0 - 3 - 1 * ......... * 0 - 3 - 1 * 0 - 2 - 2 * */ void set_geometry( std::vector, SyclDeviceAlloc>& dfs, std::vector, SyclDeviceAlloc>& dfs_old, std::vector, SyclDeviceAlloc>& info, const saw::data>& meta, acpp::sycl::queue& sycl_q ){ using namespace kel::lbm; } void set_initial_conditions( std::vector, SyclDeviceAlloc>& dfs, std::vector, SyclDeviceAlloc>& dfs_old, std::vector, SyclDeviceAlloc>& info, const saw::data>& meta, acpp::sycl::queue& sycl_q ){ using namespace kel::lbm; saw::data rho{1.0}; saw::data> vel{{0.0,0.0}}; auto eq = equilibrium(rho, vel); } void lbm_step( std::vector, SyclDeviceAlloc>& dfs, std::vector, SyclDeviceAlloc>& dfs_old, std::vector, SyclDeviceAlloc>& info, const saw::data>& meta, uint64_t time_step, acpp::sycl::queue& sycl_q ){ using namespace kel::lbm; using dfi = df_info; bool even_step = ((time_step % 2u) == 0u); /** * 1. Relaxation parameter \tau */ component coll{0.5384}; component bb; component> inlet{1.01 * dfi::cs2}; component> outlet{1.0 * dfi::cs2}; } } } template saw::error_or kel_main(int argc, char** argv){ using namespace kel; using dfi = lbm::df_info; auto eo_lbm_dir = lbm::output_directory(); if(eo_lbm_dir.is_error()){ return std::move(eo_lbm_dir.get_error()); } auto& lbm_dir = eo_lbm_dir.get_value(); auto out_dir = lbm_dir / "poiseulle_channel_2d_gpu"; // Create Dir TODO // lbm::converter conv { // delta_x {{1.0}}, // delta_t {{1.0}} }; uint64_t x_d = 1024u; uint64_t y_d = 128u; acpp::sycl::queue sycl_q; SyclHostAlloc sycl_host_alloc{sycl_q}; SyclDeviceAlloc sycl_dev_alloc{sycl_q}; std::vector, SyclHostAlloc> cells{x_d * y_d,sycl_alloc}; std::vector, SyclDeviceAlloc> cells{x_d * y_d,sycl_alloc}; { auto eov = set_geometry(cells); if(eov.is_error()){ return eov; } } return saw::make_void(); } int main(int argc, char** argv){ auto eov = kel_main(argc, argv); if(eov.is_error()){ auto& err = eov.get_error(); std::cerr<<"[Error] "< 0u){ std::cerr<<" - "<