Skip to content
Snippets Groups Projects
Commit e38e8dd5 authored by wenqing's avatar wenqing
Browse files

[SourceTerm] Fixed a bug in Python source term

parent 72ea274a
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "SourceTermCollection.h" #include "SourceTermCollection.h"
#include <range/v3/view/filter.hpp>
namespace ProcessLib namespace ProcessLib
{ {
void SourceTermCollection::addSourceTermsForProcessVariables( void SourceTermCollection::addSourceTermsForProcessVariables(
...@@ -34,7 +36,12 @@ void SourceTermCollection::addSourceTermsForProcessVariables( ...@@ -34,7 +36,12 @@ void SourceTermCollection::addSourceTermsForProcessVariables(
void SourceTermCollection::integrate(const double t, GlobalVector const& x, void SourceTermCollection::integrate(const double t, GlobalVector const& x,
GlobalVector& b, GlobalMatrix* jac) const GlobalVector& b, GlobalMatrix* jac) const
{ {
for (auto const& st : _source_terms) // For parallel computing with DDC, a partition may not have source term
// but a nullptr is assigned to its element in _source_terms.
auto non_nullptr = [](std::unique_ptr<SourceTerm> const& st)
{ return st != nullptr; };
for (auto const& st : _source_terms | ranges::views::filter(non_nullptr))
{ {
st->integrate(t, x, b, jac); st->integrate(t, x, b, jac);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment