CPU Specifics¶
cpuserialdiffusion¶
serial_boundaries.c¶
Implementation of boundary condition functions without threading.
Functions

void
apply_initial_conditions
(fp_t **conc_old, const int nx, const int ny, const int nm) Initialize flat composition field with fixed boundary conditions.
The boundary conditions are fixed values of \( c_{hi} \) along the lowerleft half and upperright half walls, no flux everywhere else, with an initial values of \( c_{lo} \) everywhere. These conditions represent a carburizing process, with partial exposure (rather than the entire left and right walls) to produce an inhomogeneous workload and highlight numerical errors at the boundaries.

void
apply_boundary_conditions
(fp_t **conc, const int nx, const int ny, const int nm) Set fixed value \( (c_{hi}) \) along left and bottom, zeroflux elsewhere.
serial_discretization.c¶
Implementation of boundary condition functions without threading.
Functions

void
compute_convolution
(fp_t **const conc_old, fp_t **conc_lap, fp_t **const mask_lap, const int nx, const int ny, const int nm) Perform the convolution of the mask matrix with the composition matrix.
If the convolution mask is the Laplacian stencil, the convolution evaluates the discrete Laplacian of the composition field. Other masks are possible, for example the Sobel filters for edge detection. This function is general purpose: as long as the dimensions nx, ny, and nm are properly specified, the convolution will be correctly computed.
cpuopenmpdiffusion¶
openmp_boundaries.c¶
Implementation of boundary condition functions with OpenMP threading.
Functions

void
apply_initial_conditions
(fp_t **conc_old, const int nx, const int ny, const int nm) Initialize flat composition field with fixed boundary conditions.
The boundary conditions are fixed values of \( c_{hi} \) along the lowerleft half and upperright half walls, no flux everywhere else, with an initial values of \( c_{lo} \) everywhere. These conditions represent a carburizing process, with partial exposure (rather than the entire left and right walls) to produce an inhomogeneous workload and highlight numerical errors at the boundaries.

void
apply_boundary_conditions
(fp_t **conc, const int nx, const int ny, const int nm) Set fixed value \( (c_{hi}) \) along left and bottom, zeroflux elsewhere.
openmp_discretization.c¶
Implementation of boundary condition functions with OpenMP threading.
Functions

void
compute_convolution
(fp_t **const conc_old, fp_t **conc_lap, fp_t **const mask_lap, const int nx, const int ny, const int nm) Perform the convolution of the mask matrix with the composition matrix.
If the convolution mask is the Laplacian stencil, the convolution evaluates the discrete Laplacian of the composition field. Other masks are possible, for example the Sobel filters for edge detection. This function is general purpose: as long as the dimensions nx, ny, and nm are properly specified, the convolution will be correctly computed.
cputbbdiffusion¶
tbb_boundaries.cpp¶
Implementation of boundary condition functions with TBB threading.
Functions

void
apply_initial_conditions
(fp_t **conc_old, const int nx, const int ny, const int nm) Initialize flat composition field with fixed boundary conditions.
The boundary conditions are fixed values of \( c_{hi} \) along the lowerleft half and upperright half walls, no flux everywhere else, with an initial values of \( c_{lo} \) everywhere. These conditions represent a carburizing process, with partial exposure (rather than the entire left and right walls) to produce an inhomogeneous workload and highlight numerical errors at the boundaries.

void
apply_boundary_conditions
(fp_t **conc, const int nx, const int ny, const int nm) Set fixed value \( (c_{hi}) \) along left and bottom, zeroflux elsewhere.
tbb_discretization.cpp¶
Implementation of boundary condition functions with TBB threading.
Functions

void
compute_convolution
(fp_t **const conc_old, fp_t **conc_lap, fp_t **const mask_lap, const int nx, const int ny, const int nm) Perform the convolution of the mask matrix with the composition matrix.
If the convolution mask is the Laplacian stencil, the convolution evaluates the discrete Laplacian of the composition field. Other masks are possible, for example the Sobel filters for edge detection. This function is general purpose: as long as the dimensions nx, ny, and nm are properly specified, the convolution will be correctly computed.