Hi Shouvik,
1. You can create a directory called examples or problems within your directory of application name (named after birds or animals usually as per the MOOSE tradition) and put your .
Your_App_Name contents:
1. src
2. include
3. tests
4. lib
5. doc
6. units
7. some files derived from stork
8. CREATE the directories examples/ or problems/ HERE.2. Then, you can run your input file in terminal by jumping into the directory containing your_app_name-opt executable as:
$ mpiexec -n 4 ./your_app_name-opt -i ~/path/to/sample-example.i
(in parallel)
Provided your moose directory and app directory are within the $HOME/projects/ folder, then the commnad becomes:
$ mpiexec -n 4 ./your_app_name-opt -i ~/projects/your_app_name/examples/sample-example.i
The number 4 may be any number depending upon the nproc.
or
$ ./your_app_name-opt -i ~/path/to/sample-example.i
(serial)
If the executable and input file sample-example.i are in same directory, then you need to be in the directory where the executable is located and type
$ ./your_app_name-opt -i sample-example.i
$ mpiexec -n 4 ./your_app_name-opt -i sample-example.i
2. The application which are based upon MOOSE and the moose modules, have the same folder structure with the MOOSE framework and thus when we create the derived class of some Moose kernels or materials or ICS or BCs or auxkernels or so on; we give a similar structure in our user application.
So, for the material class MathFreeEnergy (
https://github.com/idaholab/moose/blob/devel/modules/phase_field/src/materials/MathFreeEnergy.C) of phase field module; if you are going to create a derived class, for example:
DerivedMathFreeEnergy, you will put it in
~/projects/your_app_name/src/materials/DerivedMathFreeEnergy.C and the corresponding header file in
~/projects/your_app_name/include/materials/DerivedMathFreeEnergy.h . To make this files recognizable to the MOOSE framework via your_app_name's executable, you need to register these material classes in
~/projects/your_app_name/src/base/Your_app_nameApp.C in this way:
...
// Materials
#include "DerivedMathFreeEnergy.h"
...
template<>
...
// External entry point for dynamic object registration
extern "C" void Your_app_nameApp__registerObjects(Factory & factory) { Your_app_nameApp::registerObjects(factory); }
void
Your_app_nameApp::registerObjects(Factory & factory)
{
...
registerMaterial(DerivedMathFreeEnergy);
...
}
Yours Sincerely,
Anil Kunwar