Skip to content
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

Merged
merged 2 commits into from
Jun 18, 2018

Conversation

andrsd
Copy link
Contributor

@andrsd andrsd commented Jun 18, 2018

Closes #11705

@andrsd andrsd requested a review from fdkong June 18, 2018 16:14
fdkong
fdkong previously requested changes Jun 18, 2018
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());
}
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

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...

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@moosebuild
Copy link
Contributor

moosebuild commented Jun 18, 2018

Job Documentation on 956bf14 wanted to post the following:

View the site here

This comment will be updated on new commits.

@fdkong
Copy link
Contributor

fdkong commented Jun 18, 2018

Are you fine with this fix? @andrsd

because these is no data need to be cleaned

Closes idaholab#11705
@andrsd
Copy link
Contributor Author

andrsd commented Jun 18, 2018

Are you fine with this fix?

Yes. Looks good.

@andrsd andrsd dismissed fdkong’s stale review June 18, 2018 19:25

Code is fixed now

@permcody permcody merged commit 4f7d245 into idaholab:devel Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants