Skip to content

Node numbering in node set printout when external mesh files are read#1980

Merged
ischeider merged 1 commit into4C-multiphysics:mainfrom
ischeider:bugfix_mesh_information_printout
Apr 29, 2026
Merged

Node numbering in node set printout when external mesh files are read#1980
ischeider merged 1 commit into4C-multiphysics:mainfrom
ischeider:bugfix_mesh_information_printout

Conversation

@ischeider
Copy link
Copy Markdown
Contributor

Description

If an external mesh (exodus, gmesh, ...) is read in, one can print out very detailed mesh information using

STRUCTURE GEOMETRY:
  FILE: <external_mesh_file>
  SHOW_INFO: full

In the case of full information, the node numbers of the node sets did not correlate to the external ids (which are for example relevant for RESULT DESCRIPTION), but were the internal numbers.

This fix now prints the external node ids also for the node sets (for the printout of the nodes itself it was correct before already).

BTW: It is always checked whether an external ID for a node exist (could also be invalid_external_id), but I don't know when this happens and whether these nodes without external ID can be part of a node set. Maybe someone can explain that to me.

@ischeider ischeider added the type: bug report Issues reporting a bug in the code label Apr 16, 2026
@ischeider ischeider requested a review from Copilot April 16, 2026 08:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes mesh “full” info printout so point-set node numbers align with external node IDs (matching what’s used elsewhere, e.g., result description), instead of internal indices when reading external meshes.

Changes:

  • Extend MeshInput::print(PointSet, ...) to accept an internal→external ID mapping.
  • Build the internal→external node ID mapping when printing mesh points in VerbosityLevel::full, and use it for point-set printing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/core/io/src/4C_io_mesh.hpp Updates print(PointSet, ...) API to accept an internal→external ID map.
src/core/io/src/4C_io_mesh.cpp Builds and passes internal→external node ID mapping for full verbosity, and prints point-sets using external IDs.

Comment thread src/core/io/src/4C_io_mesh.cpp Outdated
Comment thread src/core/io/src/4C_io_mesh.hpp Outdated
Comment thread src/core/io/src/4C_io_mesh.cpp Outdated
Comment thread src/core/io/src/4C_io_mesh.cpp Outdated
@mayrmt
Copy link
Copy Markdown
Member

mayrmt commented Apr 16, 2026

@ischeider are you sure, that the result description uses the external ID? Should the difference just be an offset of 1 due to starting counting at 0 (internally) and 1 (externally)?

@amgebauer
Copy link
Copy Markdown
Member

The ids of elements and nodes are broken in 4C. We cannot use the external ids provided by the input mesh since we have a lot of the id-1 assumptions all over the code base. In #733, @sebproell tried to clean that up, but faced many problems where the results depended on the internal ids (which is super weird).

Printing the external id is is quite error prone, since they are not the ones that are used for the result tests. There, we use the internal id + 1 currently. I think there is no easy fix for this (except, taking the hard way and finishing #733)

@ischeider
Copy link
Copy Markdown
Contributor Author

@mayrmt @amgebauer Okay, thanks for the very informative messages. I only noticed that the numbers in the point sets did not fit to the node coordinates. Now I wonder how people figured out the internal node number for using RESULT DESCRIPTION.

How about having something like that in the mesh information output:


        node number       |
  external   | internal   |        node coordinates         |
  ---------- | ---------- |---------------------------------|
          20 |          0 |      -4.5,      -4.5,       2.5,|
         201 |          1 |      -4.5,      -4.5,       1.5,|
         273 |          2 |      -4.5,      -3.5,       1.5,|
          28 |          3 |      -4.5,      -3.5,       2.5,|

At least, there is a chance to find out the internal node numbering.

@ischeider ischeider changed the title [Bugfix] Node numbering in node set printout when external mesh files are read Node numbering in node set printout when external mesh files are read Apr 16, 2026
@rjoussen
Copy link
Copy Markdown
Contributor

@ischeider I think printing information like this could be a nice intermediate step, as long as we cannot use external IDs internally. Maybe as a hint for figuring out what internal ID 4C assigned to a node you want to perform a result test on: I normally just find the node again in the vtk output visually. The vtk output (not input!) node numbering corresponds to the internal node numbering in my experience.

@amgebauer
Copy link
Copy Markdown
Member

I agree, we could add this to the output. However, I would print the id+1 since this is the id that is typically printed in all 4C output

@ischeider ischeider force-pushed the bugfix_mesh_information_printout branch from 0e32a7e to acc7e0a Compare April 27, 2026 15:09
@ischeider
Copy link
Copy Markdown
Contributor Author

For SHOW_INFO: full, the following type of output is generated (taken from a personal example):

Mesh consists of 6014 points and 3272 cells organized in 1 cell-blocks and 3 point-sets.

       node number       [        node coordinates         ]
  external  |internal(+1)[         X,         Y,         Z,]
------------|------------[---------------------------------]
         98 |          1 [         0,         6,        20,]
...
cell-blocks:
  cell-block 1 (): 3272 cells of type hex8
    (connectivity contains internal node numbers +1)
    1: [1, 2, 3, 4, 5, 6, 7, 8, ]
...
point-sets (internal node numbers +1):
  point-set 1 (top): 389 points
   5630, 5635, 5658, 5694, 5697, 5704, 5703, 5712, 5710, 5722, 5721, 5732,

Comment thread src/core/io/src/4C_io_mesh.cpp Outdated
Comment thread src/core/io/src/4C_io_mesh.cpp Outdated
Comment thread src/core/io/src/4C_io_mesh.cpp Outdated
@ischeider ischeider force-pushed the bugfix_mesh_information_printout branch from acc7e0a to 566a173 Compare April 28, 2026 10:05
Comment thread src/core/io/src/4C_io_mesh.cpp Outdated
Relevant for external mesh input, that is "<discretisation> GEOMETRY"
if SHOWINFO: full
@ischeider ischeider force-pushed the bugfix_mesh_information_printout branch from 566a173 to eb768f5 Compare April 28, 2026 12:59
Copy link
Copy Markdown
Contributor

@rjoussen rjoussen left a comment

Choose a reason for hiding this comment

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

Looks nice now!

@ischeider ischeider enabled auto-merge April 29, 2026 06:11
@ischeider ischeider merged commit dd555b4 into 4C-multiphysics:main Apr 29, 2026
117 of 122 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug report Issues reporting a bug in the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants