libstokes contains functions to solve resistance and mobility problems under the periodic boundary condition with F, FT, and FTS versions for full 3D as well as semi-2D (monolayer) configurations. For each of them, there are two functions, with or without lubrication correction. For mobility problem, also fixed particles can be handled.
(Please look at RYUON-stokes package how to use libstokes.)
please visit File Releases @ SF.
In the following, function prototypes provided by "libstokes.h" are given.
(Please look at RYUON-stokes package how to use libstokes.)
/*********************************** ** resistance problems ** ***********************************/ /* solve natural resistance problem in F version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * OUTPUT * f [np * 3] : */ void solve_res_ewald_3f (struct stokes * sys, const double *u, double *f); /* solve natural resistance problem with lubrication * in F version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * OUTPUT * f [np * 3] : */ void solve_res_lub_ewald_3f (struct stokes * sys, const double *u, double *f); /* solve natural resistance problem in F version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * OUTPUT * f [np * 3] : */ void solve_res_ewald_3f_matrix (struct stokes * sys, const double *u, double *f); /* solve natural resistance problem in F version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * OUTPUT * f [np * 3] : */ void solve_res_lub_ewald_3f_matrix (struct stokes * sys, const double *u, double *f); /* solve natural resistance problem in FT version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * o [np * 3] : * OUTPUT * f [np * 3] : * t [np * 3] : */ void solve_res_ewald_3ft (struct stokes * sys, const double *u, const double *o, double *f, double *t); /* solve natural resistance problem with lubrication * in FT version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * o [np * 3] : * OUTPUT * f [np * 3] : * t [np * 3] : */ void solve_res_lub_ewald_3ft (struct stokes * sys, const double *u, const double *o, double *f, double *t); /* solve natural resistance problem in FT version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * o [np * 3] : * OUTPUT * f [np * 3] : * t [np * 3] : */ void solve_res_ewald_3ft_matrix (struct stokes * sys, const double *u, const double *o, double *f, double *t); /* solve natural resistance problem in FT version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * o [np * 3] : * OUTPUT * f [np * 3] : * t [np * 3] : */ void solve_res_lub_ewald_3ft_matrix (struct stokes * sys, const double *u, const double *o, double *f, double *t); /* solve natural resistance problem in FTS version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * o [np * 3] : * e [np * 5] : * OUTPUT * f [np * 3] : * t [np * 3] : * s [np * 5] : */ void solve_res_ewald_3fts (struct stokes * sys, const double *u, const double *o, const double *e, double *f, double *t, double *s); /* solve natural resistance problem with lubrication * in FTS version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * o [np * 3] : * e [np * 5] : * OUTPUT * f [np * 3] : * t [np * 3] : * s [np * 5] : */ void solve_res_lub_ewald_3fts (struct stokes * sys, const double *u, const double *o, const double *e, double *f, double *t, double *s); /* solve natural resistance problem in FTS version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * o [np * 3] : * e [np * 5] : * OUTPUT * f [np * 3] : * t [np * 3] : * s [np * 5] : */ void solve_res_ewald_3fts_matrix (struct stokes * sys, const double *u, const double *o, const double *e, double *f, double *t, double *s); /* solve natural resistance problem in FTS version under Ewald sum * INPUT * sys : system parameters * u [np * 3] : * o [np * 3] : * e [np * 5] : * OUTPUT * f [np * 3] : * t [np * 3] : * s [np * 5] : */ void solve_res_lub_ewald_3fts_matrix (struct stokes * sys, const double *u, const double *o, const double *e, double *f, double *t, double *s); /* solve natural resistance problem in F version under Ewald sum * INPUT * sys : system parameters * u [np * 2] : u_x, u_y are given (and u_z = 0 is assumed) * OUTPUT * f [np * 3] : results are given in 3D form */ void solve_res_ewald_2f (struct stokes * sys, const double *u, double *f); /* solve natural resistance problem with lubrication * in F version under Ewald sum * INPUT * sys : system parameters * u [np * 2] : u_x, u_y are given (and u_z = 0 is assumed) * OUTPUT * f [np * 3] : results are given in 3D form */ void solve_res_lub_ewald_2f (struct stokes * sys, const double *u, double *f); /* solve natural resistance problem in FT version under Ewald sum * INPUT * sys : system parameters * u [np * 2] : u_x, u_y are given (and u_z = 0 is assumed) * o [np * 1] : o_z is given (and o_x = o_y = 0 is assumed) * OUTPUT * f [np * 3] : results are given in 3D form * t [np * 3] : */ void solve_res_ewald_2ft (struct stokes * sys, const double *u, const double *o, double *f, double *t); /* solve natural resistance problem with lubrication * in FT version under Ewald sum * INPUT * sys : system parameters * u [np * 2] : u_x, u_y are given (and u_z = 0 is assumed) * o [np * 1] : o_z is given (and o_x = o_y = 0 is assumed) * OUTPUT * f [np * 3] : results are given in 3D form * t [np * 3] : */ void solve_res_lub_ewald_2ft (struct stokes * sys, const double *u, const double *o, double *f, double *t); /* solve natural resistance problem in FTS version under Ewald sum * INPUT * sys : system parameters * u [np * 2] : u_x, u_y are given (and u_z = 0 is assumed) * o [np * 1] : o_z is given (and o_x = o_y = 0 is assumed) * e [np * 2] : e_xx, e_xy are given (e_?z = e_z? = 0 is assumed) * OUTPUT * f [np * 3] : results are given in 3D form * t [np * 3] : * s [np * 5] : */ void solve_res_ewald_2fts (struct stokes * sys, const double *u, const double *o, const double *e, double *f, double *t, double *s); /* solve natural resistance problem with lubrication * in FTS version under Ewald sum * INPUT * sys : system parameters * u [np * 2] : u_x, u_y are given (and u_z = 0 is assumed) * o [np * 1] : o_z is given (and o_x = o_y = 0 is assumed) * e [np * 2] : e_xx, e_xy are given (e_?z = e_z? = 0 is assumed) * OUTPUT * f [np * 3] : results are given in 3D form * t [np * 3] : * s [np * 5] : */ void solve_res_lub_ewald_2fts (struct stokes * sys, const double *u, const double *o, const double *e, double *f, double *t, double *s);
/*********************************** ** mobility problems ** ***********************************/ /* solve natural mobility problem in F version under Ewald sum * INPUT * sys : system parameters * f [np * 3] : * OUTPUT * u [np * 3] : */ void solve_mob_ewald_3f (struct stokes * sys, const double *f, double *u); /* solve natural mobility problem in F version under Ewald sum * INPUT * sys : system parameters * f [np * 3] : * OUTPUT * u [np * 3] : */ void solve_mob_ewald_3f_matrix (struct stokes * sys, const double *f, double *u); /* solve natural mobility problem in F version under Ewald sum * INPUT * sys : system parameters * f [np * 3] : * OUTPUT * u [np * 3] : */ void solve_mob_lub_ewald_3f_matrix (struct stokes * sys, const double *f, double *u); /* solve natural mobility problem in FT version under Ewald sum * INPUT * sys : system parameters * f [np * 3] : * t [np * 3] : * OUTPUT * u [np * 3] : * o [np * 3] : */ void solve_mob_ewald_3ft (struct stokes * sys, const double *f, const double *t, double *u, double *o); /* solve natural mobility problem in FT version under Ewald sum * INPUT * sys : system parameters * f [np * 3] : * t [np * 3] : * OUTPUT * u [np * 3] : * o [np * 3] : */ void solve_mob_ewald_3ft_matrix (struct stokes * sys, const double *f, const double *t, double *u, double *o); /* solve natural mobility problem in FT version under Ewald sum * INPUT * sys : system parameters * f [np * 3] : * t [np * 3] : * OUTPUT * u [np * 3] : * o [np * 3] : */ void solve_mob_lub_ewald_3ft_matrix (struct stokes * sys, const double *f, const double *t, double *u, double *o); /* solve natural mobility problem in FTS version under Ewald sum * INPUT * sys : system parameters * f [np * 3] : * t [np * 3] : * e [np * 5] : * OUTPUT * u [np * 3] : * o [np * 3] : * s [np * 5] : */ void solve_mob_ewald_3fts (struct stokes * sys, const double *f, const double *t, const double *e, double *u, double *o, double *s); /* solve natural mobility problem in FTS version under Ewald sum * INPUT * sys : system parameters * f [np * 3] : * t [np * 3] : * e [np * 5] : * OUTPUT * u [np * 3] : * o [np * 3] : * s [np * 5] : */ void solve_mob_ewald_3fts_matrix (struct stokes * sys, const double *f, const double *t, const double *e, double *u, double *o, double *s); /* solve natural mobility problem in FTS version under Ewald sum * INPUT * sys : system parameters * f [np * 3] : * t [np * 3] : * e [np * 5] : * OUTPUT * u [np * 3] : * o [np * 3] : * s [np * 5] : */ void solve_mob_lub_ewald_3fts_matrix (struct stokes * sys, const double *f, const double *t, const double *e, double *u, double *o, double *s); /* solve natural mobility problem in F version under Ewald sum * sys : system parameters * f [np * 2] : f_x, f_y are given (and f_z = 0 is assumed) * OUTPUT * u [np * 3] : results are given in 3D form */ void solve_mob_ewald_2f (struct stokes * sys, const double *f, double *u); /* solve natural mobility problem in FT version under Ewald sum * sys : system parameters * f [np * 2] : f_x, f_y are given (and f_z = 0 is assumed) * t3 [np * 3] : OK, this is 3D form * OUTPUT * u [np * 3] : results are given in 3D form * o [np * 3] : */ void solve_mob_ewald_2ft (struct stokes * sys, const double *f, const double *t3, double *u, double *o); /* solve natural mobility problem in FTS version under Ewald sum * sys : system parameters * f [np * 2] : f_x, f_y are given (and f_z = 0 is assumed) * t3 [np * 3] : OK, this is 3D form * e [np * 2] : e_xx, e_xy are given (e_?z = e_z? = 0 is assumed) * OUTPUT * u [np * 3] : results are given in 3D form * o [np * 3] : * s [np * 5] : */ void solve_mob_ewald_2fts (struct stokes * sys, const double *f, const double *t3, const double *e, double *u, double *o, double *s);
/*********************************** ** mixed problems ** ***********************************/ /* solve natural mobility problem with fixed particles in F version * under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * uf [nf * 3] : * OUTPUT * u [nm * 3] : * ff [nf * 3] : */ void solve_mix_ewald_3f (struct stokes * sys, const double *f, const double *uf, double *u, double *ff); /* solve natural mobility problem with lubrication * with fixed particles in F version under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * uf [nf * 3] : * OUTPUT * u [nm * 3] : * ff [nf * 3] : */ void solve_mix_lub_ewald_3f (struct stokes * sys, const double *f, const double *uf, double *u, double *ff); /* solve natural mobility problem with lubrication * with fixed particles in FT version under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * t [nm * 3] : * uf [nf * 3] : * of [nf * 3] : * OUTPUT * u [nm * 3] : * o [nm * 3] : * ff [nf * 3] : * tf [nf * 3] : */ void solve_mix_ewald_3f_matrix (struct stokes * sys, const double *f, const double *uf, double *u, double *ff); /* solve natural mobility problem with lubrication * with fixed particles in F version under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * uf [nf * 3] : * OUTPUT * u [nm * 3] : * ff [nf * 3] : */ void solve_mix_lub_ewald_3f_matrix (struct stokes * sys, const double *f, const double *uf, double *u, double *ff); /* solve natural mobility problem with fixed particles in FT version * under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * t [nm * 3] : * uf [nf * 3] : * of [nf * 3] : * OUTPUT * u [nm * 3] : * o [nm * 3] : * ff [nf * 3] : * tf [nf * 3] : */ void solve_mix_ewald_3ft (struct stokes * sys, const double *f, const double *t, const double *uf, const double *of, double *u, double *o, double *ff, double *tf); /* solve natural mobility problem with lubrication * with fixed particles in FT version under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * t [nm * 3] : * uf [nf * 3] : * of [nf * 3] : * OUTPUT * u [nm * 3] : * o [nm * 3] : * ff [nf * 3] : * tf [nf * 3] : */ void solve_mix_lub_ewald_3ft (struct stokes * sys, const double *f, const double *t, const double *uf, const double *of, double *u, double *o, double *ff, double *tf); /* solve natural mobility problem with lubrication * with fixed particles in FT version under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * t [nm * 3] : * uf [nf * 3] : * of [nf * 3] : * OUTPUT * u [nm * 3] : * o [nm * 3] : * ff [nf * 3] : * tf [nf * 3] : */ void solve_mix_ewald_3ft_matrix (struct stokes * sys, const double *f, const double *t, const double *uf, const double *of, double *u, double *o, double *ff, double *tf); /* solve natural mobility problem with lubrication * with fixed particles in FT version under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * t [nm * 3] : * uf [nf * 3] : * of [nf * 3] : * OUTPUT * u [nm * 3] : * o [nm * 3] : * ff [nf * 3] : * tf [nf * 3] : */ void solve_mix_lub_ewald_3ft_matrix (struct stokes * sys, const double *f, const double *t, const double *uf, const double *of, double *u, double *o, double *ff, double *tf); /* solve natural mobility problem with fixed particles in FTS version * under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * t [nm * 3] : * e [nm * 5] : * uf [nf * 3] : * of [nf * 3] : * ef [nf * 5] : * OUTPUT * u [nm * 3] : * o [nm * 3] : * s [nm * 5] : * ff [nf * 3] : * tf [nf * 3] : * sf [nf * 5] : */ void solve_mix_ewald_3fts (struct stokes * sys, const double *f, const double *t, const double *e, const double *uf, const double *of, const double *ef, double *u, double *o, double *s, double *ff, double *tf, double *sf); /* solve natural mobility problem with lubrication * with fixed particles in FTS version under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * t [nm * 3] : * e [nm * 5] : * uf [nf * 3] : * of [nf * 3] : * ef [nf * 5] : * OUTPUT * u [nm * 3] : * o [nm * 3] : * s [nm * 5] : * ff [nf * 3] : * tf [nf * 3] : * sf [nf * 5] : */ void solve_mix_lub_ewald_3fts (struct stokes * sys, const double *f, const double *t, const double *e, const double *uf, const double *of, const double *ef, double *u, double *o, double *s, double *ff, double *tf, double *sf); /* solve natural mobility problem with lubrication * with fixed particles in FTS version under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * t [nm * 3] : * e [nm * 5] : * uf [nf * 3] : * of [nf * 3] : * ef [nf * 5] : * OUTPUT * u [nm * 3] : * o [nm * 3] : * s [nm * 5] : * ff [nf * 3] : * tf [nf * 3] : * sf [nf * 5] : */ void solve_mix_ewald_3fts_matrix (struct stokes * sys, const double *f, const double *t, const double *e, const double *uf, const double *of, const double *ef, double *u, double *o, double *s, double *ff, double *tf, double *sf); /* solve natural mobility problem with lubrication * with fixed particles in FTS version under Ewald sum * INPUT * sys : system parameters * f [nm * 3] : * t [nm * 3] : * e [nm * 5] : * uf [nf * 3] : * of [nf * 3] : * ef [nf * 5] : * OUTPUT * u [nm * 3] : * o [nm * 3] : * s [nm * 5] : * ff [nf * 3] : * tf [nf * 3] : * sf [nf * 5] : */ void solve_mix_lub_ewald_3fts_matrix (struct stokes * sys, const double *f, const double *t, const double *e, const double *uf, const double *of, const double *ef, double *u, double *o, double *s, double *ff, double *tf, double *sf); /* solve natural mobility problem with fixed particles in F version * under Ewald sum * INPUT * sys : system parameters * f [nm * 2] : f_x, f_y are given (and f_z = 0 is assumed) * uf [nf * 2] : u_x, u_y are given (and u_z = 0 is assumed) * OUTPUT * u [nm * 3] : results are given in 3D form * ff [nf * 3] : */ void solve_mix_ewald_2f (struct stokes * sys, const double *f, const double *uf, double *u, double *ff); /* solve natural mobility problem with lubrication * with fixed particles in F version under Ewald sum * INPUT * sys : system parameters * f [nm * 2] : f_x, f_y are given (and f_z = 0 is assumed) * uf [nf * 2] : u_x, u_y are given (and u_z = 0 is assumed) * OUTPUT * u [nm * 3] : results are given in 3D form * ff [nf * 3] : */ void solve_mix_lub_ewald_2f (struct stokes * sys, const double *f, const double *uf, double *u, double *ff); /* solve natural mobility problem with fixed particles in FT version * under Ewald sum * INPUT * sys : system parameters * f [nm * 2] : f_x, f_y are given (and f_z = 0 is assumed) * t3 [nm * 3] : OK, this is 3D form * uf [nf * 2] : u_x, u_y are given (and u_z = 0 is assumed) * of [nf * 1] : o_z is given (and o_x = o_y = 0 is assumed) * OUTPUT * u [nm * 3] : results are given in 3D form * o [nm * 3] : * ff [nf * 3] : * tf [nf * 3] : */ void solve_mix_ewald_2ft (struct stokes * sys, const double *f, const double *t3, const double *uf, const double *of, double *u, double *o, double *ff, double *tf); /* solve natural mobility problem with lubrication * with fixed particles in FT version under Ewald sum * INPUT * sys : system parameters * f [nm * 2] : f_x, f_y are given (and f_z = 0 is assumed) * t3 [nm * 3] : OK, this is 3D form * uf [nf * 2] : u_x, u_y are given (and u_z = 0 is assumed) * of [nf * 1] : o_z is given (and o_x = o_y = 0 is assumed) * OUTPUT * u [nm * 3] : results are given in 3D form * o [nm * 3] : * ff [nf * 3] : * tf [nf * 3] : */ void solve_mix_lub_ewald_2ft (struct stokes * sys, const double *f, const double *t3, const double *uf, const double *of, double *u, double *o, double *ff, double *tf); /* solve natural mobility problem with fixed particles in FTS version * under Ewald sum * INPUT * sys : system parameters * f [nm * 2] : f_x, f_y are given (and f_z = 0 is assumed) * t3 [nm * 3] : OK, this is 3D form * e [nm * 2] : e_xx, e_xy are given (e_?z = e_z? = 0 is assumed) * uf [nf * 2] : u_x, u_y are given (and u_z = 0 is assumed) * of [nf * 1] : o_z is given (and o_x = o_y = 0 is assumed) * ef [nf * 2] : e_xx, e_xy are given (e_?z = e_z? = 0 is assumed) * OUTPUT * u [nm * 3] : results are given in 3D form * o [nm * 3] : * s [nm * 5] : * ff [nf * 3] : * tf [nf * 3] : * sf [nf * 5] : */ void solve_mix_ewald_2fts (struct stokes * sys, const double *f, const double *t3, const double *e, const double *uf, const double *of, const double *ef, double *u, double *o, double *s, double *ff, double *tf, double *sf); /* solve natural mobility problem with lubrication * with fixed particles in FTS version under Ewald sum * INPUT * sys : system parameters * f [nm * 2] : f_x, f_y are given (and f_z = 0 is assumed) * t3 [nm * 3] : OK, this is 3D form * e [nm * 2] : e_xx, e_xy are given (e_?z = e_z? = 0 is assumed) * uf [nf * 2] : u_x, u_y are given (and u_z = 0 is assumed) * of [nf * 1] : o_z is given (and o_x = o_y = 0 is assumed) * ef [nf * 2] : e_xx, e_xy are given (e_?z = e_z? = 0 is assumed) * OUTPUT * u [nm * 3] : results are given in 3D form * o [nm * 3] : * s [nm * 5] : * ff [nf * 3] : * tf [nf * 3] : * sf [nf * 5] : */ void solve_mix_lub_ewald_2fts (struct stokes * sys, const double *f, const double *t3, const double *e, const double *uf, const double *of, const double *ef, double *u, double *o, double *s, double *ff, double *tf, double *sf);
/************************************************ ** atimes forms (unnatural mobility problems) ** ************************************************/ /** table version **/ /* ATIMES of calc ewald-summed mobility for F/FT/FTS versions * with the ewald table * INPUT * n := np*3 (F), np*6 (FT), or np*11 (FTS) * x [n] : F, FT, or FTS * user_data = (struct stokes *) sys * OUTPUT * y [n] : U, UO, or UOE */ void atimes_ewald_3all (int n, const double *x, double *y, void * user_data); /* make ewald-summed mobility matrix for F/FT/FTS versions * with the ewald table * INPUT * sys : system parameters * OUTPUT * mat [np * 3 * np * 3 ] : for F version * mat [np * 6 * np * 6 ] : for FT version * mat [np * 11 * np * 11] : for FTS version */ void make_matrix_mob_ewald_3all (struct stokes * sys, double * mat); /* ATIMES of calc ewald-summed mobility for F/FT/FTS versions * through matrix with the ewald table * INPUT * n := np*3 (F), np*6 (FT), or np*11 (FTS) * x [n] : F, FT, or FTS * user_data = (struct stokes *) sys * OUTPUT * y [n] : U, UO, or UOE */ void atimes_ewald_3all_matrix (int n, const double *x, double *y, void * user_data); /** non-table version **/ /* ATIMES of calc ewald-summed mobility for F/FT/FTS versions * INPUT * n := np*3 (F), np*6 (FT), or np*11 (FTS) * x [n] : F, FT, or FTS * user_data = (struct stokes *) sys * OUTPUT * y [n] : U, UO, or UOE */ void atimes_ewald_3all_notbl (int n, const double *x, double *y, void * user_data); /* make ewald-summed mobility matrix for F/FT/FTS versions * INPUT * sys : system parameters * OUTPUT * mat [np * 3 * np * 3 ] : for F version * mat [np * 6 * np * 6 ] : for FT version * mat [np * 11 * np * 11] : for FTS version */ void make_matrix_mob_ewald_3all_notbl (struct stokes * sys, double * mat); /* ATIMES of calc ewald-summed mobility for F/FT/FTS versions * through matrix * INPUT * n := np*3 (F), np*6 (FT), or np*11 (FTS) * x [n] : F, FT, or FTS * user_data = (struct stokes *) sys * OUTPUT * y [n] : U, UO, or UOE */ void atimes_ewald_3all_matrix_notbl (int n, const double *x, double *y, void * user_data);