Possible bug stork.sh script #17152
-
Dear MOOSE team, I tried to create a new MOOSE app called "Test" using the stork script and added an action called "CustomAction". ./moose/scripts/stork.sh Test I added the action to my app using the method void
TestApp::registerAll(Factory & f, ActionFactory & af, Syntax & s)
{
ModulesApp::registerAll(f, af, s);
Registry::registerObjectsTo(f, {"TestApp"});
Registry::registerActionsTo(af, {"TestApp"});
/* register custom execute flags, action syntax, etc. here */
registerSyntax("CustomAction","TestCustom");
} But it gives me the following error
But if I change the name of the third argument to void
TestApp::registerAll(Factory & f, ActionFactory & af, Syntax & syntax)
{
ModulesApp::registerAll(f, af, syntax);
Registry::registerObjectsTo(f, {"TestApp"});
Registry::registerActionsTo(af, {"TestApp"});
/* register custom execute flags, action syntax, etc. here */
registerSyntax("CustomAction","TestCustom");
} I think the name of the third argument should be "syntax". What do you think ? Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
moose/framework/include/actions/ActionFactory.h Lines 27 to 28 in 6437ec8 This is why changing void
TestApp::registerAll(Factory & f, ActionFactory & af, Syntax & s)
{
ModulesApp::registerAll(f, af, s);
Registry::registerObjectsTo(f, {"TestApp"});
Registry::registerActionsTo(af, {"TestApp"});
/* register custom execute flags, action syntax, etc. here */
s.registerActionSyntax("CustomAction", "TestCustom");
} which should be equivalent. I can see how this is confusing, judging from the usage of this particular macro in MOOSE examples. I will make a PR to change this piece of stork source code, so that users can properly use this macro by default. Thank you! |
Beta Was this translation helpful? Give feedback.
registerSyntax
is a function-like macro, and you can see its definition here:moose/framework/include/actions/ActionFactory.h
Lines 27 to 28 in 6437ec8
This is why changing
s
tosyntax
worked, since the macro definition holds a Syntax object calledsyntax
. By looking at the definition above, it suggests that you could also leave thes
and do this: