Skip to content
New issue

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

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

Already on GitHub? # to your account

support Cabana backend #48

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

support Cabana backend #48

wants to merge 10 commits into from

Conversation

cwsmith
Copy link
Contributor

@cwsmith cwsmith commented Feb 19, 2025

This PR adds support for the Cabana backend for field creation through the high level/user API.

Todo:

  • run clang formatting
  • describe what the recursive baseType struct does for defining ValArray
  • remove numComp switch in createCoordinateField(...) and just use DataType[1][3] in the cab controller
  • add FIXME for oversized cabana datatypes for numComps == 1|2 in createCoordinateField(...)

@cwsmith cwsmith marked this pull request as ready for review February 20, 2025 13:34
@cwsmith
Copy link
Contributor Author

cwsmith commented Feb 20, 2025

@Joshua-Kloepfer Thanks for addressing the items. Can you describe how the recursive baseType struct for defining ValArray works?

Copy link
Contributor Author

@cwsmith cwsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A few comments are below.

Comment on lines +44 to +45
coordField(i, 0, 0, MeshField::Vertex) = coords[i * meshDim];
coordField(i, 0, 1, MeshField::Vertex) = coords[i * meshDim + 1];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should document the change in the field indexing order to 'entity, node, component'. For now I think the best spot for that description is on this function:

auto CreateLagrangeField() {

Comment on lines 62 to 67
template <typename T> struct baseType {
using type = T;
};
template <typename T, size_t N> struct baseType<T[N]> {
using type = typename baseType<T>::type;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a brief description of why this is needed and how it works.

Controller<ExecutionSpace, MemorySpace, DataType>,
MeshField::CabanaController<ExecutionSpace, MemorySpace,
DataType>>) {
return Ctrlr(std::max(numVtx, numEdge));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The controller needs to provide field storage for all the vertices and all the edges. It looks like this is selecting the higher of the two. Am I reading this correctly?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The Cabana Controller accepts one number for the number of tuples so I picked the larger one to make sure there was enough space for both vertices and edges.

@cwsmith
Copy link
Contributor Author

cwsmith commented Feb 26, 2025

@Joshua-Kloepfer Please address the few comments above when you get a chance. Thanks for adding the the baseType struct description.

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

Successfully merging this pull request may close these issues.

2 participants