Skip to content

Commit

Permalink
ensure backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 committed Sep 4, 2024
1 parent 917bf35 commit d5c653d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions doc/sphinx/src/interface/metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,13 @@ classes may be allocated. The behaviours are the following:
field can be accessed from the base ``Metadata`` with the method
``Metadata::GetSPtrFluxMetadata()``. This can be used to set flags other
than the defaults or set custom prolongation/restriction operations for
the fluxes. When creating packs that include fluxes, the new flux field
will be included in the flux portion of the pack if the parent field is
in the pack.
the fluxes. Note that calling `Metadata::RegisterRefinementOps<...>()`
on the base field propagates the registered refinement operations through
to the flux `Metadata` for backward compatibility. If separate operations
are desired for the fluxes, the ordering of calls to `RegisterRefinementOps`
on the base field and the flux field matters. When creating packs that
include fluxes, the new flux field will be included in the flux portion of
the pack if the parent field is in the pack.

- If ``Metadata::Flux`` is set, this field is exchanged on shared elements
across fine-coarse boundaries when the flux correction tasks are called.
Expand Down
6 changes: 6 additions & 0 deletions src/interface/metadata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,12 @@ class Metadata {
refinement_funcs_ =
refinement::RefinementFunctions_t::RegisterOps<ProlongationOp, RestrictionOp,
InternalProlongationOp>();
// Propagate refinement operations to flux metadata for backward compatibility
if (IsSet(WithFluxes)) {
flux_metadata->refinement_funcs_ =
refinement::RefinementFunctions_t::RegisterOps<ProlongationOp, RestrictionOp,
InternalProlongationOp>();
}
}

// Operators
Expand Down

0 comments on commit d5c653d

Please sign in to comment.