x3d2_poisson_solver Program

Uses

  • program~~x3d2_poisson_solver~~UsesGraph program~x3d2_poisson_solver x3d2_poisson_solver iso_fortran_env iso_fortran_env program~x3d2_poisson_solver->iso_fortran_env m_mpi m_mpi program~x3d2_poisson_solver->m_mpi module~m_allocator m_allocator program~x3d2_poisson_solver->module~m_allocator module~m_backend_setup m_backend_setup program~x3d2_poisson_solver->module~m_backend_setup module~m_base_backend m_base_backend program~x3d2_poisson_solver->module~m_base_backend module~m_common m_common program~x3d2_poisson_solver->module~m_common module~m_logger m_logger program~x3d2_poisson_solver->module~m_logger module~m_mesh m_mesh program~x3d2_poisson_solver->module~m_mesh module~m_tdsops m_tdsops program~x3d2_poisson_solver->module~m_tdsops module~m_tdsops_setup m_tdsops_setup program~x3d2_poisson_solver->module~m_tdsops_setup module~m_allocator->module~m_common module~m_field m_field module~m_allocator->module~m_field module~m_backend_setup->m_mpi module~m_backend_setup->module~m_allocator module~m_backend_setup->module~m_base_backend module~m_backend_setup->module~m_common module~m_backend_setup->module~m_logger module~m_backend_setup->module~m_mesh cudafor cudafor module~m_backend_setup->cudafor module~m_cuda_allocator m_cuda_allocator module~m_backend_setup->module~m_cuda_allocator module~m_cuda_backend m_cuda_backend module~m_backend_setup->module~m_cuda_backend module~m_cuda_common m_cuda_common module~m_backend_setup->module~m_cuda_common module~m_cuda_errors m_cuda_errors module~m_backend_setup->module~m_cuda_errors module~m_omp_backend m_omp_backend module~m_backend_setup->module~m_omp_backend module~m_omp_common m_omp_common module~m_backend_setup->module~m_omp_common module~m_omptgt_allocator m_omptgt_allocator module~m_backend_setup->module~m_omptgt_allocator module~m_omptgt_backend m_omptgt_backend module~m_backend_setup->module~m_omptgt_backend module~m_omptgt_common m_omptgt_common module~m_backend_setup->module~m_omptgt_common omp_lib omp_lib module~m_backend_setup->omp_lib module~m_base_backend->module~m_allocator module~m_base_backend->module~m_common module~m_base_backend->module~m_logger module~m_base_backend->module~m_mesh module~m_base_backend->module~m_tdsops iso_c_binding iso_c_binding module~m_base_backend->iso_c_binding module~m_base_backend->module~m_field module~m_poisson_fft m_poisson_fft module~m_base_backend->module~m_poisson_fft module~m_common->m_mpi module~m_common->module~m_logger module~m_logger->iso_fortran_env module~m_logger->m_mpi module~m_mesh->m_mpi module~m_mesh->module~m_common module~m_mesh->module~m_logger module~m_mesh->module~m_field module~m_mesh_content m_mesh_content module~m_mesh->module~m_mesh_content module~m_tdsops->module~m_common module~m_tdsops->module~m_logger module~m_tdsops_setup->module~m_base_backend module~m_tdsops_setup->module~m_common module~m_tdsops_setup->module~m_logger module~m_tdsops_setup->module~m_mesh module~m_tdsops_setup->module~m_tdsops module~m_cuda_allocator->module~m_allocator module~m_cuda_allocator->module~m_common module~m_cuda_allocator->module~m_mesh module~m_cuda_allocator->module~m_field module~m_cuda_backend->m_mpi module~m_cuda_backend->module~m_allocator module~m_cuda_backend->module~m_base_backend module~m_cuda_backend->module~m_common module~m_cuda_backend->module~m_logger module~m_cuda_backend->module~m_mesh module~m_cuda_backend->module~m_tdsops module~m_cuda_backend->cudafor module~m_cuda_backend->iso_c_binding module~m_cuda_backend->module~m_cuda_allocator module~m_cuda_backend->module~m_cuda_common module~m_cuda_backend->module~m_cuda_errors module~m_cuda_backend->module~m_field module~m_cuda_exec_dist m_cuda_exec_dist module~m_cuda_backend->module~m_cuda_exec_dist module~m_cuda_exec_thom m_cuda_exec_thom module~m_cuda_backend->module~m_cuda_exec_thom module~m_cuda_kernels_dist m_cuda_kernels_dist module~m_cuda_backend->module~m_cuda_kernels_dist module~m_cuda_kernels_fieldops m_cuda_kernels_fieldops module~m_cuda_backend->module~m_cuda_kernels_fieldops module~m_cuda_kernels_reorder m_cuda_kernels_reorder module~m_cuda_backend->module~m_cuda_kernels_reorder module~m_cuda_poisson_fft m_cuda_poisson_fft module~m_cuda_backend->module~m_cuda_poisson_fft module~m_cuda_sendrecv m_cuda_sendrecv module~m_cuda_backend->module~m_cuda_sendrecv module~m_cuda_tdsops m_cuda_tdsops module~m_cuda_backend->module~m_cuda_tdsops module~m_cuda_errors->module~m_logger module~m_cuda_errors->cudafor module~m_field->module~m_common module~m_field->iso_c_binding module~m_mesh_content->module~m_common module~m_mesh_content->module~m_logger module~m_omp_backend->m_mpi module~m_omp_backend->module~m_allocator module~m_omp_backend->module~m_base_backend module~m_omp_backend->module~m_common module~m_omp_backend->module~m_logger module~m_omp_backend->module~m_mesh module~m_omp_backend->module~m_tdsops module~m_omp_backend->module~m_field module~m_omp_backend->module~m_omp_common module~m_exec_thom m_exec_thom module~m_omp_backend->module~m_exec_thom module~m_omp_exec_dist m_omp_exec_dist module~m_omp_backend->module~m_omp_exec_dist module~m_omp_sendrecv m_omp_sendrecv module~m_omp_backend->module~m_omp_sendrecv module~m_ordering m_ordering module~m_omp_backend->module~m_ordering module~m_omptgt_allocator->module~m_allocator module~m_omptgt_allocator->module~m_common module~m_omptgt_allocator->module~m_logger module~m_omptgt_allocator->module~m_mesh module~m_omptgt_allocator->iso_c_binding module~m_omptgt_allocator->module~m_field module~m_omptgt_allocator->omp_lib module~m_omptgt_backend->m_mpi module~m_omptgt_backend->module~m_allocator module~m_omptgt_backend->module~m_base_backend module~m_omptgt_backend->module~m_common module~m_omptgt_backend->module~m_logger module~m_omptgt_backend->module~m_mesh module~m_omptgt_backend->module~m_tdsops module~m_omptgt_backend->module~m_field module~m_omptgt_backend->module~m_omptgt_common module~m_omptgt_backend->omp_lib module~m_omptgt_device_info m_omptgt_device_info module~m_omptgt_backend->module~m_omptgt_device_info module~m_omptgt_exec_dist m_omptgt_exec_dist module~m_omptgt_backend->module~m_omptgt_exec_dist module~m_omptgt_exec_thom m_omptgt_exec_thom module~m_omptgt_backend->module~m_omptgt_exec_thom module~m_omptgt_kernels_fieldops m_omptgt_kernels_fieldops module~m_omptgt_backend->module~m_omptgt_kernels_fieldops module~m_omptgt_sendrecv m_omptgt_sendrecv module~m_omptgt_backend->module~m_omptgt_sendrecv module~m_omptgt_tdsops m_omptgt_tdsops module~m_omptgt_backend->module~m_omptgt_tdsops module~m_omptgt_common->module~m_common module~m_omptgt_common->module~m_logger module~m_omptgt_common->iso_c_binding module~m_omptgt_common->omp_lib module~m_poisson_fft->module~m_common module~m_poisson_fft->module~m_logger module~m_poisson_fft->module~m_mesh module~m_poisson_fft->module~m_tdsops module~m_poisson_fft->module~m_field module~m_cuda_exec_dist->module~m_common module~m_cuda_exec_dist->cudafor module~m_cuda_exec_dist->module~m_cuda_common module~m_cuda_exec_dist->module~m_cuda_kernels_dist module~m_cuda_exec_dist->module~m_cuda_sendrecv module~m_cuda_exec_dist->module~m_cuda_tdsops module~m_cuda_exec_thom->module~m_common module~m_cuda_exec_thom->cudafor module~m_cuda_exec_thom->module~m_cuda_tdsops module~m_cuda_kernels_thom m_cuda_kernels_thom module~m_cuda_exec_thom->module~m_cuda_kernels_thom module~m_cuda_kernels_dist->module~m_common module~m_cuda_kernels_dist->cudafor module~m_cuda_kernels_fieldops->module~m_common module~m_cuda_kernels_fieldops->cudafor module~m_cuda_kernels_fieldops->module~m_cuda_common module~m_cuda_kernels_reorder->module~m_common module~m_cuda_kernels_reorder->cudafor module~m_cuda_kernels_reorder->module~m_cuda_common module~m_cuda_poisson_fft->m_mpi module~m_cuda_poisson_fft->module~m_common module~m_cuda_poisson_fft->module~m_logger module~m_cuda_poisson_fft->module~m_mesh module~m_cuda_poisson_fft->module~m_tdsops module~m_cuda_poisson_fft->cudafor module~m_cuda_poisson_fft->iso_c_binding module~m_cuda_poisson_fft->module~m_cuda_allocator module~m_cuda_poisson_fft->module~m_cuda_errors module~m_cuda_poisson_fft->module~m_field module~m_cuda_poisson_fft->module~m_poisson_fft module~m_cuda_poisson_fft->module~m_cuda_sendrecv cufft cufft module~m_cuda_poisson_fft->cufft cufftXt cufftXt module~m_cuda_poisson_fft->cufftXt module~m_cuda_spectral m_cuda_spectral module~m_cuda_poisson_fft->module~m_cuda_spectral module~m_cuda_sendrecv->m_mpi module~m_cuda_sendrecv->module~m_common module~m_cuda_sendrecv->module~m_logger module~m_cuda_sendrecv->cudafor module~m_cuda_sendrecv->module~m_cuda_errors module~m_cuda_tdsops->module~m_common module~m_cuda_tdsops->module~m_tdsops module~m_exec_thom->module~m_common module~m_exec_thom->module~m_tdsops module~m_omp_kernels_thom m_omp_kernels_thom module~m_exec_thom->module~m_omp_kernels_thom module~m_omp_exec_dist->module~m_common module~m_omp_exec_dist->module~m_tdsops module~m_omp_exec_dist->module~m_omp_common module~m_omp_exec_dist->module~m_omp_sendrecv module~m_omp_kernels_dist m_omp_kernels_dist module~m_omp_exec_dist->module~m_omp_kernels_dist module~m_omp_sendrecv->m_mpi module~m_omp_sendrecv->module~m_common module~m_omp_sendrecv->module~m_logger module~m_omptgt_device_info->iso_c_binding module~m_omptgt_exec_dist->module~m_common module~m_omptgt_exec_dist->module~m_logger module~m_omptgt_exec_dist->module~m_omptgt_common module~m_omptgt_exec_dist->module~m_omptgt_sendrecv module~m_omptgt_exec_dist->module~m_omptgt_tdsops module~m_omptgt_kernels_dist m_omptgt_kernels_dist module~m_omptgt_exec_dist->module~m_omptgt_kernels_dist module~m_omptgt_exec_thom->module~m_common module~m_omptgt_exec_thom->module~m_omptgt_tdsops module~m_omptgt_kernels_thom m_omptgt_kernels_thom module~m_omptgt_exec_thom->module~m_omptgt_kernels_thom module~m_omptgt_kernels_fieldops->module~m_common module~m_omptgt_kernels_fieldops->module~m_omptgt_common module~m_omptgt_sendrecv->m_mpi module~m_omptgt_sendrecv->module~m_common module~m_omptgt_sendrecv->iso_c_binding module~m_omptgt_sendrecv->module~m_omptgt_common module~m_omptgt_tdsops->module~m_common module~m_omptgt_tdsops->module~m_tdsops module~m_omptgt_tdsops->module~m_omptgt_common module~m_ordering->module~m_common module~m_cuda_kernels_thom->module~m_common module~m_cuda_kernels_thom->cudafor module~m_cuda_spectral->module~m_common module~m_cuda_spectral->cudafor module~m_omp_kernels_dist->module~m_common module~m_omp_kernels_dist->module~m_omp_common module~m_omp_kernels_dist->omp_lib module~m_omp_kernels_thom->module~m_common module~m_omp_kernels_thom->module~m_omp_common module~m_omptgt_kernels_dist->module~m_common module~m_omptgt_kernels_dist->module~m_omptgt_common module~m_omptgt_kernels_thom->module~m_common module~m_omptgt_kernels_thom->module~m_omptgt_common

Standalone driver for the Poisson solver. It links only the modules that the Poisson solve needs, from the x3d2_poisson CMake target. It builds the mesh and the FFT Poisson solver for the grid and the boundary conditions on the command line. It fills the right-hand side and solves it the requested number of times. It then reports the solve time.

The default right-hand side is cos(2 pi x). This field has zero mean and zero normal derivative at a non-periodic wall. It is valid for every supported combination of boundary conditions. To use another right-hand side, edit fill_rhs and rebuild.

dirichlet is the velocity boundary condition. The pressure gets homogeneous Neumann walls in that direction. The test test_poisson_bc checks the solve for all four boundary condition configurations.

Usage: x3d2_poisson_solver nx ny nz [bc_x bc_y bc_z] [--repeat N] bc_x, bc_y, bc_z: 'periodic' (default) or 'dirichlet'. The value applies to both ends of the direction. A Dirichlet direction needs an odd grid size. --repeat N: number of times to solve (default 1).


Calls

program~~x3d2_poisson_solver~~CallsGraph program~x3d2_poisson_solver x3d2_poisson_solver interface~str m_logger::str program~x3d2_poisson_solver->interface~str mpi_allreduce mpi_allreduce program~x3d2_poisson_solver->mpi_allreduce mpi_barrier mpi_barrier program~x3d2_poisson_solver->mpi_barrier mpi_comm_size mpi_comm_size program~x3d2_poisson_solver->mpi_comm_size mpi_finalize mpi_finalize program~x3d2_poisson_solver->mpi_finalize mpi_init mpi_init program~x3d2_poisson_solver->mpi_init mpi_wtime mpi_wtime program~x3d2_poisson_solver->mpi_wtime none~init~2 m_backend_setup::backend_setup_t%init program~x3d2_poisson_solver->none~init~2 proc~allocate_tdsops m_tdsops_setup::allocate_tdsops program~x3d2_poisson_solver->proc~allocate_tdsops proc~fill_rhs x3d2_poisson_solver::fill_rhs program~x3d2_poisson_solver->proc~fill_rhs proc~get_block m_allocator::allocator_t%get_block program~x3d2_poisson_solver->proc~get_block proc~get_dims m_mesh::mesh_t%get_dims program~x3d2_poisson_solver->proc~get_dims proc~init_poisson_fft_base m_base_backend::base_backend_t%init_poisson_fft_base program~x3d2_poisson_solver->proc~init_poisson_fft_base proc~log_info m_logger::log_info program~x3d2_poisson_solver->proc~log_info proc~parse_arguments x3d2_poisson_solver::parse_arguments program~x3d2_poisson_solver->proc~parse_arguments proc~release_block m_allocator::allocator_t%release_block program~x3d2_poisson_solver->proc~release_block proc~set_data_loc m_field::field_t%set_data_loc program~x3d2_poisson_solver->proc~set_data_loc proc~set_field_data m_base_backend::base_backend_t%set_field_data program~x3d2_poisson_solver->proc~set_field_data proc~solve_poisson m_poisson_fft::poisson_fft_t%solve_poisson program~x3d2_poisson_solver->proc~solve_poisson proc~sync_base m_base_backend::base_backend_t%sync_base program~x3d2_poisson_solver->proc~sync_base proc~warn_if_rhs_mean_nonzero x3d2_poisson_solver::warn_if_rhs_mean_nonzero program~x3d2_poisson_solver->proc~warn_if_rhs_mean_nonzero none~init~2->proc~get_dims none~init~2->proc~log_info cudagetdevicecount cudagetdevicecount none~init~2->cudagetdevicecount cudasetdevice cudasetdevice none~init~2->cudasetdevice mpi_comm_rank mpi_comm_rank none~init~2->mpi_comm_rank omp_get_num_devices omp_get_num_devices none~init~2->omp_get_num_devices omp_set_default_device omp_set_default_device none~init~2->omp_set_default_device proc~abort_run m_logger::abort_run none~init~2->proc~abort_run proc~check_cuda m_cuda_errors::check_cuda none~init~2->proc~check_cuda proc~allocate_tdsops->interface~str none~get_n m_mesh::mesh_t%get_n proc~allocate_tdsops->none~get_n proc~alloc_tdsops_base m_base_backend::base_backend_t%alloc_tdsops_base proc~allocate_tdsops->proc~alloc_tdsops_base proc~log_warn m_logger::log_warn proc~allocate_tdsops->proc~log_warn proc~get_coordinates m_mesh::mesh_t%get_coordinates proc~fill_rhs->proc~get_coordinates proc~create_block m_allocator::allocator_t%create_block proc~get_block->proc~create_block proc~set_shape m_field::field_t%set_shape proc~get_block->proc~set_shape proc~get_dims_dataloc m_mesh::get_dims_dataloc proc~get_dims->proc~get_dims_dataloc proc~init_poisson_fft_base->proc~abort_run proc~log_info->interface~str proc~log_info->mpi_comm_size proc~log_info->mpi_comm_rank mpi_finalized mpi_finalized proc~log_info->mpi_finalized mpi_initialized mpi_initialized proc~log_info->mpi_initialized proc~usage_error x3d2_poisson_solver::usage_error proc~parse_arguments->proc~usage_error proc~set_field_data->proc~get_block proc~set_field_data->proc~release_block proc~copy_data_to_f_base m_base_backend::base_backend_t%copy_data_to_f_base proc~set_field_data->proc~copy_data_to_f_base proc~get_rdr_from_dirs m_common::get_rdr_from_dirs proc~set_field_data->proc~get_rdr_from_dirs proc~reorder_base m_base_backend::base_backend_t%reorder_base proc~set_field_data->proc~reorder_base proc~sync_base->proc~abort_run proc~warn_if_rhs_mean_nonzero->interface~str proc~warn_if_rhs_mean_nonzero->mpi_allreduce proc~get_global_dims m_mesh::mesh_t%get_global_dims proc~warn_if_rhs_mean_nonzero->proc~get_global_dims proc~warn_if_rhs_mean_nonzero->proc~log_warn proc~get_n_dir m_mesh::mesh_t%get_n_dir none~get_n->proc~get_n_dir proc~get_n_phi m_mesh::mesh_t%get_n_phi none~get_n->proc~get_n_phi proc~abort_run->interface~str proc~abort_run->mpi_barrier proc~abort_run->mpi_comm_size proc~abort_run->mpi_comm_rank proc~abort_run->mpi_finalized proc~abort_run->mpi_initialized mpi_abort mpi_abort proc~abort_run->mpi_abort proc~alloc_tdsops_base->proc~abort_run proc~check_cuda->interface~str proc~check_cuda->proc~abort_run cudageterrorstring cudageterrorstring proc~check_cuda->cudageterrorstring proc~copy_data_to_f_base->proc~abort_run proc~get_global_dims->proc~get_dims_dataloc proc~log_warn->interface~str proc~log_warn->mpi_comm_size proc~log_warn->mpi_comm_rank proc~log_warn->mpi_finalized proc~log_warn->mpi_initialized proc~reorder_base->proc~abort_run proc~usage_error->proc~abort_run proc~get_n_phi->none~get_n

Variables

Type Attributes Name Initial
integer, parameter :: N_WAVE = 2
class(base_backend_t), pointer :: backend
class(allocator_t), pointer :: allocator
type(allocator_t), pointer :: host_allocator
type(mesh_t), target :: mesh
type(dirps_t) :: xdirps
type(dirps_t) :: ydirps
type(dirps_t) :: zdirps
type(backend_setup_t), target :: setup
integer :: dims_global(3)
integer :: nproc_dir(3)
integer :: dims(3)
integer :: nproc
integer :: ierr
real(kind=dp) :: L_global(3)
character(len=9) :: bc_x_name
character(len=9) :: bc_y_name
character(len=9) :: bc_z_name
character(len=9) :: BC_x(2)
character(len=9) :: BC_y(2)
character(len=9) :: BC_z(2)
integer :: repeat_count
integer :: irep
double precision :: t0
double precision :: t1
real(kind=dp) :: elapsed
real(kind=dp) :: min_time
real(kind=dp) :: sum_time
real(kind=dp) :: n_pi
class(field_t), pointer :: f_device
class(field_t), pointer :: temp
class(field_t), pointer :: host_field

Subroutines

subroutine parse_arguments()

Read nx ny nz, then the optional bc_x bc_y bc_z, then the optional --repeat N. The bc values are periodic or dirichlet. The default is periodic. The default for --repeat is 1. Any other input prints one usage line and stops.

Arguments

None

subroutine usage_error()

Arguments

None

subroutine fill_rhs(host_field)

Fill host_field with the right-hand side of the Poisson equation. The routine uses the host-associated mesh, dims and n_pi. Edit this routine to supply another right-hand side, then rebuild. The coordinates are the cell centres from mesh%get_coordinates(i, j, k, CELL). The right-hand side must have zero mean. In every supported combination of boundary conditions, the pressure has periodic or homogeneous Neumann conditions. The default is cos(2 pi x).

Arguments

Type IntentOptional Attributes Name
class(field_t), intent(inout) :: host_field

subroutine warn_if_rhs_mean_nonzero(host_field)

Warn on rank 0 if the right-hand side does not have zero mean. The solver needs a zero-mean right-hand side for these boundary conditions. It discards the mean component. The solve runs in both cases.

Arguments

Type IntentOptional Attributes Name
class(field_t), intent(in) :: host_field