void FluidSimulator::simulate(){ set_sources(D_0, U_0, V_0); step_velocity(U, V, U_0, V_0, viscosity); step_density(D, D_0, U, V, diffusion_rate); }
void cl_context::set_sources(const std::string &path) { try { cl::Program::Sources sources; std::string file_content = fs::read_file(path); sources.push_back(std::make_pair(file_content.c_str(), file_content.size() + 1)); set_sources(sources); } catch(fs::FileNotFoundException &e) { LOG_ERROR<<e.what(); } }