Node numbering in node set printout when external mesh files are read#1980
Conversation
There was a problem hiding this comment.
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. |
|
@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)? |
|
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) |
|
@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 How about having something like that in the mesh information output: At least, there is a chance to find out the internal node numbering. |
|
@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. |
|
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 |
0e32a7e to
acc7e0a
Compare
|
For |
acc7e0a to
566a173
Compare
Relevant for external mesh input, that is "<discretisation> GEOMETRY" if SHOWINFO: full
566a173 to
eb768f5
Compare
Description
If an external mesh (exodus, gmesh, ...) is read in, one can print out very detailed mesh information using
In the case of
fullinformation, the node numbers of the node sets did not correlate to the external ids (which are for example relevant forRESULT 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.