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

[Bug]: INIT_BC does not correctly capture field type #152

Open
1 task done
kivvix opened this issue Nov 21, 2023 · 0 comments
Open
1 task done

[Bug]: INIT_BC does not correctly capture field type #152

kivvix opened this issue Nov 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@kivvix
Copy link
Contributor

kivvix commented Nov 21, 2023

What happened?

It's not possible to name a template parameter as I want when I use INIT_BC macro.

Input code

template <class Field_t>
struct Dirichlet : public Bc<Field_t>
{
    INIT_BC(Dirichlet)

    void apply(Field_t& f, const cell_t& cell_out, const cell_t& cell_in,
               const value_t& value) const override
    {
        f[cell_out] = 2 * value - f[cell_in];
    }
};

What expected?

Give template parameter Field (or Field_t in this example) to INIT_BC macro.

#define INIT_BC(NAME, FIELD)                              \
    using base_t  = samurai::Bc<FIELD>;            \
    using cell_t  = typename base_t::cell_t;       \
    using value_t = typename base_t::value_t;      \
    using base_t::Bc;                              \
                                                   \
    std::unique_ptr<base_t> clone() const override \
    {                                              \
        return std::make_unique<NAME>(*this);      \
    }
INIT_BC(Dirichlet, Field_t)

What is your operating system?

Mac OS

How did you install our software?

from source

Software version

0.x.x

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@kivvix kivvix added the bug Something isn't working label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant