Skip to content

Commit

Permalink
removed commented out vel_grad routine and fixed spelling in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Morgan committed Oct 24, 2024
1 parent ef19eba commit 1358816
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 82 deletions.
80 changes: 0 additions & 80 deletions single-node-refactor/src/Solvers/SGH_solver_3D/src/momentum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,87 +190,7 @@ void SGH3D::get_velgrad(DCArrayKokkos<double>& vel_grad,

return;
} // end subroutine
/*
KOKKOS_FUNCTION
void SGH3D::get_velgrad(DCArrayKokkos<double>& vel_grad,
const ViewCArrayKokkos<size_t>& elem_node_gids,
const DCArrayKokkos<double>& node_vel,
const ViewCArrayKokkos<double>& b_matrix,
const double elem_vol,
const size_t elem_gid) const
{
const size_t num_nodes_in_elem = 8;
double u_array[num_nodes_in_elem];
double v_array[num_nodes_in_elem];
double w_array[num_nodes_in_elem];
ViewCArrayKokkos<double> u(u_array, num_nodes_in_elem); // x-direction velocity component
ViewCArrayKokkos<double> v(v_array, num_nodes_in_elem); // y-direction velocity component
ViewCArrayKokkos<double> w(w_array, num_nodes_in_elem); // z-direction velocity component
// get the vertex velocities for the cell
for (size_t node_lid = 0; node_lid < num_nodes_in_elem; node_lid++) {
// Get node gid
size_t node_gid = elem_node_gids(node_lid);
u(node_lid) = node_vel(1, node_gid, 0);
v(node_lid) = node_vel(1, node_gid, 1);
w(node_lid) = node_vel(1, node_gid, 2);
} // end for
// --- calculate the velocity gradient terms ---
double inverse_vol = 1.0 / elem_vol;
// x-dir
vel_grad(0, 0) = (u(0) * b_matrix(0, 0) + u(1) * b_matrix(1, 0)
+ u(2) * b_matrix(2, 0) + u(3) * b_matrix(3, 0)
+ u(4) * b_matrix(4, 0) + u(5) * b_matrix(5, 0)
+ u(6) * b_matrix(6, 0) + u(7) * b_matrix(7, 0)) * inverse_vol;

vel_grad(0, 1) = (u(0) * b_matrix(0, 1) + u(1) * b_matrix(1, 1)
+ u(2) * b_matrix(2, 1) + u(3) * b_matrix(3, 1)
+ u(4) * b_matrix(4, 1) + u(5) * b_matrix(5, 1)
+ u(6) * b_matrix(6, 1) + u(7) * b_matrix(7, 1)) * inverse_vol;
vel_grad(0, 2) = (u(0) * b_matrix(0, 2) + u(1) * b_matrix(1, 2)
+ u(2) * b_matrix(2, 2) + u(3) * b_matrix(3, 2)
+ u(4) * b_matrix(4, 2) + u(5) * b_matrix(5, 2)
+ u(6) * b_matrix(6, 2) + u(7) * b_matrix(7, 2)) * inverse_vol;
// y-dir
vel_grad(1, 0) = (v(0) * b_matrix(0, 0) + v(1) * b_matrix(1, 0)
+ v(2) * b_matrix(2, 0) + v(3) * b_matrix(3, 0)
+ v(4) * b_matrix(4, 0) + v(5) * b_matrix(5, 0)
+ v(6) * b_matrix(6, 0) + v(7) * b_matrix(7, 0)) * inverse_vol;
vel_grad(1, 1) = (v(0) * b_matrix(0, 1) + v(1) * b_matrix(1, 1)
+ v(2) * b_matrix(2, 1) + v(3) * b_matrix(3, 1)
+ v(4) * b_matrix(4, 1) + v(5) * b_matrix(5, 1)
+ v(6) * b_matrix(6, 1) + v(7) * b_matrix(7, 1)) * inverse_vol;
vel_grad(1, 2) = (v(0) * b_matrix(0, 2) + v(1) * b_matrix(1, 2)
+ v(2) * b_matrix(2, 2) + v(3) * b_matrix(3, 2)
+ v(4) * b_matrix(4, 2) + v(5) * b_matrix(5, 2)
+ v(6) * b_matrix(6, 2) + v(7) * b_matrix(7, 2)) * inverse_vol;
// z-dir
vel_grad(2, 0) = (w(0) * b_matrix(0, 0) + w(1) * b_matrix(1, 0)
+ w(2) * b_matrix(2, 0) + w(3) * b_matrix(3, 0)
+ w(4) * b_matrix(4, 0) + w(5) * b_matrix(5, 0)
+ w(6) * b_matrix(6, 0) + w(7) * b_matrix(7, 0)) * inverse_vol;
vel_grad(2, 1) = (w(0) * b_matrix(0, 1) + w(1) * b_matrix(1, 1)
+ w(2) * b_matrix(2, 1) + w(3) * b_matrix(3, 1)
+ w(4) * b_matrix(4, 1) + w(5) * b_matrix(5, 1)
+ w(6) * b_matrix(6, 1) + w(7) * b_matrix(7, 1)) * inverse_vol;
vel_grad(2, 2) = (w(0) * b_matrix(0, 2) + w(1) * b_matrix(1, 2)
+ w(2) * b_matrix(2, 2) + w(3) * b_matrix(3, 2)
+ w(4) * b_matrix(4, 2) + w(5) * b_matrix(5, 2)
+ w(6) * b_matrix(6, 2) + w(7) * b_matrix(7, 2)) * inverse_vol;
return;
} // end function
*/

/////////////////////////////////////////////////////////////////////////////
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void SGH3D::update_stress(


// ==================================================
// launcing another solver, which then calls the material model interface
// launching another solver, which then calls the material model interface
// ==================================================


Expand Down Expand Up @@ -383,7 +383,7 @@ void SGH3D::update_stress(

// the material point index = the material elem index for a 1-point element
size_t mat_point_lid = mat_elem_lid;


// --- call strength model ---
Materials.MaterialFunctions(mat_id).calc_stress(
Expand Down

0 comments on commit 1358816

Please sign in to comment.