Skip to content

Commit

Permalink
tweak ownership change criterion
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahdhn committed Nov 10, 2023
1 parent 640aa00 commit 3a36159
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
10 changes: 10 additions & 0 deletions apps/Delaunay/delaunay_rxmesh.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ inline void delaunay_rxmesh(rxmesh::RXMeshDynamic& rx, bool with_verify = true)
float slice_time = 0;
float cleanup_time = 0;

RXMESH_INFO("Input mesh #Vertices {}", rx.get_num_vertices());
RXMESH_INFO("Input mesh #Edges {}", rx.get_num_edges());
RXMESH_INFO("Input mesh #Faces {}", rx.get_num_faces());
RXMESH_INFO("Input mesh #Patches {}", rx.get_num_patches());

CUDA_ERROR(cudaProfilerStart());

bool validate = false;
Expand Down Expand Up @@ -344,6 +349,11 @@ inline void delaunay_rxmesh(rxmesh::RXMeshDynamic& rx, bool with_verify = true)
EXPECT_EQ(num_edges, rx.get_num_edges());
EXPECT_EQ(num_faces, rx.get_num_faces());

RXMESH_INFO("Output mesh #Vertices {}", rx.get_num_vertices());
RXMESH_INFO("Output mesh #Edges {}", rx.get_num_edges());
RXMESH_INFO("Output mesh #Faces {}", rx.get_num_faces());
RXMESH_INFO("Output mesh #Patches {}", rx.get_num_patches());

if (with_verify) {
rx.export_obj(STRINGIFY(OUTPUT_DIR) "temp.obj", *coords);
TriMesh tri_mesh;
Expand Down
15 changes: 15 additions & 0 deletions include/rxmesh/cavity_manager_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,11 @@ CavityManager<blockThreads, cop>::set_ownership_change_bitmask(
assert(f < m_s_owned_mask_f.size());
assert(f < m_s_active_mask_f.size());
assert(f < m_s_in_cavity_f.size());

const uint16_t edges[3] = {m_s_fe[3 * f + 0] >> 1,
m_s_fe[3 * f + 1] >> 1,
m_s_fe[3 * f + 2] >> 1};

if (!m_s_owned_mask_f(f) && m_s_in_cavity_f(f)) {
m_s_ownership_change_mask_f.set(f, true);
}
Expand Down Expand Up @@ -1718,6 +1723,16 @@ CavityManager<blockThreads, cop>::set_ownership_change_bitmask(
}
}
}

if (m_s_ownership_change_mask_f(f)) {
for (uint16_t e = 0; e < 3; ++e) {
if (!m_s_owned_mask_e(edges[e]) &&
m_s_active_mask_e(edges[e])) {
m_s_ownership_change_mask_e.set(edges[e], true);
}
}

}
}


Expand Down
4 changes: 2 additions & 2 deletions include/rxmesh/query.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ struct Query
using ComputeHandleT = typename ComputeTraits::template arg<0>::type;
using ComputeIteratorT = typename ComputeTraits::template arg<1>::type;

assert(m_s_output_value);

for (uint16_t local_id = threadIdx.x; local_id < m_num_src_in_patch;
local_id += blockThreads) {

if (detail::is_set_bit(local_id, m_s_participant_bitmask)) {

assert(m_s_output_value);

ComputeHandleT handle(m_patch_info.patch_id, local_id);
ComputeIteratorT iter =
get_iterator<ComputeIteratorT>(local_id);
Expand Down
3 changes: 2 additions & 1 deletion include/rxmesh/rxmesh_dynamic.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,8 @@ bool RXMeshDynamic::validate()

if (!is_okay()) {
RXMESH_WARN("RXMeshDynamic::validate() check_ribbon_edges failed");
CUDA_ERROR(cudaMemset(d_check, 0, sizeof(unsigned long long int)));
return false;
//CUDA_ERROR(cudaMemset(d_check, 0, sizeof(unsigned long long int)));
}

uint32_t* d_max_valence;
Expand Down
4 changes: 2 additions & 2 deletions tests/RXMesh_test/test_dynamic.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ TEST(RXMeshDynamic, RandomFlips)
ps_mesh->updateVertexPositions(*coords);
ps_mesh->addEdgeScalarQuantity("toFlip", *to_flip)->setMapRange({0, 2});
ps_mesh->setEnabled(false);
polyscope::show();
// polyscope::show();
#endif

// polyscope::removeAllStructures();
Expand Down Expand Up @@ -478,7 +478,7 @@ TEST(RXMeshDynamic, RandomCollapse)
ps_mesh->addVertexScalarQuantity("vAttr", *v_attr);
ps_mesh->addEdgeScalarQuantity("eAttr", *e_attr);
ps_mesh->addFaceScalarQuantity("fAttr", *f_attr);
polyscope::show();
// polyscope::show();
#endif

// polyscope::removeAllStructures();
Expand Down

0 comments on commit 3a36159

Please sign in to comment.