API to retrieve local neighbor indicies of an element added
This commit is contained in:
@@ -310,3 +310,22 @@ h5t_get_vertex_coords_by_id (
|
||||
H5_CORE_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5t_get_neighbor_indices (
|
||||
h5t_mesh_t* const m,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* neighbor_indices
|
||||
) {
|
||||
H5_CORE_API_ENTER (h5_err_t,
|
||||
"m=%p, entity_id=%llu, neighbor_indices=%p",
|
||||
m,
|
||||
(long long unsigned)entity_id,
|
||||
neighbor_indices);
|
||||
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
|
||||
h5_loc_idx_t* indices = h5tpriv_get_loc_elem_neighbor_indices (m, elem_idx);
|
||||
int num_facets = h5tpriv_ref_elem_get_num_facets (m);
|
||||
for (int i = 0; i < num_facets; i++) {
|
||||
neighbor_indices[i] = indices[i];
|
||||
}
|
||||
H5_CORE_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -173,6 +173,19 @@ H5FedGetVertexIndicesOfEntity (
|
||||
H5_API_RETURN (h5t_get_vertex_indices_of_entity (m, entity_id, vertex_indices));
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
H5FedGetNeighborIndicesOfElement (
|
||||
h5t_mesh_t* const m,
|
||||
h5_loc_id_t entity_id,
|
||||
h5_loc_idx_t* neighbor_indices
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t,
|
||||
"m=%p, entity_id=%lld, neighbor_indices=%p",
|
||||
m, (long long)entity_id, neighbor_indices);
|
||||
H5_API_RETURN (h5t_get_neighbor_indices (m, entity_id, neighbor_indices));
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -78,6 +78,8 @@ h5t_get_vertex_coords_by_index (h5t_mesh_t* const, h5_loc_idx_t, h5_float64_t[3]
|
||||
h5_err_t
|
||||
h5t_get_vertex_coords_by_id (h5t_mesh_t* const, h5_loc_id_t, h5_float64_t[3]);
|
||||
|
||||
h5_err_t
|
||||
h5t_get_neighbor_indices (h5t_mesh_t* const, h5_loc_id_t, h5_loc_idx_t*);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user