Skip to content

Commit

Permalink
working version on Windows
Browse files Browse the repository at this point in the history
working version on Windows based on suggestion from Tomas on r-package-devel
  • Loading branch information
sn248 committed Dec 13, 2024
1 parent d0489b8 commit 30230f6
Show file tree
Hide file tree
Showing 92 changed files with 13,037 additions and 32 deletions.
3 changes: 2 additions & 1 deletion cleanup
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#! /bin/sh

rm -fr src/*.o src/*.so autom4te.cache config.log config.status inst/lib/*.a
rm -fr src/*.o src/*.so autom4te.cache config.log config.status inst/lib/*.a inst/*.a
rm -fr src/sundials
rm -fr inst/lib
rm -f configure~
rm -f Makevars
rm -f config.log
rm -f config.status

2 changes: 2 additions & 0 deletions cleanup.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /bin/sh
./cleanup $*
2 changes: 2 additions & 0 deletions configure.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /bin/sh
./configure $*
419 changes: 419 additions & 0 deletions inst/include/arkode/arkode.h

Large diffs are not rendered by default.

438 changes: 438 additions & 0 deletions inst/include/arkode/arkode_arkstep.h

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions inst/include/arkode/arkode_bandpre.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* -----------------------------------------------------------------
* Programmer(s): Daniel R. Reynolds @ SMU
* -----------------------------------------------------------------
* SUNDIALS Copyright Start
* Copyright (c) 2002-2024, Lawrence Livermore National Security
* and Southern Methodist University.
* All rights reserved.
*
* See the top-level LICENSE and NOTICE files for details.
*
* SPDX-License-Identifier: BSD-3-Clause
* SUNDIALS Copyright End
* -----------------------------------------------------------------
* This is the header file for the ARKBANDPRE module, which provides
* a banded difference quotient Jacobian-based preconditioner.
* -----------------------------------------------------------------*/

#ifndef _ARKBANDPRE_H
#define _ARKBANDPRE_H

#include <sundials/sundials_nvector.h>

#ifdef __cplusplus /* wrapper to enable C++ usage */
extern "C" {
#endif

/* BandPrec inititialization function */

SUNDIALS_EXPORT int ARKBandPrecInit(void* arkode_mem, sunindextype N,
sunindextype mu, sunindextype ml);

/* Optional output functions */

SUNDIALS_EXPORT int ARKBandPrecGetWorkSpace(void* arkode_mem, long int* lenrwLS,
long int* leniwLS);
SUNDIALS_EXPORT int ARKBandPrecGetNumRhsEvals(void* arkode_mem,
long int* nfevalsBP);

#ifdef __cplusplus
}
#endif

#endif
59 changes: 59 additions & 0 deletions inst/include/arkode/arkode_bbdpre.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* -----------------------------------------------------------------
* Programmer(s): Daniel R. Reynolds @ SMU
* -----------------------------------------------------------------
* SUNDIALS Copyright Start
* Copyright (c) 2002-2024, Lawrence Livermore National Security
* and Southern Methodist University.
* All rights reserved.
*
* See the top-level LICENSE and NOTICE files for details.
*
* SPDX-License-Identifier: BSD-3-Clause
* SUNDIALS Copyright End
* -----------------------------------------------------------------
* This is the header file for the ARKBBDPRE module, for a
* band-block-diagonal preconditioner, i.e. a block-diagonal
* matrix with banded blocks.
* -----------------------------------------------------------------*/

#ifndef _ARKBBDPRE_H
#define _ARKBBDPRE_H

#include <sundials/sundials_nvector.h>

#ifdef __cplusplus /* wrapper to enable C++ usage */
extern "C" {
#endif

/* User-supplied function Types */

typedef int (*ARKLocalFn)(sunindextype Nlocal, sunrealtype t, N_Vector y,
N_Vector g, void* user_data);

typedef int (*ARKCommFn)(sunindextype Nlocal, sunrealtype t, N_Vector y,
void* user_data);

/* Exported Functions */

SUNDIALS_EXPORT int ARKBBDPrecInit(void* arkode_mem, sunindextype Nlocal,
sunindextype mudq, sunindextype mldq,
sunindextype mukeep, sunindextype mlkeep,
sunrealtype dqrely, ARKLocalFn gloc,
ARKCommFn cfn);

SUNDIALS_EXPORT int ARKBBDPrecReInit(void* arkode_mem, sunindextype mudq,
sunindextype mldq, sunrealtype dqrely);

/* Optional output functions */

SUNDIALS_EXPORT int ARKBBDPrecGetWorkSpace(void* arkode_mem, long int* lenrwBBDP,
long int* leniwBBDP);

SUNDIALS_EXPORT int ARKBBDPrecGetNumGfnEvals(void* arkode_mem,
long int* ngevalsBBDP);

#ifdef __cplusplus
}
#endif

#endif
71 changes: 71 additions & 0 deletions inst/include/arkode/arkode_butcher.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* -----------------------------------------------------------------
* Programmer(s): Daniel R. Reynolds @ SMU
* -----------------------------------------------------------------
* SUNDIALS Copyright Start
* Copyright (c) 2002-2024, Lawrence Livermore National Security
* and Southern Methodist University.
* All rights reserved.
*
* See the top-level LICENSE and NOTICE files for details.
*
* SPDX-License-Identifier: BSD-3-Clause
* SUNDIALS Copyright End
* -----------------------------------------------------------------
* This is the header file for ARKode Butcher table structures.
* -----------------------------------------------------------------*/

#ifndef _ARKODE_BUTCHER_H
#define _ARKODE_BUTCHER_H

#include <stdio.h>
#include <sundials/sundials_types.h>

#ifdef __cplusplus /* wrapper to enable C++ usage */
extern "C" {
#endif

/*---------------------------------------------------------------
Types : struct ARKodeButcherTableMem, ARKodeButcherTable
---------------------------------------------------------------*/
struct ARKodeButcherTableMem
{
int q; /* method order of accuracy */
int p; /* embedding order of accuracy */
int stages; /* number of stages */
sunrealtype** A; /* Butcher table coefficients */
sunrealtype* c; /* canopy node coefficients */
sunrealtype* b; /* root node coefficients */
sunrealtype* d; /* embedding coefficients */
};

typedef _SUNDIALS_STRUCT_ ARKodeButcherTableMem* ARKodeButcherTable;

/* Utility routines to allocate/free/output Butcher table structures */
SUNDIALS_EXPORT ARKodeButcherTable
ARKodeButcherTable_Alloc(int stages, sunbooleantype embedded);
SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_Create(int s, int q, int p,
sunrealtype* c,
sunrealtype* A,
sunrealtype* b,
sunrealtype* d);
SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_Copy(ARKodeButcherTable B);
SUNDIALS_EXPORT void ARKodeButcherTable_Space(ARKodeButcherTable B,
sunindextype* liw,
sunindextype* lrw);
SUNDIALS_EXPORT void ARKodeButcherTable_Free(ARKodeButcherTable B);
SUNDIALS_EXPORT void ARKodeButcherTable_Write(ARKodeButcherTable B,
FILE* outfile);
SUNDIALS_EXPORT sunbooleantype
ARKodeButcherTable_IsStifflyAccurate(ARKodeButcherTable B);
SUNDIALS_EXPORT int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q,
int* p, FILE* outfile);
SUNDIALS_EXPORT int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1,
ARKodeButcherTable B2,
int* q, int* p,
FILE* outfile);

#ifdef __cplusplus
}
#endif

#endif
75 changes: 75 additions & 0 deletions inst/include/arkode/arkode_butcher_dirk.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* -----------------------------------------------------------------
* Programmer(s): Daniel R. Reynolds @ SMU
* -----------------------------------------------------------------
* SUNDIALS Copyright Start
* Copyright (c) 2002-2024, Lawrence Livermore National Security
* and Southern Methodist University.
* All rights reserved.
*
* See the top-level LICENSE and NOTICE files for details.
*
* SPDX-License-Identifier: BSD-3-Clause
* SUNDIALS Copyright End
* -----------------------------------------------------------------
* This is the header file for ARKode's built-in DIRK Butcher tables.
* -----------------------------------------------------------------*/

#ifndef _ARKODE_DIRK_TABLES_H
#define _ARKODE_DIRK_TABLES_H

#include <arkode/arkode_butcher.h>

#ifdef __cplusplus /* wrapper to enable C++ usage */
extern "C" {
#endif

typedef enum
{
ARKODE_DIRK_NONE = -1, /* ensure enum is signed int */
ARKODE_MIN_DIRK_NUM = 100,
ARKODE_SDIRK_2_1_2 = ARKODE_MIN_DIRK_NUM,
ARKODE_BILLINGTON_3_3_2,
ARKODE_TRBDF2_3_3_2,
ARKODE_KVAERNO_4_2_3,
ARKODE_ARK324L2SA_DIRK_4_2_3,
ARKODE_CASH_5_2_4,
ARKODE_CASH_5_3_4,
ARKODE_SDIRK_5_3_4,
ARKODE_KVAERNO_5_3_4,
ARKODE_ARK436L2SA_DIRK_6_3_4,
ARKODE_KVAERNO_7_4_5,
ARKODE_ARK548L2SA_DIRK_8_4_5,
ARKODE_ARK437L2SA_DIRK_7_3_4,
ARKODE_ARK548L2SAb_DIRK_8_4_5,
ARKODE_ESDIRK324L2SA_4_2_3,
ARKODE_ESDIRK325L2SA_5_2_3,
ARKODE_ESDIRK32I5L2SA_5_2_3,
ARKODE_ESDIRK436L2SA_6_3_4,
ARKODE_ESDIRK43I6L2SA_6_3_4,
ARKODE_QESDIRK436L2SA_6_3_4,
ARKODE_ESDIRK437L2SA_7_3_4,
ARKODE_ESDIRK547L2SA_7_4_5,
ARKODE_ESDIRK547L2SA2_7_4_5,
ARKODE_ARK2_DIRK_3_1_2,
ARKODE_BACKWARD_EULER_1_1,
ARKODE_IMPLICIT_MIDPOINT_1_2,
ARKODE_IMPLICIT_TRAPEZOIDAL_2_2,
ARKODE_MAX_DIRK_NUM = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2
} ARKODE_DIRKTableID;

/* Accessor routine to load built-in DIRK table */
SUNDIALS_EXPORT ARKodeButcherTable
ARKodeButcherTable_LoadDIRK(ARKODE_DIRKTableID imethod);

/* Accessor routine to load built-in DIRK table */
SUNDIALS_EXPORT ARKodeButcherTable
ARKodeButcherTable_LoadDIRKByName(const char* imethod);

SUNDIALS_EXPORT const char* ARKodeButcherTable_DIRKIDToName(
ARKODE_DIRKTableID imethod);

#ifdef __cplusplus
}
#endif

#endif
71 changes: 71 additions & 0 deletions inst/include/arkode/arkode_butcher_erk.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* -----------------------------------------------------------------
* Programmer(s): Daniel R. Reynolds @ SMU
* -----------------------------------------------------------------
* SUNDIALS Copyright Start
* Copyright (c) 2002-2024, Lawrence Livermore National Security
* and Southern Methodist University.
* All rights reserved.
*
* See the top-level LICENSE and NOTICE files for details.
*
* SPDX-License-Identifier: BSD-3-Clause
* SUNDIALS Copyright End
* -----------------------------------------------------------------
* This is the header file for ARKode's built-in ERK Butcher tables.
* -----------------------------------------------------------------*/

#ifndef _ARKODE_ERK_TABLES_H
#define _ARKODE_ERK_TABLES_H

#include <arkode/arkode_butcher.h>

#ifdef __cplusplus /* wrapper to enable C++ usage */
extern "C" {
#endif

typedef enum
{
ARKODE_ERK_NONE = -1, /* ensure enum is signed int */
ARKODE_MIN_ERK_NUM = 0,
ARKODE_HEUN_EULER_2_1_2 = ARKODE_MIN_ERK_NUM,
ARKODE_BOGACKI_SHAMPINE_4_2_3,
ARKODE_ARK324L2SA_ERK_4_2_3,
ARKODE_ZONNEVELD_5_3_4,
ARKODE_ARK436L2SA_ERK_6_3_4,
ARKODE_SAYFY_ABURUB_6_3_4,
ARKODE_CASH_KARP_6_4_5,
ARKODE_FEHLBERG_6_4_5,
ARKODE_DORMAND_PRINCE_7_4_5,
ARKODE_ARK548L2SA_ERK_8_4_5,
ARKODE_VERNER_8_5_6,
ARKODE_FEHLBERG_13_7_8,
ARKODE_KNOTH_WOLKE_3_3,
ARKODE_ARK437L2SA_ERK_7_3_4,
ARKODE_ARK548L2SAb_ERK_8_4_5,
ARKODE_ARK2_ERK_3_1_2,
ARKODE_SOFRONIOU_SPALETTA_5_3_4,
ARKODE_SHU_OSHER_3_2_3,
ARKODE_VERNER_9_5_6,
ARKODE_VERNER_10_6_7,
ARKODE_VERNER_13_7_8,
ARKODE_VERNER_16_8_9,
ARKODE_FORWARD_EULER_1_1,
ARKODE_RALSTON_EULER_2_1_2,
ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2,
ARKODE_MAX_ERK_NUM = ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2
} ARKODE_ERKTableID;

/* Accessor routine to load built-in ERK table */
SUNDIALS_EXPORT ARKodeButcherTable
ARKodeButcherTable_LoadERK(ARKODE_ERKTableID emethod);

SUNDIALS_EXPORT ARKodeButcherTable
ARKodeButcherTable_LoadERKByName(const char* emethod);

SUNDIALS_EXPORT const char* ARKodeButcherTable_ERKIDToName(ARKODE_ERKTableID emethod);

#ifdef __cplusplus
}
#endif

#endif
Loading

0 comments on commit 30230f6

Please sign in to comment.