Skip to content

Commit

Permalink
Merge branch 'develop' into maintenance/copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
gardner48 authored Jan 9, 2025
2 parents 67142aa + 792686d commit 1ce017c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/check-swig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }}
runs-on: ubuntu-latest
steps:
- name: Install pcre
run: |
sudo apt install libpcre3-dev
- name: Install swig
run: |
git clone https://github.com/sundials-codes/swig
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/ubuntu-clang-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ jobs:
logging_level: [0, 1, 2, 3, 4, 5]

steps:
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "14.0"

- uses: actions/checkout@v4

- name: Configure CMake
Expand Down Expand Up @@ -70,11 +65,6 @@ jobs:
profiling: ['OFF', 'ON']

steps:
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "14.0"

- uses: actions/checkout@v4

- name: Configure CMake
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@

### Bug Fixes

Fixed bug in the ARKODE SPRKStep `SPRKStepReInit` function and `ARKodeReset` function
with SPRKStep that could cause a segmentation fault when compensated summation is not
used.

### Deprecation Notices

## Changes to SUNDIALS in release 7.2.1

### New Features and Enhancements

Unit tests were separated from examples. To that end, the following directories
Unit tests were separated from examples. To that end, the following directories
were moved out of the `examples/` directory to the `test/unit_tests` directory:
`nvector`, `sunmatrix`, `sunlinsol`, and `sunnonlinsol`.

Expand Down
2 changes: 1 addition & 1 deletion doc/arkode/guide/source/Mathematics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ arise from the **separable** Hamiltonian system
where

.. math::
f_1(t, q) \equiv \frac{\partial V(t, q)}{\partial q}, \qquad
f_1(t, q) \equiv -\frac{\partial V(t, q)}{\partial q}, \qquad
f_2(t, p) \equiv \frac{\partial T(t, p)}{\partial p}.
When *H* is autonomous, then *H* is a conserved quantity. Often this corresponds
Expand Down
2 changes: 1 addition & 1 deletion doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SPRKStep initialization and deallocation functions
This function allocates and initializes memory for a problem to
be solved using the SPRKStep time-stepping module in ARKODE.
:param f1: the name of the C function (of type :c:func:`ARKRhsFn()`) defining :math:`f_1(t,q) = \frac{\partial V(t,q)}{\partial q}`
:param f1: the name of the C function (of type :c:func:`ARKRhsFn()`) defining :math:`f_1(t,q) = -\frac{\partial V(t,q)}{\partial q}`
:param f2: the name of the C function (of type :c:func:`ARKRhsFn()`) defining :math:`f_2(t,p) = \frac{\partial T(t,p)}{\partial p}`
:param t0: the initial value of :math:`t`
:param y0: the initial condition vector :math:`y(t_0)`
Expand Down
4 changes: 4 additions & 0 deletions doc/shared/RecentChanges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@

**Bug Fixes**

Fixed bug in the ARKODE SPRKStep :c:func:`SPRKStepReInit` function and
:c:func:`ARKodeReset` function with SPRKStep that could cause a segmentation
fault when compensated summation is not used.

**Deprecation Notices**
7 changes: 5 additions & 2 deletions src/arkode/arkode_sprkstep.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0,
step_mem->istage = 0;

/* Zero yerr for compensated summation */
N_VConst(ZERO, step_mem->yerr);
if (ark_mem->use_compensated_sums) { N_VConst(ZERO, step_mem->yerr); }

return (ARK_SUCCESS);
}
Expand Down Expand Up @@ -309,7 +309,10 @@ int sprkStep_Reset(ARKodeMem ark_mem, SUNDIALS_MAYBE_UNUSED sunrealtype tR,
retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem);
if (retval != ARK_SUCCESS) { return (retval); }

N_VConst(SUN_RCONST(0.0), step_mem->yerr);
if (ark_mem->use_compensated_sums)
{
N_VConst(SUN_RCONST(0.0), step_mem->yerr);
}
return (ARK_SUCCESS);
}

Expand Down
14 changes: 7 additions & 7 deletions test/unit_tests/arkode/C_serial/ark_test_forcingstep.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ static int f_forward_2(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data
}

/* Integrates the ODE
*
*
* y' = [t / y] + [1 / y]
*
*
* with initial condition y(0) = 1 and partitioning specified by the square
* brackets. We integrate to t = 1 and check the error against the exact
* solution y(t) = |t + 1|.
Expand Down Expand Up @@ -121,10 +121,10 @@ static int f_mixed_direction_2(sunrealtype t, N_Vector z, N_Vector zdot,
}

/* Integrates the ODE
*
*
* y_1' = y_2 - t
* y_2' = t - y_1
*
*
* with initial condition y(0) = [1, 1]^T backward in time to t = -1, then
* forward to t = 0.4, and backward to t = 0. We apply a splitting method using
* a component partitioning and check that the numerical solution is close to
Expand Down Expand Up @@ -198,9 +198,9 @@ static int test_mixed_directions(SUNContext ctx)
}

/* Integrates the ODE
*
*
* y' = [t / y] + [1 / y]
*
*
* with initial condition y(0) = 1 and partitioning specified by the square
* brackets. We integrate to t = 1 then reinitialize the forcing method by
* swapping the SUNSteppers and updating the initial condition to y(1) = -1.
Expand Down Expand Up @@ -269,7 +269,7 @@ static int test_reinit(SUNContext ctx)
return fail;
}

int main()
int main(void)
{
SUNContext ctx = NULL;
SUNErrCode err = SUNContext_Create(SUN_COMM_NULL, &ctx);
Expand Down

0 comments on commit 1ce017c

Please sign in to comment.