Using and Registering Kernels

676 views
Skip to first unread message

Mustafa Al Hubail

unread,
Jan 1, 2016, 9:32:16 PM1/1/16
to moose-users
Hello all,

I am a new MOOSE user. I am looking at the examples to have an idea how the system works, and I am trying to use kernels from different modules.

The question is when I want to use a kernel, do I have to copy the .c and .h files to the "src" folder and the "include" folder of my application file? or do I just register the files into my App.c file? When I tried to just register the files, I get this error when I type "make" in the file directory:


MOOSE Compiling C++ (in opt mode) /home/moose/projects/moose/modules/navier_stokes/src/base/NavierStokesApp.C...
/home/moose/projects/moose/modules/navier_stokes/src/base/NavierStokesApp.C:69:24: fatal error: Convection.h: No such file or directory
 #include "Convection.h"
                        ^
compilation terminated.
make: *** [/home/moose/projects/moose/modules/navier_stokes/src/base/NavierStokesApp.x86_64-unknown-linux-gnu.opt.lo] Error 1



 Also, When I copied the .c and .h files to the folders and registered the kernel in the App.c file, the "make" command seems it be working; however, when I try to run the input file using peacock, I get this error:

Using Executable: /home/moose/projects/moose/modules/navier_stokes/navier_stokes-opt
Bus::open: Can not get ibus-daemon's address.
IBusInputContext::createInputContext: no connection to ibus-daemon

*** ERROR ***
A 'Convection' is not a registered object.

We loaded objects from the following libraries and still couldn't find your object:
        (NONE)

Make sure you have compiled the library and either set the "library_path" variable in your input file or exported "MOOSE_LIBRARY_PATH".

Stack frames: 13
0: libMesh::print_trace(std::ostream&)
1: Factory::reportUnregisteredError(std::string const&) const
2: Factory::getValidParams(std::string const&)
3: MooseObjectAction::MooseObjectAction(InputParameters)
4: AddKernelAction::AddKernelAction(InputParameters)
5: boost::shared_ptr<Action> buildAction<AddKernelAction>(InputParameters)
6: ActionFactory::create(std::string const&, std::string const&, InputParameters)
7: Parser::parse(std::string const&)
8: MooseApp::setupOptions()
9: MooseApp::run()
10: main
11: __libc_start_main
12: /home/moose/projects/moose/modules/navier_stokes/navier_stokes-opt() [0x40c943]
[0] /home/moose/projects/moose/framework/src/base/Factory.C, line 173, compiled Dec 22 2015 at 15:34:05


Then, how to register the kernels? is it just by going to the App.C and type #include "kernel.h"?


Thank you and happy new year,
-Mustafa

Daniel Schwen

unread,
Jan 1, 2016, 10:15:33 PM1/1/16
to moose-users

Look in mooseapp. The include is not enough, you need a registerXXXXX call. Search for the Diffusion kernel fit example.


--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/bb4cc98f-32ef-4cc0-a295-251ec57d3b94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexander Lindsay

unread,
Jan 1, 2016, 10:42:27 PM1/1/16
to moose...@googlegroups.com
Shouldn't his application have access to module classes without copying them to his app directory?

Mustafa Al Hubail

unread,
Jan 2, 2016, 10:23:44 PM1/2/16
to moose-users
Hello Daniel,

Could you please elaborate more on how to register a kernel? I am not an expert using this type of a system.

Thanks,
-Mustafa

YananHe

unread,
Jan 2, 2016, 10:35:20 PM1/2/16
to moose-users
Hi Mustafa,

You can take a look at   http://www.mooseframework.com/wiki/MooseExamples/Example_02/

Register Object.

May it can help.



------------------

Yanan He

 P. R. China

------------------ Original ------------------
From:  "Mustafa Al Hubail";<huba...@gmail.com>;
Date:  Jan 3, 2016
To:  "moose-users"<moose...@googlegroups.com>;
Subject:  Re: Using and Registering Kernels
--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.

Andrs, David

unread,
Jan 4, 2016, 10:09:05 AM1/4/16
to moose...@googlegroups.com
MOOSE modules already have a Convection kernel. So, if you copy those files into your app and link against modules, you have a problem - kernel names _have_ to be unique.

The question is, why you need to copy the kernel:

1) If you need a special version, you have to use a different name.
2) If you want to use the one from modules, there is no need to copy those file and just use the existing one.

--
David

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.
Reply all
Reply to author
Forward
0 new messages