Skip to content

Commit

Permalink
Merge pull request idaholab#25575 from GiudGiud/PR_nn_extrapo
Browse files Browse the repository at this point in the history
HOTFIX Perform the conflict search outside of the value acceptance condition
  • Loading branch information
joshuahansel authored Sep 26, 2023
2 parents 446f3f7 + 1bd7acf commit e6741bc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
29 changes: 13 additions & 16 deletions framework/src/transfers/MultiAppGeneralFieldTransfer.C
Original file line number Diff line number Diff line change
Expand Up @@ -680,30 +680,27 @@ MultiAppGeneralFieldTransfer::cacheIncomingInterpVals(
else
{
auto & val = values_ptr->second;

// Look for value conflicts
if (detectConflict(val.interp,
incoming_vals[val_offset].first,
val.distance,
incoming_vals[val_offset].second))
{
// Keep track of distance and value
const auto p = point_requests[val_offset] - _to_positions[problem_id];
registerConflict(problem_id, dof_object_id, p, incoming_vals[val_offset].second, false);
}

// We adopt values that are, in order of priority
// - valid
// - closest distance
// - the smallest rank with the same distance
// If conflict search is on, we register the overlap, but selection rules stay the same
if (!GeneralFieldTransfer::isBetterOutOfMeshValue(incoming_vals[val_offset].first) &&
(MooseUtils::absoluteFuzzyGreaterThan(val.distance, incoming_vals[val_offset].second) ||
((val.pid > pid || _search_value_conflicts) &&
((val.pid > pid) &&
MooseUtils::absoluteFuzzyEqual(val.distance, incoming_vals[val_offset].second))))
{
// Keep track of overlaps
if (detectConflict(val.interp,
incoming_vals[val_offset].first,
val.distance,
incoming_vals[val_offset].second))
{
// Keep track of distance and value
const auto p = point_requests[val_offset] - _to_positions[problem_id];
registerConflict(problem_id, dof_object_id, p, incoming_vals[val_offset].second, false);

// We could have been let in the loop by the conflict search
if (val.pid < pid)
continue;
}
val.interp = incoming_vals[val_offset].first;
val.pid = pid;
val.distance = incoming_vals[val_offset].second;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@
from_multi_app = sub
source_variable = to_main
variable = from_sub
# Some equidistant nodes
search_value_conflicts = false
[]

[from_sub_elem]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@
variable = 'from_sub from_sub'
target_variable_components = '0 1'
source_type = 'nodes nodes'
# to stabilize nearest-node results in parallel
search_value_conflicts = false
[]

[from_sub_elem]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,5 @@
variable = from_sub_elem
from_blocks = 1
to_blocks = 1
# Value conflicts search triggers a greedy search which creates a diff
search_value_conflicts = false
[]
[]

0 comments on commit e6741bc

Please sign in to comment.