MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_ib_patches Module Reference

Allocate memory and read initial condition data for IC extrusion. More...

Functions/Subroutines

impure subroutine, public s_apply_ib_patches (ib_markers)
 Apply all immersed boundary patch geometries to mark interior cells in the IB marker array.
subroutine s_apply_ib_patches_grid_cell_parallelism (ib_markers)
subroutine s_apply_ib_patches_ib_parallelism (ib_markers)
subroutine, public s_initialize_ib_airfoils ()
 Initialize the NACA surface grids for all airfoil IB patches. Must be called after the grid is established (so dx is valid) and before s_apply_ib_patches or s_apply_levelset.
subroutine, public s_update_ib_rotation_matrix (patch_id)
 Compute a rotation matrix for converting to the rotating frame of the boundary.
subroutine, public s_get_ib_bound (patch, bound)
subroutine s_get_bounding_indices (patch, center, il, ir, jl, jr, kl, kr)
subroutine get_indices_from_bounds (left_bound, right_bound, cell_centers, left_index, right_index)
subroutine, public s_encode_patch_periodicity (patch_id, x_periodicity, y_periodicity, z_periodicity, encoded_patch_id)
 Encode the patch ID with a unique offset containing periodicity information.
subroutine, public s_decode_patch_periodicity (encoded_patch_id, patch_id, x_periodicity, y_periodicity, z_periodicity)
 Decode the encoded ID to recover the original patch ID and periodicity.
subroutine, public s_get_neighborhood_idx (gbl_idx, neighborhood_idx, num_entries)
 binary search to retrieve the local IB patch index using the global index
subroutine, public s_update_ib_lookup ()
 Completely rebuilds the ib lookup map, used at startup.
subroutine, public s_compact_ib_lookup (old_to_new, num_ibs_old)
 Drop the entries whose patches left the neighborhood and renumber the survivors onto the patch_ib slots they were compacted into. Keys are never reordered, so the map stays sorted for free and only the values move: O(num_ibs_old) against re-sorting the whole map.
subroutine, public s_merge_ib_lookup (num_ibs_pre)
 Fold patch_ib(num_ibs_pre+1:num_ibs) into the map: sort just the arrivals, then merge the two sorted runs downward from the top. O(num_ibs) plus the sort of the few arrivals. They are copied out first because the runs share this array and merging in place would overwrite entries still to be read.
subroutine, public s_get_periodicities (xp_lower, xp_upper, yp_lower, yp_upper, zp_lower, zp_upper)
 Determine the periodic wrapping bounds in each direction.
pure elemental real(wp) function f_r (myth, offset, a)
 Archimedes spiral function.

Variables

integer, dimension(num_ib_patches_max_namelist) ib_lookup_keys
 lookup arrays for converting global IB indices to local indices
integer, dimension(num_ib_patches_max_namelist) ib_lookup_vals
integer, dimension(num_ib_patches_max_namelist) ib_new_keys
 Holds each step's arrivals while they are sorted and merged in. Host only.
integer, dimension(num_ib_patches_max_namelist) ib_new_vals

Detailed Description

Allocate memory and read initial condition data for IC extrusion.

This macro handles the complete initialization process for IC extrusion by:

Memory Allocation:

  • stored_values(xRows, yRows, sys_size) - stores primitive variable data from files
  • x_coords(nrows) - stores x-coordinates from input files
  • y_coords(nrows) - stores y-coordinates from input files (3D case only)

File Reading Operations:

  • Reads primitive variable data from multiple files with pattern: prim.<file_number>.00.<file_extension>.dat
  • Files are read from directory specified by files_dir parameter
  • Supports 1D, 2D, and 3D computational domains

Grid Structure Detection:

  • 1D/2D: Counts lines in first file to determine xRows
  • 3D: Analyzes coordinate patterns to determine xRows and yRows structure

MPI Domain Mapping:

  • Calculates global_offset_x and global_offset_y for MPI subdomain positioning
  • Maps file coordinates to local computational grid coordinates

Data Assignment:

  • Populates q_prim_vf primitive variable arrays with file data
  • Handles momentum component indexing with special treatment for eqn_idxmomend
  • Sets eqn_idxmomend component to zero for 2D/3D cases

State Management:

  • Uses files_loaded flag to prevent redundant file operations
  • Preserves data across multiple macro calls within same simulation
Note
File pattern timestep field is controlled by the file_extension parameter
Directory path is set via the files_dir parameter
Warning
Aborts execution if file reading errors occur.

Immersed boundary patch geometry constructors for 2D and 3D shapes

Function/Subroutine Documentation

◆ f_r()

pure elemental real(wp) function m_ib_patches::f_r ( real(wp), intent(in) myth,
real(wp), intent(in) offset,
real(wp), intent(in) a )

Archimedes spiral function.

Definition at line 1833 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_indices_from_bounds()

subroutine m_ib_patches::get_indices_from_bounds ( real(wp), intent(in) left_bound,
real(wp), intent(in) right_bound,
real(wp), dimension(-buff_size:), intent(in) cell_centers,
integer, intent(inout) left_index,
integer, intent(inout) right_index )

Definition at line 1471 of file m_ib_patches.fpp.f90.

Here is the caller graph for this function:

◆ s_apply_ib_patches()

impure subroutine, public m_ib_patches::s_apply_ib_patches ( type(integer_field), intent(inout) ib_markers)

Apply all immersed boundary patch geometries to mark interior cells in the IB marker array.

Definition at line 464 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:

◆ s_apply_ib_patches_grid_cell_parallelism()

subroutine m_ib_patches::s_apply_ib_patches_grid_cell_parallelism ( type(integer_field), intent(inout) ib_markers)

Definition at line 476 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_apply_ib_patches_ib_parallelism()

subroutine m_ib_patches::s_apply_ib_patches_ib_parallelism ( type(integer_field), intent(inout) ib_markers)

Definition at line 705 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_compact_ib_lookup()

subroutine, public m_ib_patches::s_compact_ib_lookup ( integer, dimension(:), intent(in) old_to_new,
integer, intent(in) num_ibs_old )

Drop the entries whose patches left the neighborhood and renumber the survivors onto the patch_ib slots they were compacted into. Keys are never reordered, so the map stays sorted for free and only the values move: O(num_ibs_old) against re-sorting the whole map.

Parameters
[in]old_to_newold patch_ib slot -> new slot, -1 if dropped

Definition at line 1686 of file m_ib_patches.fpp.f90.

◆ s_decode_patch_periodicity()

subroutine, public m_ib_patches::s_decode_patch_periodicity ( integer, intent(in) encoded_patch_id,
integer, intent(out) patch_id,
integer, intent(out), optional x_periodicity,
integer, intent(out), optional y_periodicity,
integer, intent(out), optional z_periodicity )

Decode the encoded ID to recover the original patch ID and periodicity.

Definition at line 1563 of file m_ib_patches.fpp.f90.

◆ s_encode_patch_periodicity()

subroutine, public m_ib_patches::s_encode_patch_periodicity ( integer, intent(in) patch_id,
integer, intent(in) x_periodicity,
integer, intent(in) y_periodicity,
integer, intent(in) z_periodicity,
integer, intent(out) encoded_patch_id )

Encode the patch ID with a unique offset containing periodicity information.

Definition at line 1528 of file m_ib_patches.fpp.f90.

Here is the caller graph for this function:

◆ s_get_bounding_indices()

subroutine m_ib_patches::s_get_bounding_indices ( type(ib_patch_parameters), intent(in) patch,
real(wp), dimension(3), intent(in) center,
integer, intent(out) il,
integer, intent(out) ir,
integer, intent(out) jl,
integer, intent(out) jr,
integer, intent(out) kl,
integer, intent(out) kr )

Definition at line 1362 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_get_ib_bound()

subroutine, public m_ib_patches::s_get_ib_bound ( type(ib_patch_parameters), intent(in) patch,
real(wp), intent(out) bound )

Definition at line 1300 of file m_ib_patches.fpp.f90.

Here is the caller graph for this function:

◆ s_get_neighborhood_idx()

subroutine, public m_ib_patches::s_get_neighborhood_idx ( integer, intent(in) gbl_idx,
integer, intent(out) neighborhood_idx,
integer, intent(in), optional num_entries )

binary search to retrieve the local IB patch index using the global index

Definition at line 1607 of file m_ib_patches.fpp.f90.

◆ s_get_periodicities()

subroutine, public m_ib_patches::s_get_periodicities ( integer, intent(out) xp_lower,
integer, intent(out) xp_upper,
integer, intent(out) yp_lower,
integer, intent(out) yp_upper,
integer, intent(out), optional zp_lower,
integer, intent(out), optional zp_upper )

Determine the periodic wrapping bounds in each direction.

Definition at line 1777 of file m_ib_patches.fpp.f90.

Here is the caller graph for this function:

◆ s_initialize_ib_airfoils()

subroutine, public m_ib_patches::s_initialize_ib_airfoils

Initialize the NACA surface grids for all airfoil IB patches. Must be called after the grid is established (so dx is valid) and before s_apply_ib_patches or s_apply_levelset.

Definition at line 1057 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_merge_ib_lookup()

subroutine, public m_ib_patches::s_merge_ib_lookup ( integer, intent(in) num_ibs_pre)

Fold patch_ib(num_ibs_pre+1:num_ibs) into the map: sort just the arrivals, then merge the two sorted runs downward from the top. O(num_ibs) plus the sort of the few arrivals. They are copied out first because the runs share this array and merging in place would overwrite entries still to be read.

Definition at line 1726 of file m_ib_patches.fpp.f90.

◆ s_update_ib_lookup()

subroutine, public m_ib_patches::s_update_ib_lookup

Completely rebuilds the ib lookup map, used at startup.

Definition at line 1651 of file m_ib_patches.fpp.f90.

◆ s_update_ib_rotation_matrix()

subroutine, public m_ib_patches::s_update_ib_rotation_matrix ( integer, intent(in) patch_id)

Compute a rotation matrix for converting to the rotating frame of the boundary.

Definition at line 1239 of file m_ib_patches.fpp.f90.

Variable Documentation

◆ ib_lookup_keys

integer, dimension(num_ib_patches_max_namelist) m_ib_patches::ib_lookup_keys

lookup arrays for converting global IB indices to local indices

Definition at line 444 of file m_ib_patches.fpp.f90.

◆ ib_lookup_vals

integer, dimension(num_ib_patches_max_namelist) m_ib_patches::ib_lookup_vals

Definition at line 444 of file m_ib_patches.fpp.f90.

◆ ib_new_keys

integer, dimension(num_ib_patches_max_namelist) m_ib_patches::ib_new_keys

Holds each step's arrivals while they are sorted and merged in. Host only.

Definition at line 459 of file m_ib_patches.fpp.f90.

◆ ib_new_vals

integer, dimension(num_ib_patches_max_namelist) m_ib_patches::ib_new_vals

Definition at line 459 of file m_ib_patches.fpp.f90.