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

Axom namespace issue #133

Open
sean-baccas opened this issue Feb 28, 2025 · 2 comments
Open

Axom namespace issue #133

sean-baccas opened this issue Feb 28, 2025 · 2 comments

Comments

@sean-baccas
Copy link

axom::primal::NumericArray<RealT, D> vert_array;

I believe this mention of the NumericArray is not namespaced correctly. This causes a compilation error for me, and is fixed by changing it to axom::NumericArray

@kennyweiss
Copy link
Member

Thanks @sean-baccas --
NumericArray was moved from axom's primal to its core component a few weeks ago -- LLNL/axom#1500

@srwopschall -- I'm not sure about the best way to handle this since it tracks the develop branch of axom.
Is it safe to make this change and assume tribol users are at the head of axom's develop branch?

In the immediate term, if you want to give tribol users a bit of time, something like the following should work:

  BBox elementBoundingBox( const MeshData::Viewer& mesh, IndexT eId )
  {
+    using namespace axom;                    // <-- (1) add the axom and axom::primal namespace to this function
+    using namespace axom::primal;

    BBox box;

    for ( int i{ 0 }; i < mesh.numberOfNodesPerElement(); ++i ) {
-      axom::primal::NumericArray<RealT, D> vert_array;
+      NumericArray<RealT, D> vert_array;                      // <-- (2) remove the `axom::primal` namespace
      auto vert_id = mesh.getGlobalNodeId( eId, i );
      for ( int d{ 0 }; d < D; ++d ) {
        vert_array[d] = mesh.getPosition()[d][vert_id];
      }
      box.addPoint( PointT( vert_array ) );
    }

    return box;
  }

See: https://github.com/LLNL/Tribol/blob/76e668579fd7bea20cb1a0b74c80a46d88f39691/src/tribol/search/InterfacePairFinder.cpp#L451C1-L465C4

@ebchin
Copy link
Member

ebchin commented Mar 10, 2025

Hi @kennyweiss and @sean-baccas,

Tribol is tested with the axom hash defined in our local spack package.py. Our CI is done using serac's TPLs, so we usually match the version of axom used there.

We're in the process of updating TPLs in Serac and Tribol (see here and here) and the namespace fix will be made in those PRs. If the latest axom support is needed now, Kenny's suggestion should work fine (thanks Kenny!).

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

No branches or pull requests

3 participants