Skip to content

Commit

Permalink
IOSS: cgns - minor tweak to decomposition algorithm to avoid 0 intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Jan 28, 2025
1 parent 47bf712 commit 94e88d4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2024 National Technology & Engineering Solutions
// Copyright(C) 1999-2025 National Technology & Engineering Solutions
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
// NTESS, the U.S. Government retains certain rights in this software.
//
Expand Down Expand Up @@ -263,13 +263,13 @@ namespace Iocgns {
size_t work2 = ord2 * m_ordinal[0] * m_ordinal[1];

// Don't decompose along m_lineOrdinal direction and Avoid decompositions 1-cell thick.
if (m_lineOrdinal & Ordinal::I || m_ordinal[0] == 1 || ord0 == 1 || m_ordinal[0] - ord0 == 1) {
if (m_lineOrdinal & Ordinal::I || m_ordinal[0] == 1 || ord0 <= 1 || m_ordinal[0] - ord0 <= 1) {
work0 = 0;
}
if (m_lineOrdinal & Ordinal::J || m_ordinal[1] == 1 || ord1 == 1 || m_ordinal[1] - ord1 == 1) {
if (m_lineOrdinal & Ordinal::J || m_ordinal[1] == 1 || ord1 <= 1 || m_ordinal[1] - ord1 <= 1) {
work1 = 0;
}
if (m_lineOrdinal & Ordinal::K || m_ordinal[2] == 1 || ord2 == 1 || m_ordinal[2] - ord2 == 1) {
if (m_lineOrdinal & Ordinal::K || m_ordinal[2] == 1 || ord2 <= 1 || m_ordinal[2] - ord2 <= 1) {
work2 = 0;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2024 National Technology & Engineering Solutions
// Copyright(C) 1999-2025 National Technology & Engineering Solutions
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
// NTESS, the U.S. Government retains certain rights in this software.
//
Expand Down Expand Up @@ -1151,3 +1151,17 @@ TEST_CASE("half_sphere")
SECTION(name) { check_split_assign(zones, load_balance_tolerance, 8, 0.9, 1.1); }
cleanup(zones);
}

TEST_CASE("hwt_cone")
{
int zone = 1;
std::vector<Iocgns::StructuredZoneData *> zones;
zones.push_back(new Iocgns::StructuredZoneData(zone++, "520x200x200"));
zones.push_back(new Iocgns::StructuredZoneData(zone++, "50x200x50"));

double load_balance_tolerance = 1.4;

std::string name = "hwt_cone_16384";
SECTION(name) { check_split_assign(zones, load_balance_tolerance, 16384, 0.9, 1.4); }
cleanup(zones);
}

0 comments on commit 94e88d4

Please sign in to comment.