MCPcopy Create free account
hub / github.com/ProjectPhysX/FluidX3D / initialize

Method initialize

src/lbm.cpp:856–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856void LBM::initialize() { // write all data fields to device and call kernel_initialize
857#ifndef BENCHMARK
858 sanity_checks_initialization();
859#endif // BENCHMARK
860
861 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->rho.enqueue_write_to_device();
862 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->u.enqueue_write_to_device();
863 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->flags.enqueue_write_to_device();
864#ifdef FORCE_FIELD
865 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->F.enqueue_write_to_device();
866 communicate_F();
867#endif // FORCE_FIELD
868#ifdef SURFACE
869 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->phi.enqueue_write_to_device();
870#endif // SURFACE
871#ifdef TEMPERATURE
872 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->T.enqueue_write_to_device();
873#endif // TEMPERATURE
874#ifdef PARTICLES
875 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->particles.enqueue_write_to_device();
876 communicate_particles();
877#endif // PARTICLES
878
879 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->increment_time_step(); // the communicate calls at initialization need an odd time step
880 communicate_rho_u_flags();
881#ifdef SURFACE
882 communicate_phi_massex_flags();
883#endif // SURFACE
884 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->enqueue_initialize(); // odd time step is baked-in the kernel
885 communicate_rho_u_flags();
886#ifdef SURFACE
887 communicate_phi_massex_flags();
888#endif // SURFACE
889 communicate_fi(); // time step must be odd here
890#ifdef TEMPERATURE
891 communicate_T(); // T halo data is required for field_slice rendering
892 communicate_gi(); // time step must be odd here
893#endif // TEMPERATURE
894 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->finish_queue();
895 for(uint d=0u; d<get_D(); d++) lbm_domain[d]->reset_time_step(); // set time step to 0 again
896 initialized = true;
897}
898
899void LBM::do_time_step() { // call kernel_stream_collide to perform one LBM time step
900#ifdef SURFACE

Callers

nothing calls this directly

Calls 5

increment_time_stepMethod · 0.80
enqueue_initializeMethod · 0.80
reset_time_stepMethod · 0.80
finish_queueMethod · 0.45

Tested by

no test coverage detected