Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create bsplines on a subset of a periodic domain #699

Open
EmilyBourne opened this issue Dec 9, 2024 · 1 comment
Open

Create bsplines on a subset of a periodic domain #699

EmilyBourne opened this issue Dec 9, 2024 · 1 comment
Labels

Comments

@EmilyBourne
Copy link
Collaborator

B-splines are created as periodic or non-periodic objects, but the periodicity is collected from the dimension. This means that it is not possible to create a B-spline on a sub-section of the domain without creating a new dimension. It would be simpler if the periodicity was a template parameter of the bsplines (which could be the periodicity of the dimension by default).

I.e. I would like to be able to do:

class DimPeriodic {
    static constexpr bool PERIODIC = true;
};

struct GridP : ddc::NonUniformPointSampling<DimPeriodic>
{
};

struct BSplinesP : UniformBSplines<DimPeriodic, 3>
{
};

void main() {
    ddc::Coordinate<DimPeriodic> p_min(0.0);
    ddc::Coordinate<DimPeriodic> p_max(2.0 * M_PI);
    std::size_t n_p(20);
    std::vector<ddc::Coordinate<DimPeriodic>> p_grid(n_p);
    p_grid[0] = p_min;
    for(std::size_t i(0); i < n_p-1; ++i)
        p_grid[i] = p_min + (p_max - p_min) / (n_p - 1);
    init_discrete_space<GridP>(p_grid);
    ddc::Coordinate<DimPeriodic> p_mid(M_PI);
    init_discrete_space<BSplinesP>(p_min, p_mid);
    ...
}
@tpadioleau
Copy link
Member

I see, this is a new use case but it should be possible indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants