Skip to content

Commit

Permalink
Merge pull request #34 from pabloseleson/typos_correction
Browse files Browse the repository at this point in the history
Fixed comments in a few functions
  • Loading branch information
streeve committed Aug 11, 2023
2 parents 5201e60 + dec53d5 commit 95a1ed1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions src/CabanaPD_Force.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ class Force<ExecutionSpace, ForceModel<LinearLPS, Elastic>>
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,
Expand Down Expand Up @@ -965,8 +965,8 @@ class Force<ExecutionSpace, ForceModel<PMB, Elastic>>
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 );
Expand Down Expand Up @@ -1087,8 +1087,8 @@ class Force<ExecutionSpace, ForceModel<PMB, Fracture>>
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;

Expand Down Expand Up @@ -1143,7 +1143,7 @@ class Force<ExecutionSpace, ForceModel<LinearPMB, Elastic>>
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,
Expand Down Expand Up @@ -1179,12 +1179,12 @@ class Force<ExecutionSpace, ForceModel<LinearPMB, Elastic>>
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 );
Expand Down
3 changes: 2 additions & 1 deletion src/CabanaPD_Prenotch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ int bond_prenotch_intersection( const Kokkos::Array<double, 3> v1,
keep_bond = 0;
}
// Case II: no intersection

// Case III: single point intersection
else if ( case_flag == 3 )
{
Expand All @@ -174,9 +175,9 @@ int bond_prenotch_intersection( const Kokkos::Array<double, 3> 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;
Expand Down
9 changes: 4 additions & 5 deletions src/CabanaPD_Solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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{} );
Expand Down

0 comments on commit 95a1ed1

Please sign in to comment.