Skip to content

Commit

Permalink
fixed CUDA bug with dual surface normals
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Morgan committed Nov 14, 2024
1 parent aef786c commit b0dc343
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
46 changes: 24 additions & 22 deletions single-node-refactor/src/Solvers/SGH_solver_3D/src/force_sgh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "state.h"
#include "geometry_new.h"

// -------
// A data structure to get the neighboring corners lids inside an elem relative to a corner lid
//
const size_t hex8_corner_lids_in_corner_lid[8][3] =
{
// corner 0
{1, 2, 4},
// corner 1
{0, 3, 5},
// corner 2
{0, 3, 6},
// corner 3
{2, 1, 7},
// corner 4
{6, 5, 0},
// corner 5
{4, 7, 1},
// corner 6
{4, 7, 2},
// corner 7
{6, 5, 3}
};

// --- corner_lid = 0 ---
// corner_lids_in_corner_lid(0,0) = 1;
// corner_lids_in_corner_lid(0,1) = 2;
Expand Down Expand Up @@ -152,6 +131,29 @@ void SGH3D::get_force(const Material_t& Materials,
const size_t num_dims = 3;
const size_t num_nodes_in_elem = 8;

// -------
// A data structure to get the neighboring corners lids
// inside an elem relative to a corner lid
//
const size_t hex8_corner_lids_in_corner_lid[8][3] =
{
// corner 0
{1, 2, 4},
// corner 1
{0, 3, 5},
// corner 2
{0, 3, 6},
// corner 3
{2, 1, 7},
// corner 4
{6, 5, 0},
// corner 5
{4, 7, 1},
// corner 6
{4, 7, 2},
// corner 7
{6, 5, 3}
};

// --- calculate the forces acting on the nodes from the element ---
FOR_ALL(mat_elem_lid, 0, num_mat_elems, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "state.h"
#include "geometry_new.h"

// A data structure to get the neighboring corners lids inside an elem relative to a corner lid
const size_t quad4_corner_lids_in_corner_lid[4][2] =
{
{1, 3},
{0, 2},
{1, 3},
{2, 0}
};

// --- corner_lid = 0 ---
// corner_lids_in_corner_lid(0,0) = 1;
// corner_lids_in_corner_lid(0,1) = 3;
Expand Down Expand Up @@ -117,6 +110,18 @@ void SGHRZ::get_force_rz(const Material_t& Materials,
const size_t num_dims = 2;
const size_t num_nodes_in_elem = 4;

// -------
// A data structure to get the neighboring corners lids
// inside an elem relative to a corner lid
//
const size_t quad4_corner_lids_in_corner_lid[4][2] =
{
{1, 3},
{0, 2},
{1, 3},
{2, 0}
};


// --- calculate the forces acting on the nodes from the element ---
FOR_ALL(mat_elem_lid, 0, num_mat_elems, {
Expand Down

0 comments on commit b0dc343

Please sign in to comment.