Skip to content

Commit

Permalink
Style patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Sep 22, 2018
1 parent cd0597f commit 8fedeb9
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 96 deletions.
3 changes: 2 additions & 1 deletion src/core/electrostatics_magnetostatics/p3m-dipolar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,8 @@ static double dp3m_m_time(char **log, int mesh, int cao_min, int cao_max,
double *_accuracy) {
double best_time = -1, tmp_time, tmp_r_cut_iL, tmp_alpha_L = 0.0,
tmp_accuracy = 0.0;
/* in which direction improvement is possible. Initially, we don't know it yet.
/* in which direction improvement is possible. Initially, we don't know it
* yet.
*/
int final_dir = 0;
int cao = *_cao;
Expand Down
45 changes: 24 additions & 21 deletions src/core/grid_based_algorithms/lbgpu_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
*/

/** \file
*
* Cuda (.cu) file for the Lattice Boltzmann implementation on GPUs.
* Header file for \ref lbgpu.hpp.
* Cuda (.cu) file for the Lattice Boltzmann implementation on GPUs.
* Header file for \ref lbgpu.hpp.
*/

#include "config.hpp"
Expand Down Expand Up @@ -59,26 +58,29 @@ int extended_values_flag = 0; /* TODO: this has to be set to one by
the need to compute pi at every
step (e.g. moving boundaries)*/

/**defining structures residing in global memory */
/** defining structures residing in global memory */

/** device_rho_v: struct for hydrodynamic fields: this is for internal use
(i.e. stores values in LB units) and should not used for
printing values */
* (i.e. stores values in LB units) and should not used for
* printing values
*/
static LB_rho_v_gpu *device_rho_v = nullptr;

/** device_rho_v_pi: extended struct for hydrodynamic fields: this is the
interface and stores values in MD units. It should not be used as an input
for any LB calculations. TODO: This structure is not yet used, and it is here
to allow access to the stress tensor at any timestep, e.g. for future
implementations of moving boundary codes */
* interface and stores values in MD units. It should not be used as an input
* for any LB calculations. TODO: This structure is not yet used, and it is
* here to allow access to the stress tensor at any timestep, e.g. for future
* implementations of moving boundary codes
*/
static LB_rho_v_pi_gpu *device_rho_v_pi = nullptr;

/** print_rho_v_pi: struct for hydrodynamic fields: this is the interface
and stores values in MD units. It should not used
as an input for any LB calculations. TODO: in the future,
one might want to have several structures for printing
separately rho, v, pi without having to compute/store
the complete set. */
* and stores values in MD units. It should not used
* as an input for any LB calculations. TODO: in the future,
* one might want to have several structures for printing
* separately rho, v, pi without having to compute/store
* the complete set.
*/
static LB_rho_v_pi_gpu *print_rho_v_pi = nullptr;

/** structs for velocity densities */
Expand Down Expand Up @@ -952,7 +954,8 @@ __device__ void thermalize_modes(float *mode, unsigned int index,
}

/*-------------------------------------------------------*/
/**normalization of the modes need before back-transformation into velocity space
/**normalization of the modes need before back-transformation into velocity
* space
* @param mode Pointer to the local register values mode (Input/Output)
*/
__device__ void normalize_modes(float *mode) {
Expand Down Expand Up @@ -982,8 +985,8 @@ __device__ void normalize_modes(float *mode) {
}

/*-------------------------------------------------------*/
/**back-transformation from modespace to densityspace and streaming with the push
* method using pbc
/**back-transformation from modespace to densityspace and streaming with the
* push method using pbc
* @param index node index / thread index (Input)
* @param mode Pointer to the local register values mode (Input)
* @param *n_b Pointer to local node residing in array b (Output)
Expand Down Expand Up @@ -2208,13 +2211,13 @@ __device__ void calc_viscous_force_three_point_couple(
}

/**calculation of the node force caused by the particles, with atomicadd due to
avoiding race conditions (Eq. (14) Ahlrichs and Duenweg, JCP 111(17):8225
(1999))
* avoiding race conditions (Eq. (14) Ahlrichs and Duenweg, JCP 111(17):8225
* (1999))
* @param *delta Pointer for the weighting of particle position (Input)
* @param *delta_j Pointer for the weighting of particle momentum (Input)
* @param node_index node index around (8) particle (Input)
* @param node_f Pointer to the node force (Output).
*/
*/
__device__ void
calc_node_force_three_point_couple(float *delta, float *delta_j,
unsigned int *node_index,
Expand Down
38 changes: 20 additions & 18 deletions src/core/object-in-fluid/affinity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ inline void add_affinity_pair_force(Particle *p1, Particle *p2,
* strength of the force is proportional to the difference of actual bond
*length and relaxed bond length bond is created with probability
*1-exp(-Kon*timestep) maxBond is not used, we use probability
*1-exp(-Koff*timestep) to break the bond Koff depends on the bond length via
*Koff = K0*exp(F/Fd) = K0*exp(kappa(r-r0)/Fd) here, ia_params->Koff gives
*us K_0, off rate when bond is relaxed. here, maxBond is used as detachment
*force F_d. The original check for ensuring, that particle flows out of the
*cut-off radius and the bond remains active is replaced with fixed check,
*that bond length must not be greater that 0.8 cut_off
*1-exp(-Koff*timestep) to break the bond Koff depends on the bond length
*via Koff = K0*exp(F/Fd) = K0*exp(kappa(r-r0)/Fd) here, ia_params->Koff
*gives us K_0, off rate when bond is relaxed. here, maxBond is used as
*detachment force F_d. The original check for ensuring, that particle flows
*out of the cut-off radius and the bond remains active is replaced with
*fixed check, that bond length must not be greater that 0.8 cut_off
*********************/
int j;
double fac = 0.0;
Expand Down Expand Up @@ -546,12 +546,13 @@ inline void add_affinity_pair_force(Particle *p1, Particle *p2,
* strength of the force is proportional to the difference of actual bond
*length and 75% of the relaxed bond length bond is created with probability
*1-exp(-Kon*timestep) maxBond is not used, we use probability
*1-exp(-Koff*timestep) to break the bond Koff depends on the bond length via
*Koff = K0*exp(F/Fd) = K0*exp(kappa(r-0.75*r0)/Fd) here, ia_params->Koff
*gives us K_0, off rate when bond is relaxed. here, maxBond is used as
*detachment force F_d. The original check for ensuring, that particle flows
*out of the cut-off radius and the bond remains active is replaced with
*fixed check, that bond length must not be greater that 0.8 cut_off
*1-exp(-Koff*timestep) to break the bond Koff depends on the bond length
*via Koff = K0*exp(F/Fd) = K0*exp(kappa(r-0.75*r0)/Fd) here,
*ia_params->Koff gives us K_0, off rate when bond is relaxed. here, maxBond
*is used as detachment force F_d. The original check for ensuring, that
*particle flows out of the cut-off radius and the bond remains active is
*replaced with fixed check, that bond length must not be greater that 0.8
*cut_off
*********************/
int j;
double fac = 0.0;
Expand Down Expand Up @@ -686,12 +687,13 @@ inline void add_affinity_pair_force(Particle *p1, Particle *p2,
* strength of the force is proportional to the difference of actual bond
*length and the relaxed bond length bond is created with probability
*1-exp(-Kon*timestep) maxBond is not used, we use probability
*1-exp(-Koff*timestep) to break the bond Koff depends on the bond length via
*Koff = K0*exp(F/Fd) = K0*exp(kappa(r-0.75*r0)/Fd) here, ia_params->Koff
*gives us K_0, off rate when bond is relaxed. here, maxBond is used as
*detachment force F_d. The original check for ensuring, that particle flows
*out of the cut-off radius and the bond remains active is replaced with
*fixed check, that bond length must not be greater that 0.8 cut_off
*1-exp(-Koff*timestep) to break the bond Koff depends on the bond length
*via Koff = K0*exp(F/Fd) = K0*exp(kappa(r-0.75*r0)/Fd) here,
*ia_params->Koff gives us K_0, off rate when bond is relaxed. here, maxBond
*is used as detachment force F_d. The original check for ensuring, that
*particle flows out of the cut-off radius and the bond remains active is
*replaced with fixed check, that bond length must not be greater that 0.8
*cut_off
*********************/
int j;
double fac = 0.0;
Expand Down
46 changes: 25 additions & 21 deletions src/core/particle_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#ifndef _PARTICLE_DATA_H
#define _PARTICLE_DATA_H
/** \file
For more information on particle_data,
see \ref particle_data.cpp "particle_data.cpp"
*/
* For more information on particle_data,
* see \ref particle_data.cpp "particle_data.cpp"
*/

#include "Vector.hpp"
#include "config.hpp"
Expand All @@ -44,29 +44,33 @@
/// ok code for \ref place_particle, particle is new
#define ES_PART_CREATED 1

/** bonds_flag "bonds_flag" value for updating particle config without bonding
* information */
/** bonds_flag "bonds_flag" value for updating particle config without bonding
* information
*/
#define WITHOUT_BONDS 0
/** bonds_flag "bonds_flag" value for updating particle config with bonding
* information */
/** bonds_flag "bonds_flag" value for updating particle config with bonding
* information
*/
#define WITH_BONDS 1

#ifdef EXTERNAL_FORCES
/** \ref ParticleProperties::ext_flag "ext_flag" value for particle subject to an
* external force. */
/** \ref ParticleProperties::ext_flag "ext_flag" value for particle subject to
* an external force
*/
#define PARTICLE_EXT_FORCE 1
/** \ref ParticleProperties::ext_flag "ext_flag" value for fixed coordinate coord. */
/** \ref ParticleProperties::ext_flag "ext_flag" value for fixed coordinate
* coord. */
#define COORD_FIXED(coord) (2L << coord)
/** \ref ParticleProperties::ext_flag "ext_flag" mask to check whether any of the
* coordinates is fixed. */
/** \ref ParticleProperties::ext_flag "ext_flag" mask to check whether any of
* the coordinates is fixed. */
#define COORDS_FIX_MASK (COORD_FIXED(0) | COORD_FIXED(1) | COORD_FIXED(2))
/** \ref ParticleProperties::ext_flag "ext_flag" mask to check whether all of the
* coordinates are fixed. */
/** \ref ParticleProperties::ext_flag "ext_flag" mask to check whether all of
* the coordinates are fixed. */
#define COORDS_ALL_FIXED (COORD_FIXED(0) & COORD_FIXED(1) & COORD_FIXED(2))

#ifdef ROTATION
/** \ref ParticleProperties::ext_flag "ext_flag" value for particle subject to an
* external torque. */
/** \ref ParticleProperties::ext_flag "ext_flag" value for particle subject to
* an external torque. */
#define PARTICLE_EXT_TORQUE 16
#endif

Expand All @@ -77,11 +81,11 @@
************************************************/

/** Properties of a particle which are not supposed to
change during the integration, but have to be known
for all ghosts. Ghosts are particles which are
needed in the interaction calculation, but are just copies of
particles stored on different nodes.
*/
* change during the integration, but have to be known
* for all ghosts. Ghosts are particles which are
* needed in the interaction calculation, but are just copies of
* particles stored on different nodes.
*/
struct ParticleProperties {
/** unique identifier for the particle. */
int identity = -1;
Expand Down
70 changes: 37 additions & 33 deletions src/core/specfunc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,60 +19,64 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file
This file contains implementations for some special functions which are
needed by the MMM family of algorithms. This are the modified Hurwitz zeta
function and the modified Bessel functions of first and second kind. The
implementations are based on the GSL code (see \ref specfunc.cpp "specfunc.cpp"
for the original GSL header).
The Hurwitz zeta function is evaluated using the Euler-MacLaurin summation
formula, the Bessel functions are evaluated using several different Chebychev
expansions. Both achieve a precision of nearly machine precision, which is no
problem for the Hurwitz zeta function, which is only used when determining
the coefficients for the modified polygamma functions (see \ref
mmm-common.hpp "mmm-common.h"). However, the Bessel functions are actually
used in the near formula of MMM2D, which is therefore slightly slower than
necessary. On the other hand, the number of terms in the Bessel sum is quite
small normally, so that a less precise version will probably not generate a
huge computational speed improvement.
*/
* This file contains implementations for some special functions which are
* needed by the MMM family of algorithms. This are the modified Hurwitz zeta
* function and the modified Bessel functions of first and second kind. The
* implementations are based on the GSL code (see \ref specfunc.cpp
* "specfunc.cpp" for the original GSL header).
*
* The Hurwitz zeta function is evaluated using the Euler-MacLaurin summation
* formula, the Bessel functions are evaluated using several different
* Chebychev expansions. Both achieve a precision of nearly machine precision,
* which is no problem for the Hurwitz zeta function, which is only used when
* determining the coefficients for the modified polygamma functions (see \ref
* mmm-common.hpp "mmm-common.h"). However, the Bessel functions are actually
* used in the near formula of MMM2D, which is therefore slightly slower than
* necessary. On the other hand, the number of terms in the Bessel sum is
* quite small normally, so that a less precise version will probably not
* generate a huge computational speed improvement.
*/
#ifndef SPECFUNC_H
#define SPECFUNC_H

/** Hurwitz zeta function. This function was taken from the GSL code. */
double hzeta(double order, double x);

/** Modified Bessel function of first kind, order 0. This function was taken
from the GSL code. Precise roughly up to machine precision. */
* from the GSL code. Precise roughly up to machine precision.
*/
double I0(double x);
/** Modified Bessel function of first kind, order 1. This function was taken
from the GSL code. Precise roughly up to machine precision. */
* from the GSL code. Precise roughly up to machine precision.
*/
double I1(double x);
/** Modified Bessel function of second kind, order 0. This function was taken
from the GSL code. Precise roughly up to machine precision. */
* from the GSL code. Precise roughly up to machine precision.
*/
double K0(double x);
/** Modified Bessel function of second kind, order 1. This function was taken
from the GSL code. Precise roughly up to machine precision. */
* from the GSL code. Precise roughly up to machine precision.
*/
double K1(double x);

/** Besselfunctions K0 at x.
The implementation has an absolute precision of around 10^(-14), which is
comparable to the relative precision sqrt implementation of current
hardware.
*/
* The implementation has an absolute precision of around 10^(-14), which is
* comparable to the relative precision sqrt implementation of current
* hardware.
*/
double LPK0(double x);

/** Besselfunctions K1 at x.
The implementation has an absolute precision of around 10^(-14), which is
comparable to the relative precision sqrt implementation of current
hardware.
*/
* The implementation has an absolute precision of around 10^(-14), which is
* comparable to the relative precision sqrt implementation of current
* hardware.
*/
double LPK1(double x);

/** Besselfunctions K0 and K1 at x.
The implementation has an absolute precision of around 10^(-14), which is
comparable to the relative precision sqrt implementation of current
hardware.
*/
* The implementation has an absolute precision of around 10^(-14), which is
* comparable to the relative precision sqrt implementation of current
* hardware.
*/
void LPK01(double x, double *K0, double *K1);
#endif
4 changes: 2 additions & 2 deletions src/core/utils/Histogram.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ inline size_t ravel_index(std::vector<size_t> unravelled_indices,
* dimensions. (Input)
* \param ndims int denoting the number of dimensions. (Input)
* \param flattened_index an int denoting the flat index. (Input)
* \param unravelled_index_out an int array with length ndims where the unflat indices
* are written to. (Output)
* \param unravelled_index_out an int array with length ndims where the unflat
* indices are written to. (Output)
*/
inline void unravel_index(const int *const len_dims, const int ndims,
const int flattened_index,
Expand Down

0 comments on commit 8fedeb9

Please sign in to comment.