Skip to content

Fix four input parser defects found during User Guide key inventory - #2

Open
mohalinasre wants to merge 4 commits into
developfrom
fix/input-parser-yaml-defects
Open

Fix four input parser defects found during User Guide key inventory#2
mohalinasre wants to merge 4 commits into
developfrom
fix/input-parser-yaml-defects

Conversation

@mohalinasre

Copy link
Copy Markdown
Collaborator

Four defects in the YAML input parsers, found while building an exhaustive key inventory for the User Guide. Each was re-verified against source in this clean develop checkout, not carried over from my working tree.

Behavioural (2)

zoneIO.cpp — the mesh_deformation stationary-parts block was duplicated from the domain_motion block above it. The guard was updated to mesh_deformation > stationary_parts but the read on line 164 still pointed at domain_motion > stationary_parts, so the read dereferenced an undefined node.

interfaceIO.cpp — search_method was accepted without validation. An invalid value was only caught later in nonconformalDataTransfer::create_transfer, which prints the bare string error to stdout and calls exit(1) with no reference to the key or value. Now rejected at parse time. Only stk_kdtree is supported — dataTransfer.cpp and surfaceComparator.cpp both hardcode stk::search::KDTREE, and surfaceComparator.cpp already rejects anything else via errorMsg, so this makes interfaceIO.cpp consistent with existing behaviour. The downstream exit(1) is left in place as a backstop.

Error messages (2)

controlsIO.cpp:444 — the else guarding convergence_criteria reported a missing convergence_controls block, duplicated from the check at :373. A user with a valid convergence_controls block was told to add the block they already had.

zoneIO.cpp:243 — the hint for a missing boundaries block showed an example headed boundary_conditions, which is not a valid key, and the example was itself malformed YAML (no space after the sequence dash, sibling keys not indented). Corrected to match the form used in examples/risingBubble, examples/airfoil and examples/staticDroplet.

Testing

2D build clean. Both behavioural fixes verified at runtime, logs below. No separate 3D build: none of the three files contain SPATIAL_DIM, so the preprocessed source is identical in both builds.

╔══════════════════════════════════════════════════════════════════════╗
║                                  2D                                  ║
║            Parallel fluid flow CFD package based on CVFEM            ║
║                                v0.2.0                                ║
╚══════════════════════════════════════════════════════════════════════╝

Git hash: 48728775a6e0b5c23b7567fb9f9cce46451d8cf4
Git describe: v0.2.0-76-g4872877
Command line: /home/mohnasreddine/OpenAccel-dev/build-2D/openaccel-2D.exe
Reading controls ..
Finished reading controls ..

Reading mesh ..
Validating YAML input against Exodus file
Finished validating YAML input
Registering zones
terminate called after throwing an instance of 'std::runtime_error'
  what():  Part not_a_real_part not found in the mesh

╔══════════════════════════════════════════════════════════════════════╗
║                                  2D                                  ║
║            Parallel fluid flow CFD package based on CVFEM            ║
║                                v0.2.0                                ║
╚══════════════════════════════════════════════════════════════════════╝

Git hash: 48728775a6e0b5c23b7567fb9f9cce46451d8cf4
Git describe: v0.2.0-76-g4872877
Command line: /home/mohnasreddine/OpenAccel-dev/build-2D/openaccel-2D.exe
Reading controls ..
Finished reading controls ..

Reading mesh ..
Validating YAML input against Exodus file
Finished validating YAML input
Registering zones
Finished registering zones
Registering interfaces
terminate called after throwing an instance of 'std::runtime_error'
  what():  invalid search_method 'garbage' provided for interface; only stk_kdtree is supported

Not addressed (needs your call)

Dead keys displacement_interpolation_type and thermodynamicStateOption_: struct fields with enum maps but no parser reads them. Removing them is a public-API decision, implementing them is a feature — neither is mine to make.
non_conformal_method is read from the global expert_parameters block, not per-interface, so all interfaces necessarily share one method. Documented in the guide as behaviour; flagging in case it isn't intended.

The mesh_deformation block at zoneIO.cpp:161-164 was duplicated from
the domain_motion block above it. The guard was updated to read
mesh_deformation > stationary_parts but the value read on line 164
was left pointing at domain_motion > stationary_parts.
An invalid search_method was accepted by the parser and only detected
later in nonconformalDataTransfer::create_transfer, which prints the
bare string "error" to stdout and calls exit(1) with no reference to
the offending key or value.

Only stk_kdtree is supported: dataTransfer.cpp and surfaceComparator.cpp
both hardcode stk::search::KDTREE, and surfaceComparator.cpp already
rejects anything else via errorMsg. This makes interfaceIO.cpp
consistent with that behaviour and reports the error while the input
file is still in scope.

The downstream exit(1) is left in place as a backstop.
The else branch guarding basicSettings["convergence_criteria"] reported
a missing convergence_controls block, duplicated from the preceding
check at controlsIO.cpp:373. A user with a valid convergence_controls
block and no convergence_criteria block was told to add the block they
already had.
The error message for a missing `boundaries` block printed an example
headed `boundary_conditions`, which is not a valid key. The example was
also malformed YAML: no space after the sequence dash, and sibling keys
not indented under the sequence item.

The corrected hint matches the form used in examples/risingBubble,
examples/airfoil and examples/staticDroplet.
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.

1 participant