Skip to content

Conversation

gouarin
Copy link
Contributor

@gouarin gouarin commented Jun 3, 2025

Description

A new issue has been detected in the set algebra with the difference operator. This PR solves this issue.

Related issue

The following example did not return a result, but the interval [14, 15[ is the correct answer.

LevelCellArray<1> domain(5);
CellArray<1> ca;

domain.add_interval_back({0, 32}, {});
ca[5].add_interval_back({30, 32}, {});
ca[4].add_interval_back({14, 15}, {});

xt::xtensor_fixed<int, xt::xshape<1>> translation{1};

std::size_t level = 5;
int i             = 2;

auto boundaryCells       = difference(ca[level], translate(self(domain).on(level), -translation)).on(level);
auto translated_boundary = translate(boundaryCells, -i * translation);
auto refine_subset       = intersection(translated_boundary, ca[level - 1]).on(level - 1);

How has this been tested?

The previous example has been added in test_subset.cpp file.

Code of Conduct

By submitting this PR, you agree to follow our Code of Conduct

  • I agree to follow this project's Code of Conduct

@gouarin gouarin force-pushed the fix-set-algebra branch from 03112e4 to 1ec6232 Compare June 3, 2025 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant