-
Notifications
You must be signed in to change notification settings - Fork 16
Allow ForceModels to accept any number of models
#262
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
base: main
Are you sure you want to change the base?
Conversation
|
Forgot we'll need to bump the Cabana hash in the CI/README |
|
@streeve can we run the CI on this? I think it is at least in a state where it can work |
streeve
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great; I think the only real question is whether we want to add more testing before merge. @pabloseleson do you have a clear idea of a binary material test system that we can easily check forces/energies for in a similar way we currently do single materials (could be a separate PR)?
| KOKKOS_ASSERT( firstType < NumBaseModels ); | ||
| KOKKOS_ASSERT( secondType < NumBaseModels ); | ||
|
|
||
| return firstType != secondType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about a ternary? I think it is easier to read:
return (firstType != secondType) ? 1 : 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to you
457b0e0 to
4e891e9
Compare
|
again? |
|
git wanting to go on holiday |
e577ed9 to
9d847b1
Compare
9d847b1 to
858b01b
Compare
| static_assert( | ||
| (std::conjunction_v< | ||
| std::is_same<typename ParameterPackType::template value_type< | ||
| Indices>::model_tag, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could instead check force_tag which is slightly more restrictive. Or we can check both to be more certain if things change in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am for being more restrictive ... it is easier to loosen the restrictions later than to tighten them. And these asserts are mainly for our own protection
This is a first template for how a the Multiforce model can be changed so it accepts a unspecified number of models.
It requires some meta-template tinkering and some work still:
ParameterPackto be constructed from elements that are not default constructible ECP-copa/Cabana#855