List of Functions by File¶
This page contains a complete list of all the functions contained in the files for the FSD plugin, with a brief summary of what each function does. More detailed descriptions are provided in the code itself. The files are grouped in the same way as in Summary of Plugin Files.
Deterministic Hydrodynamics¶
Lubrication.cu
¶
Lubrication_RFU_kernel
- CUDA kernel for multiplication of the near-field force-translation (FU) resistance tensor by a vector,.
Lubrication_RFE_kernel
- CUDA kernel for multiplication of the near-field force-rate-of-strain (FE) resistance tensor by a vector,.
Lubrication_RSU_kernel
- CUDA kernel for multiplication of the near-field stresslet-translation (SU) resistance tensor by a vector,.
Lubrication_RSE_kernel
- CUDA kernel for multiplication of the near-field stresslet-rate-of-strain (SE) resistance tensor by a vector,.
Mobility.cu
¶
Mobility_MobilityUD
- Wrapper function to drive the kernels for the far-field mobility multiplication (velocity is in units of translational velocity, angular velocity, rate of strain, and the force is in units of force, torque, and stresslet),
Mobility_RealSpace_kernel
- CUDA kernel for the multiplication of the real space mobility tensor by force and couplet (provides velocity in terms of translation velocity and velocity gradient),
Mobility_RealSpaceFTS
- Wrapper function to drive the kernels for the real space contribution to the far-field mobility tensor by the force, torque, and stresslet. Provides velocity in terms of the translational velocity, angular velocity, and rate of strain.
Mobility_WaveSpace_Spread_kernel
- CUDA kernel to perform the spreading part of the NUFFT quadrature operations,.
Mobility_WaveSpace_Green_kernel
- CUDA kernel to map Fourier space force moments to Fourier space velocity moments,.
Mobility_WaveSpace_ContractU
- CUDA kernel to perform the contraction part of the NUFFT quadrature operations for the linear velocity,.
Mobility_WaveSpace_ContractD
- CUDA kernel to perform the contraction part of the NUFFT quadrature operations for the velocity gradient,.
Mobility_GeneralizedMobility
- Wrapper function to drive kernels to compute the product of the far-field mobility tensor with the generalized force (force and torque) and stresslet,
Saddle.cu
¶
Saddle_Multiply
- Wrapper function to drive the kernels to compute the product of the hydrodynamic saddle point tensor with a vector,
Saddle_Preconditioner
- Wrapper function to drive the kernels to compute the product of the inverse of the saddle point preconditioner with a vector,,
Solvers.cu
¶
Solvers_Saddle
- Wrapper function to drive the kernels to construct the saddle point matrix and its preconditioner, then compute the product of the inverse of the saddle point matrix with a vector using GMRES (implemented in CUSP),
Wrappers.cuh
¶
cuspSaddle
- C++ wrapper to define the saddle point matrix as a matrix-free method in CUSP.cuspSaddlePreconditioner
- C++ wrapper to define the saddle point preconditioner as a matrix-free method in CUSP.
Brownian Sampling¶
Brownian_FarField.cu
¶
Brownian_FarField_RNG_Particle_kernel
- CUDA kernel to generate random vector on particles for the real-space far-field stochastic displacement,.
Brownian_FarField_RNG_Grid1of2_kernel
- CUDA kernel to generate random vector on force density FFT grid with appropriate conjugacy dependencies,.
Brownian_FarField_RNG_Grid2of2_kernel
- CUDA kernel to compute the product of the square root of the wave space far-field mobility tensor with the random force density computed byBrownian_FarField_RNG_Grid1of2_kernel
and add directly to the wave space grid of the FFT’ed force moments,.
Brownian_FarField_Lanczos
- Wrapper function to drive kernels to perform the Krylov subspace (Lanczos) method to compute the real space far-field stochastic displacements,.
Brownian_FarField_SlipVelocity
- Wrapper function to drive all kernels to compute the total far-field slip velocity. Includes calls to the previous 5 functions,.
Brownian_NearField.cu
¶
Brownian_NearField_RNG_kernel
- CUDA kernel to generate random vector on particles for the near-field Brownian force,.
Brownian_NearField_Lanczos
- Wrapper funtion to drive the kernels to perform the Krylov subpsace (Lanczos) method to approximate the action of the square root of the near-field resistance tensor,.
Brownian_NearField_Force
- Wrapper function to generate the near-field Brownian force,. Includes calls to the previous 2 functions.
Integrator.cu
¶
Integrator_ExplicitEuler_kernel
- CUDA kernel to perform explicit Euler integration of particle coordinates given a set of velocities,.
Integrator_ExplicitEuler_Shear_kernel
- CUDA kernel to perform explicit Euler integration of particle coordiantes given a set of velocities and linear shear rate,.
Integrator_RFD
- Wrapper function to drive kernels to evaluate the random finite differences to approximate the mean drift of the Brownian displacement and stresslet,.
Integrator_ComputeVelocity
- Wrapper function to drive kernels to evaluate the particle velocities due to deterministic and stochastic forces,.
Preconditioning¶
Precondition.cu
¶
Precondition_GetPrunedNneigh_kernel
- CUDA kernel to compute the number of neighbors for each particle within the preconditioner cutoff,.
Precondition_GetPrunedNlist_kernel
- CUDA kernel to compute the list of neighbors for each particle within the preconditioner cutoff,.
Precondition_PruneNeighborList
- Wrapper function to drive the previous two kernels to compute the pruned neighborlist of particles within the preconditioner cutoff from the global neighborlist.Precondition_NEPP_kernel
- CUDA kernel to compute the number of non-zero entries per particle (NEPP) contributed by each particle to the sparse storage structure of the near-field resistance tensor approximation,Precondition_HasNeigh_kernel
- CUDA kernel to compute whether a particle has neighbors.Precondition_PreProcess
- Wrapper function to drive the kernels required to set up the preconditioner.Precondition_RFU_kernel
- CUDA kernel to compute each particle’s entry to the near-field resistance tensor preconditioner.Precondition_Build
- Wrapper function to drive kernels to build the Schur complement approximation,.
Precondition_Reorder
- Wrapper function to compute and perform the reverse Cuthill-McKee reordering on the near-field resistance preconditioner,.
Precondition_IChol
- Wrapper function to drive kernels to evaluate the incomplete Cholesky factorization of the near-field resistance preconditioner,.
Precondition_Wrap
- Wrapper function to drive all functions and kernels to build the preconditioner.Precondition_Brownian_RFUmultiply
- Wrapper function to compute the product of the preconditioned near-field resistance tensor with a vector,.
Precondition_Brownian_Undo
- Wrapper function to drive the kernels to “undo” the preconditioner after the preconditioned near-field Brownian sampling. Returns near-field Brownian force with the proper variance,.
Precondition_Saddle_RFUmultiply
- Wrapper function to drive the kernels to compute the product of the inverse of the preconditioner Schur complement approaximation with a vector,
rcm.cpp
¶
genrcm
- John Burkardt’s function to compute the reverse Cuthill-McKee (RCM) reordering of a matrix based on the adjacency list. In this case, the adjacency list is exactly the particle neighborlist.
Helper Functions¶
Helper_Brownian.cu
¶
Brownian_FarField_Dot1of2_kernel
- CUDA kernel to compute the first set of dot product of two vectors. In particular, the vectors are strided by 4 (float4) and only the first three elements of each block of 4 need to be multiplied.Brownian_FarField_Dot2of2_kernel
- CUDA kernel to finish the reduction required to compute the dot product of two vectors.Brownian_FarField_LanczosMatrixMultiply_kernel
- CUDA kernel to multiply the Krylov basis set by a vector for the far-field real space Brownian sampling.Brownian_NearField_LanczosMatrixMultiply_kernel
- CUDA kernel to multiply the Krylov basis set by a vector for the near-field Brownian sampling.Brownian_FarField_AddGrids_kernel
- CUDA kernel to add the quantities on two FFT grids together.Brownian_Farfield_LinearCombinationFTS_kernel
- CUDA kernel to add two arrays ordered as particle force, torque, and stresslet together.Brownian_Sqrt
- Wrapper function to drive the calculations of the tri-diagonal square root required of the Lanczos iterations.
Helper_Integrator.cu
¶
Integrator_RFD_RandDisp_kernel
- CUDA kernel to compute the random displacemented required for random finite differences.Integrator_ZeroVelocity_kernel
- CUDA kernel to set the particle velocities to zero.
Helper_Mobility.cu
¶
Mobility_ZeroGrid_kernel
- CUDA kernel to set the values on the FFT grids to zero.Mobility_LinearCombination_kernel
- CUDA kernel to add two vectors together. In thise case, the vectors are strided by 4 (float4) and only the first three elements of each block of 4 need to be added.Mobility_Add4_kernel
- CUDA kernel to add all elements of two float4 arrays together.Mobility_TS2C_kernel
- CUDA kernel to map the particle torque and stress into the particle couplet.Mobility_D2WE_kernel
- CUDA kernel to map the particle velocity gradient into the angular velocity and rate of strain.Mobility_SetGridk_kernel
- CUDA kernel to compute the wave-vectors associated with the (potentially deformed) FFT grid given a strain rate.
Helper_Precondition.cu
¶
Precondition_ZeroVector_kernel
- CUDA kernel to set a vector to zero.Precondition_ApplyRCM_Vector_kernel
- CUDA kernel to apply the reverse Cuthill-McKee permutation to a vector.Precondition_AddInt_kernel
- CUDA kernel to add two integer arrays together.Precondition_AddIdentity_kernel
- CUDA kernel to add identity to the sparse representation of the near-field preconditioner.Precondition_Inn_kernel
- CUDA kernel to compute the effect of the modified identity tensoron a vector,
.
Precondition_ImInn_kernel
- CUDA kernel to zero the entries associated with the modified identity tensor,
.
Precondition_ExpandPRCM_kernel
- CUDA kernel to expand the RCM reordering from particle arrays (1 entry per particle) to the generalized force array (6 entries per particle),.
Precondition_InitializeMap_kernel
- CUDA kernel to initialize the map required by cuSPARSE to apply a reordering vector to CSR matrix format.Precondition_Map_kernel
- CUDA kernel to apply the reordering map to the CSR matrix format.Precondition_GetDiags_kernel
- CUDA kernel to get the diagonal elements of the near-field resistance preconditioner.Precondition_DiagMult_kernel
- CUDA kernel to evaluate the diagonal preconditioner multiplication.Precondition_ZeroUpperTriangle_kernel
- CUDA kernel to zero the storage associated with the upper right triangular block of the incomplete Cholesky factor. cuSPARSE doesn’t automatically zero these entries, so without this kernel the matrix-vector multiplies of the incomplete Cholesky factor are wrong.Precondition_Lmult_kernel
- CUDA kernel to evaluate the matrix-vector product of a lower triangular matrix with a vector,.
Helper_Saddle.cu
¶
Saddle_ZeroOutput_kernel
- CUDA kernel to zero an array of size 17N, where N is the number of particles.Saddle_AddFloat_kernel
- CUDA kernel to add float arrays with a given striding.Saddle_SplitGeneralizedF_kernel
- CUDA kernel to reorder the generalized particle force (force and torque) and stresslet into the force, torque, and stresslet.Saddle_MakeGeneralizedU_kernel
- CUDA kernel to reorder the angular velocity and rate of strain into the rigid body generalized velocity.Saddle_force2rhs_kernel
- CUDA kernel to add a specified force to the right-hand side of the saddle point equation.Saddle_solution2vel_kernel
- CUDA kernel to map the solution to project the generalized rigid body velocities out of the saddle point solution.
Helper_Stokes.cu
¶
Stokes_SetForce_kernel
- CUDA kernel to initialize the general force (force and torque) from the HOOMD list of particle forces.Stokes_SetVelocity_kernel
- CUDA kernel to set the HOOMD particle velocity array from the saddle pint solution.
C++ Module Definition¶
Stokes.cc
¶
Stokes::Stokes
- Constructor for the Stokes class.Stokes::~Stokes
- Destructor for the Stokes class.Stokes::setParams
- Function to initialize far-field calculation paramters (real space resistance functions, FFT grid sizes, etc.)Stokes::OutputData
- Function to write out the hydrodynamic stresslet.Stokes::AllocateWorkSpaces
- Function to allocate memory for arrays to use in all calculations.Stokes::FreeWorkSpace
- Function to free all memory allocated byStokes::AllocateWorkSpaces
.Stokes::integrateStepOne
- Function to call the CUDA kernels to performed overdamped integration of particle coordinates.Stokes::integrateStepTwo
- Null function. Required for HOOMD two-step integrators, but overdamped integration only required StepOne.export_Stokes
- Function to export to the Stokes C++ class for visiblity in python.
Stokes.cu
¶
Stokes_StepOne
- CUDA code to perform the overdamped integration. Called byStokes.cc
.
Stokes_ResistanceTable.cc
¶
Stokes::setResistanceTable
- Function to initialize the entries in the tabulation of the near-field resistance tensors of Jeffrey and Onishi. Hard-coded using MATLAB.
Stokes_SparseMath.cc
¶
Stokes::setSparseMath
- Function to initialize all arrays and handles required for the sparse storage of the near-field preconditioner and use cuSPARSE on sparse matrix formats.
Linear Shear¶
ShearFunction.cc
¶
export_ShearFunction
- Function to export the ShearFunction class for visibility in python.
ShearFunction.h
¶
getShearRate
- Function to get the shear rate for a given shear function.getStrain
- Function to get the strain for a given shear function.getOffset
- Function to get the shear offset, i.e. when to start shearing.
ShearFunctionWrap.cc
¶
export_ShearFunctionWrap
- Function to export the ShearFunctionWrap class for visiblity in python.
ShearFunctionWrap.h
¶
getShearRate
- Function to get the shear rate for a given shear function.getStrain
- Function to get the strain for a given shear function.getOffset
- Function to get the shear offset, i.e. when to start shearing.
SpecificShearFunction.cc
¶
export_SpecificShearFunction
- Function to export the SpecificShearFunction class for visibility in python.
SpecificShearFunction.h
¶
SinShearFunction
- Function defining sinusoidal shear.SteadyShearFunction
- Function defining steady shear.ChirpShearFunction
- Function defining chirp shear.TukeyWindowFunction
- Function defining Tukey window for chirp shear.WindowedFunction
- Function defining windowed shear.
VariantShearFunction.cc
¶
VariantShearFunction::VariantShearFunction
- Function to define shear functions as variants for box resizing.VariantShearFunction::getValue
- Function to return strain at a given time step.export_VariantShearFunction
- Function to export VariantShearFunction class for visibility in python.
Class Definitions for Python¶
integrate.py
¶
__init__
- Function to initialize the simulation class in python.set_params
- Function to initialize simulation parameters (calls C++ function of same name)stop_shear
- Function to turn off shearing.
shear_function.py
¶
_shear_function
- Python definition of shear function class (calls C++ function of same name).steady
- Python definition of steady shear function (calls C++ function of same name).sine
- Python definition of sinusoidal shear function (calls C++ function of same name).chirp
- Python definition of chirp shear function (calls C++ function of same name).tukey_window
- Python definition of tukey window (calls C++ function of same name).windowed
- Python definition of windowed shear function (calls C++ function of same name).
variant.py
¶
shear_variant
- Python definition of variant shear function (calls C++ function of same name).