MASTmultiphysics / mast-multiphysics

Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST) - Sensitivity-enabled multiphysics FEA for design
https://www.mast-multiphysics.com
GNU Lesser General Public License v2.1
43 stars 24 forks source link

Possibly wrong assertion in solid 1D section property card #69

Closed JohnDN90 closed 4 years ago

JohnDN90 commented 4 years ago

@manavbhatia Here, should libmesh_assert(!_initialized); actually be libmesh_assert(_initialized);?

The unique_ptr should already be pointing to null before initialization and logically you would only need to clear your property card, after it has been initialized, not before. If I'm missing something, could you explain what it is?

manavbhatia commented 4 years ago

Did you mean to point to clear() instead?

I think we can remove this assert statement. It should not matter whether or not the object is initialized since all the unique_ptrs are cleared anyways.

JohnDN90 commented 4 years ago

Yes, my link was actually pointing to clear() when this issue was created, but then the line numbers changed and the link was no longer correct after we merged in some changes last week. Going forward, it might be better for me to reference the name of the file and the name of the function in the link text, so if line numbers change we don't run into this confusion.

And that sounds good. This assert statement was causing one of my unit tests to fail when I tried clearing a section property card after I had initialized it.

jdeaton commented 4 years ago

Closed in PR #70