The oommf/app/oxs/contrib/extra_patches/ directory contains
supplemental patch sets, separate from the individual extension patch
sets at the contrib/ directory level.

************************************************************************
*** PATCH SET oommf-2dpbc **********************************************
The oommf-2dpbc-*.patch files are a patch collection that can be
applied directly to the contrib/2dpbc-Oct-2013 source files, which
were originally downloaded from

   https://sourceforge.net/projects/oommf-2dpbc/

These patches should be applied in the order

   A) oommf-2dpbc-modernization.patch
   B) oommf-2dpbc-simplification.patch
   C) oommf-2dpbc-ovf2.patch
   D) oommf-2dpbc-parallelization.patch

Patch (A) is simply a copy of the (at this time current) oxspkg patch

   2dpbc-Oct-2013-20260602.patch

which brings the sourceforge sources up to date with the Sep 2026
version of OOMMF.

Patch (B) pulls duplicate code from pbc_demag.cc and
pbc_demag-threaded.cc into the former. This simplifies the subsequent
two patch sets.

Patch (C) provides an option to read and write the 2D PBC demag tensor
as a single 6-vector OVF 2 file, as opposed to the default two
3-vector OVF 1 files.

Patch (D) runs the 2D PBC demag tensor computation in parallel, using
the C++11 std::future and std::async primatives. This greatly speeds
up the tensor computation on core-rich machines.

These patches together form the new oxspkg combined patch

   2dpbc-Oct-2013-20260922.patch

-mjd, 22-Sep-2026

There is an additional bug that forces some off-diagonal tensor elements
to zero that shouldn't be zero, and vice-versa. The code in question has

    if ((comp == xy || comp == xz || comp == yz) && x * y == 0) return 0.0;

where comp denotes the tensor component, i.e., Nxy, Nxz, or Nyz. Symmetry
considerations show that tensor Nuv, with u != v, is zero if the offset
places it centered on the uv-plane. Thus this code should read


    if(((comp == xy || comp == xz) && x == 0.0)
       || ((comp == xy || comp == yz) && y == 0.0)
       || ((comp == xz || comp == yz) && z == 0.0)) return 0.0

or the equivalent. This bug avoided earlier detection because all the
sample test .mif files are restricted to a single z value (i.e., all cell
offsets lie in the same plane), for which the original test is sufficient.

This code replacement is performed by oommf-2dpbc-zero_bug.patch. It is
combined with all previous patches for 2dpbc-Oct-2013 packing in the
oxspkg combined patch

   2dpbc-Oct-2013-20260927.patch

-mjd, 27-Sep-2026

************************************************************************
