From dec53d5ad7596decfdc4bb5e1044304380e3389e Mon Sep 17 00:00:00 2001 From: Pablo Seleson Date: Wed, 9 Aug 2023 11:46:45 -0400 Subject: [PATCH] Fixed typos in a few functions --- src/CabanaPD_Force.hpp | 18 +++++++++--------- src/CabanaPD_Prenotch.hpp | 3 ++- src/CabanaPD_Solver.hpp | 9 ++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/CabanaPD_Force.hpp b/src/CabanaPD_Force.hpp index 61c4c7a6..035fbd76 100644 --- a/src/CabanaPD_Force.hpp +++ b/src/CabanaPD_Force.hpp @@ -807,7 +807,7 @@ class Force> double fy_i = 0.0; double fz_i = 0.0; - // Get the bond distance and stretch + // Get the bond distance and linearized stretch double xi, linear_s; double xi_x, xi_y, xi_z; getLinearizedDistanceComponents( x, u, i, j, xi, linear_s, xi_x, @@ -966,8 +966,8 @@ class Force> double xi, r, s; getDistance( x, u, i, j, xi, r, s ); - // 1/2 from outside the integral; 1/2 from the integrand (pairwise - // potential). + // 0.25 factor is due to 1/2 from outside the integral and 1/2 from + // the integrand (pairwise potential). double w = 0.25 * c * s * s * xi * vol( j ); W( i ) += w; Phi += w * vol( i ); @@ -1088,8 +1088,8 @@ class Force> double xi, r, s; getDistance( x, u, i, j, xi, r, s ); - // 1/2 from outside the integral; 1/2 from the integrand - // (pairwise potential). + // 0.25 factor is due to 1/2 from outside the integral and 1/2 + // from the integrand (pairwise potential). double w = mu( i, n ) * 0.25 * c * s * s * xi * vol( j ); W( i ) += w; @@ -1144,7 +1144,7 @@ class Force> double fy_i = 0.0; double fz_i = 0.0; - // Get the bond distance, displacement, and stretch + // Get the bond distance, displacement, and linearized stretch double xi, linear_s; double xi_x, xi_y, xi_z; getLinearizedDistanceComponents( x, u, i, j, xi, linear_s, xi_x, @@ -1180,12 +1180,12 @@ class Force> auto energy_full = KOKKOS_LAMBDA( const int i, const int j, double& Phi ) { - // Get the bond distance, displacement, and stretch + // Get the bond distance, displacement, and linearized stretch double xi, linear_s; getLinearizedDistance( x, u, i, j, xi, linear_s ); - // 1/2 from outside the integral; 1/2 from the integrand (pairwise - // potential). + // 0.25 factor is due to 1/2 from outside the integral and 1/2 from + // the integrand (pairwise potential). double w = 0.25 * c * linear_s * linear_s * xi * vol( j ); W( i ) += w; Phi += w * vol( i ); diff --git a/src/CabanaPD_Prenotch.hpp b/src/CabanaPD_Prenotch.hpp index 02fed300..f47d7c1a 100644 --- a/src/CabanaPD_Prenotch.hpp +++ b/src/CabanaPD_Prenotch.hpp @@ -166,6 +166,7 @@ int bond_prenotch_intersection( const Kokkos::Array v1, keep_bond = 0; } // Case II: no intersection + // Case III: single point intersection else if ( case_flag == 3 ) { @@ -174,9 +175,9 @@ int bond_prenotch_intersection( const Kokkos::Array v1, // Check if intersection point belongs to the bond auto d = dot( diff( p0, l0 ), n ) / dot( l, n ); - // Check if intersection point belongs to the plane if ( -tol < d && d < 1 + tol ) { + // Check if intersection point belongs to the plane auto p = sum( l0, scale( l, d ) ); double norm2_cross_v1_v2 = norm_cross_v1_v2 * norm_cross_v1_v2; diff --git a/src/CabanaPD_Solver.hpp b/src/CabanaPD_Solver.hpp index 1c2c869a..3507611d 100644 --- a/src/CabanaPD_Solver.hpp +++ b/src/CabanaPD_Solver.hpp @@ -218,7 +218,7 @@ class SolverElastic comm->gatherDilatation(); comm_time += comm_timer.seconds(); - // Compute short range force + // Compute internal forces force_timer.reset(); compute_force( *force, *particles, *neighbors, neigh_iter_tag{} ); force_time += force_timer.seconds(); @@ -373,12 +373,11 @@ class SolverFracture void init_force() { init_timer.reset(); - // Compute weighted volume for LPS (does nothing for PMB). + // Compute/communicate weighted volume for LPS (does nothing for PMB). force->compute_weighted_volume( *particles, *neighbors, mu ); comm->gatherWeightedVolume(); - // Compute dilatation for LPS (does nothing for PMB). + // Compute/communicate dilatation for LPS (does nothing for PMB). force->compute_dilatation( *particles, *neighbors, mu ); - // Communicate dilatation for LPS (does nothing for PMB). comm->gatherDilatation(); // Compute initial forces @@ -424,7 +423,7 @@ class SolverFracture comm->gatherDilatation(); comm_time += comm_timer.seconds(); - // Compute short range force + // Compute internal forces force_timer.reset(); compute_force( *force, *particles, *neighbors, mu, neigh_iter_tag{} );