Skip to content

Commit

Permalink
need to handle the interface that is connected with the domain but th…
Browse files Browse the repository at this point in the history
…e domain is not on its primary side idaholab#19995
  • Loading branch information
YaqiWang committed Jul 9, 2022
1 parent 12b5609 commit c19ab49
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions framework/include/loops/ComputeUserObjectsThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class ComputeUserObjectsThread : public ThreadedElementLoop<ConstElemRange>
std::vector<ElementUserObject *> _element_objs;
std::vector<ShapeElementUserObject *> _shape_element_objs;
std::vector<DomainUserObject *> _domain_objs;
std::vector<DomainUserObject *> _all_domain_objs;
};

// determine when we need to run user objects based on whether any initial conditions or aux
Expand Down
23 changes: 14 additions & 9 deletions framework/src/loops/ComputeUserObjectsThread.C
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ ComputeUserObjectsThread::subdomainChanged()
Interfaces::InterfaceUserObject | Interfaces::DomainUserObject,
objs);

_query.clone()
.condition<AttribThread>(_tid)
.condition<AttribInterfaces>(Interfaces::DomainUserObject)
.queryInto(_all_domain_objs);

std::vector<UserObject *> side_objs;
_query.clone()
.condition<AttribThread>(_tid)
Expand Down Expand Up @@ -104,7 +109,6 @@ ComputeUserObjectsThread::subdomainChanged()
_fe_problem.prepareMaterials(_subdomain, _tid);

querySubdomain(Interfaces::InternalSideUserObject, _internal_side_objs);
querySubdomain(Interfaces::InterfaceUserObject, _interface_user_objects);
querySubdomain(Interfaces::ElementUserObject, _element_objs);
querySubdomain(Interfaces::ShapeElementUserObject, _shape_element_objs);
querySubdomain(Interfaces::DomainUserObject, _domain_objs);
Expand Down Expand Up @@ -249,13 +253,14 @@ ComputeUserObjectsThread::onInterface(const Elem * elem, unsigned int side, Boun
queryBoundary(Interfaces::InterfaceUserObject, bnd_id, interface_objs);

bool has_domain_objs = false;
if (!_domain_objs.empty())
for (const auto * const domain_uo : _domain_objs)
if (domain_uo->shouldExecuteOnInterface())
{
has_domain_objs = true;
break;
}
// we need to check all domain user objects because a domain user object may not active
// on the current subdomain but should be executed on the interface that it attaches to
for (const auto * const domain_uo : _all_domain_objs)
if (domain_uo->shouldExecuteOnInterface())
{
has_domain_objs = true;
break;
}

// if we do not have any interface user objects and domain user objects on the current
// interface
Expand Down Expand Up @@ -284,7 +289,7 @@ ComputeUserObjectsThread::onInterface(const Elem * elem, unsigned int side, Boun
for (const auto & uo : interface_objs)
uo->execute();

for (auto & uo : _domain_objs)
for (auto & uo : _all_domain_objs)
if (uo->shouldExecuteOnInterface())
{
uo->preExecuteOnInterface();
Expand Down

0 comments on commit c19ab49

Please sign in to comment.