Parser error fixed by adding blank lines
When running mbdyn 1.7.3, the HighParser often fails to parse the input file correctly and execution exits with an error indicating that the structure of the input file is incorrect. A simple workaround is to add empty spaces or lines just before the input block where mbdyn reports the error.
For example, this breaks:
begin: elements;
gravity: uniform, 0.000, 0.000, 1.000, const, -9.81;
joint: 1, total joint,
fuselage_root_node + 4,
wing_starboard_root_node + 0,
position, reference, other node, null,
rotation orientation, reference, other node, eye,
position constraint,
active, active, active,
null,
orientation constraint,
active, active, active,
null;
joint: 2, total joint,
fuselage_root_node + 4,
wing_port_root_node + 8,
position, reference, other node, null,
rotation orientation, reference, other node, eye,
position constraint,
active, active, active,
null,
orientation constraint,
active, active, active,
null;
joint: 3, total joint,
fuselage_root_node + 0,
vertical_stabilizer_root_node + 2,
position, reference, other node, null,
rotation orientation, reference, other node, eye,
position constraint,
active, active, active,
null,
orientation constraint,
active, active, active,
null;
joint: 4, total joint,
vertical_stabilizer_root_node + 4,
horizontal_stabilizer_starboard_root_node + 0,
position, reference, other node, null,
rotation orientation, reference, other node, eye,
position constraint,
active, active, active,
null,
orientation constraint,
active, active, active,
null;
and gives this error:
Reading Structural(1)
Reading Gravity
Reading Joint(1)
Reading Joint(2)
Reading Joint(3)
TotalJoint(3): invalid status for position component #3 at line 143, file <KiteMain.mbd>
An error occurred during the execution of MBDyn; aborting...
This works (Note the extra lines between Joint 2 and Joint 3:
begin: elements;
gravity: uniform, 0.000, 0.000, 1.000, const, -9.81;
joint: 1, total joint,
fuselage_root_node + 4,
wing_starboard_root_node + 0,
position, reference, other node, null,
rotation orientation, reference, other node, eye,
position constraint,
active, active, active,
null,
orientation constraint,
active, active, active,
null;
joint: 2, total joint,
fuselage_root_node + 4,
wing_port_root_node + 8,
position, reference, other node, null,
rotation orientation, reference, other node, eye,
position constraint,
active, active, active,
null,
orientation constraint,
active, active, active,
null;
joint: 3, total joint,
fuselage_root_node + 0,
vertical_stabilizer_root_node + 2,
position, reference, other node, null,
rotation orientation, reference, other node, eye,
position constraint,
active, active, active,
null,
orientation constraint,
active, active, active,
null;
I've tried to find the problem with a debugger and found that the CurrToken
has a value of ENDOFFILE rather than ARG well before the actual end of the file when parsing Joint3. In the main input file, every line ends with a \n
but no \r
or ^M
are found when I search with regular expressions.