Creating custom syntax for LPBF process #31881
Replies: 3 comments 8 replies
-
|
Actually, I am still not clear whether my action should inherit from |
Beta Was this translation helpful? Give feedback.
-
|
Hello
MooseObjectAction ONLY if the action creates objects one by one.
Action as the base class (or PhysicsBase) is when the action creates more than one object of different types.
Yes see Moose.C for all the tasks and the syntax they are associated with.
Yes, the name of the syntax block here is accessed using |
Beta Was this translation helpful? Give feedback.
-
|
Hi @GiudGiud , [Mesh]
[fmg]
type = FileMeshGenerator
file = 'refined_mesh.e'
use_for_exodus_restart = False
skip_partitioning=False
[]
[]I register the action with the task in my registerMooseAction("MalamuteApp", SetupBaseLPBF, "add_mesh_generator");I have the following block in my act() method: if(_current_task == "add_mesh_generator" && !_input_mesh.empty() ){
const std::string type = "FileMeshGenerator";
InputParameters params = _factory.getValidParams(type);
//Setup parameters
params.set<MeshFileName>("file") = _input_mesh;
params.set<bool>("use_for_exodus_restart") =false;
params.set<bool>("skip_partitioning") = false;
_problem.addMeshGenerator(type, "fmg", params); // I get syntax error in this method. Please, suggest me how to fix it.
} But it looks like, we don't have addMeshGenerator() method. Which method should I use to accomplish mesh creation ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @GiudGiud ,
I have an moose input file to simulate LPBF (Laser Power-Bed-Fusion) process : #31878
Now, I want to simplify my input file using custom syntax by creating an action. I am following the guidelines on Action system. I have a few questions regarding the action.
It looks like my custom action should inherit from
MooseObjectActionas I am simply trying to recreate the input blocks from my input file. In which cases, the user would have to inherit fromAction?Instead of creating new tasks, I am thinking to associate my custom actions to pre-existing tasks in MOOSE such as
add_aux_variableandadd_variable. Is there any page in MOOSE that shows the list of available tasks ? to which I can associate my action.In my
act(), can I directly access the name of the syntax blocks in the input file ?[MyCustomAction] [./test1] type=AddVariable [../] []For example, in the above input file block, can I get the string
test1which is the name of the input block while writing my action ?FYI: My full input file is given below.
Beta Was this translation helpful? Give feedback.
All reactions