Skip to content

Use non-deprecated methods for getting libMesh node points#3963

Merged
pshriwise merged 1 commit into
openmc-dev:developfrom
loganharbour:libmesh_deprecated
Jun 9, 2026
Merged

Use non-deprecated methods for getting libMesh node points#3963
pshriwise merged 1 commit into
openmc-dev:developfrom
loganharbour:libmesh_deprecated

Conversation

@loganharbour

@loganharbour loganharbour commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

The "copy" constructor for Node (see https://github.com/libMesh/libmesh/blob/cc84387bbd96e12d2d12986402ec8bba282fc0c4/include/geom/node.h#L76) is deprecated.

Builds with current libmesh with --disable-deprecated will fail to compile. Get a reference to the node and use operator() (from parent Point) instead.

See these build failures from Salamander (with cardinal and libmesh --disable-deprecated):

/tmp/build/salamander/cardinal/contrib/openmc/src/mesh.cpp: In member function 'virtual openmc::Position openmc::LibMesh::sample_element(int32_t, uint64_t*) const':
/tmp/build/salamander/cardinal/contrib/openmc/src/mesh.cpp:3673:36: error: use of deleted function 'libMesh::Node::Node(const libMesh::Node&)'
 3673 |     auto node_ref = elem.node_ref(i);
      |                                    ^
In file included from /tmp/build/salamander/moose/libmesh/installed/include/libmesh/elem.h:29,
                 from /tmp/build/salamander/moose/libmesh/installed/include/libmesh/dof_map.h:36,
                 from /tmp/build/salamander/cardinal/contrib/openmc/include/openmc/mesh.h:32,
                 from /tmp/build/salamander/cardinal/contrib/openmc/src/mesh.cpp:1:
/tmp/build/salamander/moose/libmesh/installed/include/libmesh/node.h:79:3: note: declared here
   79 |   Node (const Node & n) = delete;
      |   ^~~~
/tmp/build/salamander/cardinal/contrib/openmc/src/mesh.cpp: In member function 'virtual openmc::Position openmc::LibMesh::vertex(int) const':
/tmp/build/salamander/cardinal/contrib/openmc/src/mesh.cpp:3703:47: error: use of deleted function 'libMesh::Node::Node(const libMesh::Node&)'
 3703 |   const auto node_ref = m_->node_ref(vertex_id);
      |                                               ^
/tmp/build/salamander/moose/libmesh/installed/include/libmesh/node.h:79:3: note: declared here
   79 |   Node (const Node & n) = delete;
      |   ^~~~

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@loganharbour

Copy link
Copy Markdown
Contributor Author

@pshriwise easy one for ya.

@nuclearkevin nuclearkevin requested a review from pshriwise June 8, 2026 21:16

@nuclearkevin nuclearkevin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @loganharbour! If @pshriwise doesn't have any problems with this, I'll merge it in a day or two.

@pshriwise pshriwise left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. Thanks @loganharbour!

@pshriwise pshriwise merged commit 9985658 into openmc-dev:develop Jun 9, 2026
17 checks passed
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

Successfully merging this pull request may close these issues.

3 participants