Skip to content

Commit

Permalink
IOSS: Update TextMesh to handle extended shell ordinals to the edges
Browse files Browse the repository at this point in the history
  • Loading branch information
tokusanya committed Sep 16, 2024
1 parent 6a484f8 commit 1671ba2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
12 changes: 8 additions & 4 deletions packages/seacas/libraries/ioss/src/Ioss_Utils.C
Original file line number Diff line number Diff line change
Expand Up @@ -940,11 +940,8 @@ void Ioss::Utils::calculate_sideblock_membership(IntVector &face_is_
}
}

int64_t Ioss::Utils::get_side_offset(const Ioss::SideBlock *sb)
int64_t Ioss::Utils::get_side_offset(const Ioss::ElementTopology * parent_topo, const Ioss::ElementTopology * side_topo)
{

const Ioss::ElementTopology *side_topo = sb->topology();
const Ioss::ElementTopology *parent_topo = sb->parent_element_topology();
int64_t side_offset = 0;
if ((side_topo != nullptr) && (parent_topo != nullptr)) {
int side_topo_dim = side_topo->parametric_dimension();
Expand All @@ -958,6 +955,13 @@ int64_t Ioss::Utils::get_side_offset(const Ioss::SideBlock *sb)
return side_offset;
}

int64_t Ioss::Utils::get_side_offset(const Ioss::SideBlock *sb)
{
const Ioss::ElementTopology *side_topo = sb->topology();
const Ioss::ElementTopology *parent_topo = sb->parent_element_topology();
return get_side_offset(parent_topo, side_topo);
}

std::string Ioss::Utils::shape_to_string(const Ioss::ElementShape &shape)
{
switch (shape) {
Expand Down
2 changes: 2 additions & 0 deletions packages/seacas/libraries/ioss/src/Ioss_Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ namespace Ioss {
* \param[in] sb Compute the offset for element sides in this SideBlock
* \returns The offset.
*/
IOSS_NODISCARD static int64_t get_side_offset(const Ioss::ElementTopology * parent_topo, const Ioss::ElementTopology * side_topo);

IOSS_NODISCARD static int64_t get_side_offset(const Ioss::SideBlock *sb);

IOSS_NODISCARD static unsigned int hash(const std::string &name);
Expand Down
7 changes: 6 additions & 1 deletion packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.C
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,11 @@ namespace Iotm {
return;

SideBlockInfo info = sideset->get_side_block_info(sideBlockName);
Ioss::ElementTopology* topology = Ioss::ElementTopology::factory(info.elementTopology, true);
Ioss::ElementTopology* side_topology = Ioss::ElementTopology::factory(info.sideTopology, true);

int sideOffset = Ioss::Utils::get_side_offset(topology, side_topology);

std::vector<size_t> localSideIndex =
sideset->get_sideblock_indices_local_to_proc(info, m_myProcessor);
elemSides.resize(2 * localSideIndex.size());
Expand All @@ -892,7 +897,7 @@ namespace Iotm {
int side = elemSidePair.second;

elemSides[count++] = elemId;
elemSides[count++] = side;
elemSides[count++] = side - sideOffset;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,7 @@ namespace Iotm {

int num_sides() const
{
if (topology->is_shell()) {
// Only interested in face boundaries, not edges
if (topology->parametric_dimension() == 2) {
return topology->number_faces();
}
}

return topology->number_boundaries();
return sideTopologies.size();
}

// Side references are one-based
Expand Down Expand Up @@ -583,7 +576,7 @@ namespace Iotm {

if (!entry.initialized) {
entry.set_valid_spatial_dimensions({false, false, false, true});
entry.set_side_topologies({tri_3_factory(), tri_3_factory()});
entry.set_side_topologies({tri_3_factory(), tri_3_factory(), line_2_factory(), line_2_factory(), line_2_factory()});
entry.initialized = true;
}

Expand All @@ -596,7 +589,7 @@ namespace Iotm {

if (!entry.initialized) {
entry.set_valid_spatial_dimensions({false, false, false, true});
entry.set_side_topologies({tri_4_factory(), tri_4_factory()});
entry.set_side_topologies({tri_4_factory(), tri_4_factory(), line_2_factory(), line_2_factory(), line_2_factory()});
entry.initialized = true;
}

Expand All @@ -609,7 +602,7 @@ namespace Iotm {

if (!entry.initialized) {
entry.set_valid_spatial_dimensions({false, false, false, true});
entry.set_side_topologies({tri_6_factory(), tri_6_factory()});
entry.set_side_topologies({tri_6_factory(), tri_6_factory(), line_3_factory(), line_3_factory(), line_3_factory()});
entry.initialized = true;
}

Expand All @@ -627,7 +620,7 @@ namespace Iotm {

if (!entry.initialized) {
entry.set_valid_spatial_dimensions({false, false, false, true});
entry.set_side_topologies({quad_4_factory(), quad_4_factory()});
entry.set_side_topologies({quad_4_factory(), quad_4_factory(), line_2_factory(), line_2_factory(), line_2_factory(), line_2_factory()});
entry.initialized = true;
}

Expand All @@ -640,7 +633,7 @@ namespace Iotm {

if (!entry.initialized) {
entry.set_valid_spatial_dimensions({false, false, false, true});
entry.set_side_topologies({quad_8_factory(), quad_8_factory()});
entry.set_side_topologies({quad_8_factory(), quad_8_factory(), line_3_factory(), line_3_factory(), line_3_factory(), line_3_factory()});
entry.initialized = true;
}

Expand All @@ -653,7 +646,7 @@ namespace Iotm {

if (!entry.initialized) {
entry.set_valid_spatial_dimensions({false, false, false, true});
entry.set_side_topologies({quad_9_factory(), quad_9_factory()});
entry.set_side_topologies({quad_9_factory(), quad_9_factory(), line_3_factory(), line_3_factory(), line_3_factory(), line_3_factory()});
entry.initialized = true;
}

Expand Down

0 comments on commit 1671ba2

Please sign in to comment.