-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not add into vectors if they do not exist #11706
Conversation
if (_displaced_nl.hasVector(_displaced_nl.timeVectorTag())) | ||
_assembly[tid]->addCachedResidual(residual, _displaced_nl.timeVectorTag()); | ||
if (_displaced_nl.hasVector(_displaced_nl.nonTimeVectorTag())) | ||
_assembly[tid]->addCachedResidual(residual, _displaced_nl.nonTimeVectorTag()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already check this in Assembly.C
void
Assembly::addCachedResidual(NumericVector<Number> & residual, TagID tag_id)
{
if (!_sys.hasVector(tag_id))
{
_cached_residual_values[tag_id].clear();
_cached_residual_rows[tag_id].clear();
return;
}
Does not this work for you? What is the issue here I am missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not. Try to run the input file attached to the issue.
Should your if statement be more like:
if (_sys.hasVector(tag_id)
i.e. assertion, not negation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, the if-statement in assembly is all right. Still we get a segfault...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, check void FEProblemBase::addCachedResidualDirectly(NumericVector<Number> & residual, THREAD_ID tid)
. There we do:
if (_nl->hasVector(_nl->timeVectorTag()))
_assembly[tid]->addCachedResidual(residual, _nl->timeVectorTag());
if (_nl->hasVector(_nl->nonTimeVectorTag()))
_assembly[tid]->addCachedResidual(residual, _nl->nonTimeVectorTag());
So I mimicked that in the DisplacedProblem
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I will check why Assembly does not take care of this.
Job Documentation on 956bf14 wanted to post the following: View the site here This comment will be updated on new commits. |
Are you fine with this fix? @andrsd |
because these is no data need to be cleaned Closes idaholab#11705
Yes. Looks good. |
Closes #11705