(20 comments)

MooseObject Constructor Change

We are updating the constructors in MOOSE, which may be the largest change to MOOSE that we have attempted. We will do our best to keep the transition seamless, but unforeseen problems are likely, so please be patient as we make these changes.

What is Changing?

The old constructors took two arguments:

MyObject(const std::string & name, InputParameters parameters);

This will be changing to:

MyObject(const InputParameters & parameters);

Notice, that the object now accepts a const reference to an InputParameters object. The InputParameter objects are now being stored in a single location and the object are provided a reference.

Why is this Changing?

There are a number of reasons this change is being made:

  1. The "name" variable is not needed, this already is stored as a parameter
  2. The InputParameters object was copied throughout the object inheritance and in some cases a single object would have multiple copies of the InputParameters.
  3. The MOOSE team is developing a "control logic" system to allow for changing parameters on the fly during a simulation. So, with this changes the parameters may be modified by the control logic system without having to access the MooseObject iteself.

How will the changes be implemented?

  1. The MOOSE framework will be updated with a second constructor and new methods for registration, the old constructors in the application objects will continue to operate but produce a warning that you are using deprecated constructors.
  2. The code in moose/test and moose/modules will be migrated to the new constructors, again two sets of constructors will exists to maintain legacy behavior.
  3. Each of the applications will be updated to utilize the new constructors and the old constructors will be removed.
  4. Upon completion of updating the applications the deprecated constructors will be removed from MOOSE and the modules.

How can I update my application?

To update your application the following steps should be followed.

1. Redefine MOOSE registration macros

Until the deprecated, two argument constructors are removed from MOOSE it is required that you update three macros within your application in order to update to the new, single argument constructors.

Note, these macro changes are temporary. When all applications are updated these macros will be able to be removed.

For example, if your application is named DungBeetle, make the following changes in your DungBeetleApp.C file located in /src/base directory.

void
DungBeetleApp::registerApps()
{
#undef  registerApp
#define registerApp(name) AppFactory::instance().reg<name>(#name)
  registerApp(DungBeetleApp);
#undef  registerApp
#define registerApp(name) AppFactory::instance().regLegacy<name>(#name)
}
void
DungBeetleApp::registerObjects(Factory & factory)
{
#undef registerObject
#define registerObject(name) factory.reg<name>(stringifyName(name))

  registerDiracKernel ...

#undef registerObject
#define registerObject(name) factory.regLegacy<name>(stringifyName(name))
}
void
DungBeetleApp::associateSyntax(Syntax & syntax, ActionFactory & action_factory)
{

#undef registerAction
#define registerAction(tplt, action) action_factory.reg<tplt>(stringifyName(tplt), action)

  registerAction ...

#undef registerAction
#define registerAction(tplt, action) action_factory.regLegacy<tplt>(stringifyName(tplt), action)
}

2. Update your object constructors

After updating the macros, you now need to update the C++ constructors. To assist in this process a script is provided in the moose/scripts directory. Run the following commands to execute the script.

cd ~/projects/DungBeetle
~/projects/moose/scripts/update_constructors.py

Hopefully, this will make all the necessary changes to your application. However, it is impossible to account for all situations in a script so chances are you will need to manually fix some of your code.

Current rating: 5

Comments

lw4992 3 years, 9 months ago

I like it!

Link | Reply
Currently unrated

Jaime 5 months ago

For a survival knkfе I would go with a plain edge.

Link | Reply
Currently unrated

Pandora Jewellery 1 year, 7 months ago

pandora charms can be combined with beautiful necklaces and bracelets to create a unique look for; pandora jewelry Online shopping from a great selection at Jewellery Store. pandora bracelets pandora Jewellery,Shop our selection of engagement rings, wedding rings, diamonds, gemstones, metals and more.

Link | Reply
Currently unrated

BB&T customer service 1 year, 4 months ago

I'm glad to see the great detail here!.

Link | Reply
Currently unrated

Gmail login 1 year, 2 months ago

MooseObject constructor change

Link | Reply
Currently unrated

Who Can Do My Homework For Me 5 months, 3 weeks ago

Many startup leaders however are knowing that there’s actually not enough talent out there to fill all their open positions specially when they ought to compete with company giants which includes Google.

Link | Reply
Currently unrated

saritax 5 months, 1 week ago

MooseObject constructor change.

Link | Reply
Currently unrated

vedant 5 months ago

User have now in whole have so small time to prove him self and they have no more time for the waste so http://commandpromptwindows10.com now here one article also to get our data also easily for the working and by the help of this article. we can save this.

Link | Reply
Currently unrated

Jasa Service Jam Tangan 4 months, 2 weeks ago

We are updating the constructors in MOOSE, which may be the largest change to MOOSE <a href="http://bit.ly/BAfreelnce">freelancer tips</a> that we have attempted. We will do our best to keep the transition seamless, but unforeseen problems are likely, so please be patient as we make these changes.

What is Changing?

Link | Reply
Currently unrated

freelancer tips 4 months, 2 weeks ago

ketinggalan bro

Link | Reply
Currently unrated

Serum AHC 2 months, 1 week ago

Tinh Chất AHC Capture White Solution Max Ampoule

Link | Reply
Currently unrated

Academic writing app 2 months, 1 week ago

Good update.

Link | Reply
Currently unrated

visitheer 2 months, 1 week ago

Keep up the superb work, I read few posts on this internet site and I conceive that your website is real interesting and contains lots of good info.

Link | Reply
Currently unrated

tranzactive 2 months, 1 week ago


[url]https://tranzactive.com/walgreens-listens-survey/[/url]
[url]https://realcardnumbers.club[/url]
Thanks for Your writing i found them interesting

Link | Reply
Currently unrated

sewa mobil bandung 1 month, 3 weeks ago

insha allah berkah

Link | Reply
Currently unrated

rootmasterapk 1 month, 3 weeks ago

Sometime Constructor Change is necessary so you need to follow it as much as you can.

Link | Reply
Currently unrated

sewa mobil crv bandung 4 weeks ago

insha allah berkah dunia akhirat

Link | Reply
Currently unrated

here 4 weeks ago



Need to know how to find applebees gift card balance <a href="https://giftcardbalance.us/applebees-gift-card-balance/">here</a>

Link | Reply
Currently unrated

here 4 weeks ago

Need to know how to find applebees gift card balance

Link | Reply
Currently unrated

ifreegiveaways.net 1 week, 2 days ago

Utilize multiple save slots instead of overwriting the same one. Every now and then, use a new one. You may find in the future that you would like to resume your game from a different point. If you only save in one slot, you will have to start the game over in order to get back to that spot.

Link | Reply
Currently unrated

New Comment

required

required (not published)

optional

R&D 100

Recent Blog Posts

Using our new clang-format Style

2 years, 1 month ago

Steady State Algorithm Change

2 years, 10 months ago

Making an App inherit from an App

2 years, 11 months ago

Changing a published API (Deprecation)

2 years, 11 months ago

DiscreteMaterial Objects

3 years, 1 month ago

Recent Posts

Archive

2017
2016
2015
2014

Tags

Authors

Feeds

RSS / Atom